Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128484
b: refs/heads/master
c: 09e71a3
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent ba05a94 commit 62a90d6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 14048ed0c415b8729b194e92c16d31c61628d216
refs/heads/master: 09e71a326341f40111400c88aaf0498ef622824b
6 changes: 3 additions & 3 deletions trunk/fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,20 +647,20 @@ int close_ctree(struct btrfs_root *root)

int btrfs_buffer_uptodate(struct extent_buffer *buf)
{
struct inode *btree_inode = buf->first_page->mapping->host;
struct inode *btree_inode = buf->pages[0]->mapping->host;
return extent_buffer_uptodate(&BTRFS_I(btree_inode)->extent_tree, buf);
}

int btrfs_set_buffer_uptodate(struct extent_buffer *buf)
{
struct inode *btree_inode = buf->first_page->mapping->host;
struct inode *btree_inode = buf->pages[0]->mapping->host;
return set_extent_buffer_uptodate(&BTRFS_I(btree_inode)->extent_tree,
buf);
}

void btrfs_mark_buffer_dirty(struct extent_buffer *buf)
{
struct btrfs_root *root = BTRFS_I(buf->first_page->mapping->host)->root;
struct btrfs_root *root = BTRFS_I(buf->pages[0]->mapping->host)->root;
u64 transid = btrfs_header_generation(buf);
struct inode *btree_inode = root->fs_info->btree_inode;

Expand Down
22 changes: 8 additions & 14 deletions trunk/fs/btrfs/extent_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -1961,16 +1961,12 @@ static void __free_extent_buffer(struct extent_buffer *eb)
static inline struct page *extent_buffer_page(struct extent_buffer *eb, int i)
{
struct page *p;
if (i == 0)
return eb->first_page;

if (i < EXTENT_INLINE_PAGES)
return eb->pages[i];
i += eb->start >> PAGE_CACHE_SHIFT;
if (eb->last_page && eb->last_page->index == i)
return eb->last_page;

p = find_get_page(eb->first_page->mapping, i);
p = find_get_page(eb->pages[0]->mapping, i);
page_cache_release(p);
eb->last_page = p;
return p;
}

Expand Down Expand Up @@ -2012,8 +2008,8 @@ struct extent_buffer *alloc_extent_buffer(struct extent_map_tree *tree,
goto fail;
}
set_page_extent_mapped(p);
if (i == 0)
eb->first_page = p;
if (i < EXTENT_INLINE_PAGES)
eb->pages[i] = p;
if (!PageUptodate(p))
uptodate = 0;
unlock_page(p);
Expand Down Expand Up @@ -2059,8 +2055,8 @@ struct extent_buffer *find_extent_buffer(struct extent_map_tree *tree,
goto fail;
}
set_page_extent_mapped(p);
if (i == 0)
eb->first_page = p;
if (i < EXTENT_INLINE_PAGES)
eb->pages[i] = p;
if (!PageUptodate(p))
uptodate = 0;
unlock_page(p);
Expand All @@ -2087,9 +2083,7 @@ void free_extent_buffer(struct extent_buffer *eb)

num_pages = num_extent_pages(eb->start, eb->len);

if (eb->first_page)
page_cache_release(eb->first_page);
for (i = 1; i < num_pages; i++) {
for (i = 0; i < num_pages; i++) {
page_cache_release(extent_buffer_page(eb, i));
}
__free_extent_buffer(eb);
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/btrfs/extent_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,20 @@ struct extent_state {
struct list_head list;
};

#define EXTENT_INLINE_PAGES 32
struct extent_buffer {
u64 start;
unsigned long len;
atomic_t refs;
int flags;
struct list_head list;
struct list_head leak_list;
struct page *first_page;
struct page *last_page;
unsigned long alloc_addr;
char *map_token;
char *kaddr;
unsigned long map_start;
unsigned long map_len;
struct page *pages[EXTENT_INLINE_PAGES];
};

typedef struct extent_map *(get_extent_t)(struct inode *inode,
Expand Down

0 comments on commit 62a90d6

Please sign in to comment.