Skip to content

Commit

Permalink
Merge branch 'cleanups' of git://repo.or.cz/linux-2.6/btrfs-unstable …
Browse files Browse the repository at this point in the history
…into inode_numbers

Conflicts:
	fs/btrfs/extent-tree.c
	fs/btrfs/free-space-cache.c
	fs/btrfs/inode.c
	fs/btrfs/tree-log.c

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed May 22, 2011
2 parents 0d0ca30 + 4ea0288 commit 945d896
Show file tree
Hide file tree
Showing 38 changed files with 295 additions and 3,234 deletions.
2 changes: 1 addition & 1 deletion fs/btrfs/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ int btrfs_acl_chmod(struct inode *inode)
return 0;

acl = btrfs_get_acl(inode, ACL_TYPE_ACCESS);
if (IS_ERR(acl) || !acl)
if (IS_ERR_OR_NULL(acl))
return PTR_ERR(acl);

clone = posix_acl_clone(acl, GFP_KERNEL);
Expand Down
42 changes: 21 additions & 21 deletions fs/btrfs/compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,
struct compressed_bio *cb;
unsigned long bytes_left;
struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
int page_index = 0;
int pg_index = 0;
struct page *page;
u64 first_byte = disk_start;
struct block_device *bdev;
Expand Down Expand Up @@ -367,8 +367,8 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,

/* create and submit bios for the compressed pages */
bytes_left = compressed_len;
for (page_index = 0; page_index < cb->nr_pages; page_index++) {
page = compressed_pages[page_index];
for (pg_index = 0; pg_index < cb->nr_pages; pg_index++) {
page = compressed_pages[pg_index];
page->mapping = inode->i_mapping;
if (bio->bi_size)
ret = io_tree->ops->merge_bio_hook(page, 0,
Expand Down Expand Up @@ -433,7 +433,7 @@ static noinline int add_ra_bio_pages(struct inode *inode,
struct compressed_bio *cb)
{
unsigned long end_index;
unsigned long page_index;
unsigned long pg_index;
u64 last_offset;
u64 isize = i_size_read(inode);
int ret;
Expand All @@ -457,13 +457,13 @@ static noinline int add_ra_bio_pages(struct inode *inode,
end_index = (i_size_read(inode) - 1) >> PAGE_CACHE_SHIFT;

while (last_offset < compressed_end) {
page_index = last_offset >> PAGE_CACHE_SHIFT;
pg_index = last_offset >> PAGE_CACHE_SHIFT;

if (page_index > end_index)
if (pg_index > end_index)
break;

rcu_read_lock();
page = radix_tree_lookup(&mapping->page_tree, page_index);
page = radix_tree_lookup(&mapping->page_tree, pg_index);
rcu_read_unlock();
if (page) {
misses++;
Expand All @@ -477,7 +477,7 @@ static noinline int add_ra_bio_pages(struct inode *inode,
if (!page)
break;

if (add_to_page_cache_lru(page, mapping, page_index,
if (add_to_page_cache_lru(page, mapping, pg_index,
GFP_NOFS)) {
page_cache_release(page);
goto next;
Expand Down Expand Up @@ -561,7 +561,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
unsigned long uncompressed_len = bio->bi_vcnt * PAGE_CACHE_SIZE;
unsigned long compressed_len;
unsigned long nr_pages;
unsigned long page_index;
unsigned long pg_index;
struct page *page;
struct block_device *bdev;
struct bio *comp_bio;
Expand Down Expand Up @@ -614,10 +614,10 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,

bdev = BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev;

for (page_index = 0; page_index < nr_pages; page_index++) {
cb->compressed_pages[page_index] = alloc_page(GFP_NOFS |
for (pg_index = 0; pg_index < nr_pages; pg_index++) {
cb->compressed_pages[pg_index] = alloc_page(GFP_NOFS |
__GFP_HIGHMEM);
if (!cb->compressed_pages[page_index])
if (!cb->compressed_pages[pg_index])
goto fail2;
}
cb->nr_pages = nr_pages;
Expand All @@ -635,8 +635,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
comp_bio->bi_end_io = end_compressed_bio_read;
atomic_inc(&cb->pending_bios);

for (page_index = 0; page_index < nr_pages; page_index++) {
page = cb->compressed_pages[page_index];
for (pg_index = 0; pg_index < nr_pages; pg_index++) {
page = cb->compressed_pages[pg_index];
page->mapping = inode->i_mapping;
page->index = em_start >> PAGE_CACHE_SHIFT;

Expand Down Expand Up @@ -703,8 +703,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
return 0;

fail2:
for (page_index = 0; page_index < nr_pages; page_index++)
free_page((unsigned long)cb->compressed_pages[page_index]);
for (pg_index = 0; pg_index < nr_pages; pg_index++)
free_page((unsigned long)cb->compressed_pages[pg_index]);

kfree(cb->compressed_pages);
fail1:
Expand Down Expand Up @@ -946,7 +946,7 @@ void btrfs_exit_compress(void)
int btrfs_decompress_buf2page(char *buf, unsigned long buf_start,
unsigned long total_out, u64 disk_start,
struct bio_vec *bvec, int vcnt,
unsigned long *page_index,
unsigned long *pg_index,
unsigned long *pg_offset)
{
unsigned long buf_offset;
Expand All @@ -955,7 +955,7 @@ int btrfs_decompress_buf2page(char *buf, unsigned long buf_start,
unsigned long working_bytes = total_out - buf_start;
unsigned long bytes;
char *kaddr;
struct page *page_out = bvec[*page_index].bv_page;
struct page *page_out = bvec[*pg_index].bv_page;

/*
* start byte is the first byte of the page we're currently
Expand Down Expand Up @@ -996,11 +996,11 @@ int btrfs_decompress_buf2page(char *buf, unsigned long buf_start,

/* check if we need to pick another page */
if (*pg_offset == PAGE_CACHE_SIZE) {
(*page_index)++;
if (*page_index >= vcnt)
(*pg_index)++;
if (*pg_index >= vcnt)
return 0;

page_out = bvec[*page_index].bv_page;
page_out = bvec[*pg_index].bv_page;
*pg_offset = 0;
start_byte = page_offset(page_out) - disk_start;

Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/compression.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int btrfs_decompress(int type, unsigned char *data_in, struct page *dest_page,
int btrfs_decompress_buf2page(char *buf, unsigned long buf_start,
unsigned long total_out, u64 disk_start,
struct bio_vec *bvec, int vcnt,
unsigned long *page_index,
unsigned long *pg_index,
unsigned long *pg_offset);

int btrfs_submit_compressed_write(struct inode *inode, u64 start,
Expand Down
29 changes: 14 additions & 15 deletions fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void btrfs_free_path(struct btrfs_path *p)
{
if (!p)
return;
btrfs_release_path(NULL, p);
btrfs_release_path(p);
kmem_cache_free(btrfs_path_cachep, p);
}

Expand All @@ -112,7 +112,7 @@ void btrfs_free_path(struct btrfs_path *p)
*
* It is safe to call this on paths that no locks or extent buffers held.
*/
noinline void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p)
noinline void btrfs_release_path(struct btrfs_path *p)
{
int i;

Expand Down Expand Up @@ -1323,7 +1323,7 @@ static noinline int reada_for_balance(struct btrfs_root *root,
ret = -EAGAIN;

/* release the whole path */
btrfs_release_path(root, path);
btrfs_release_path(path);

/* read the blocks */
if (block1)
Expand Down Expand Up @@ -1470,7 +1470,7 @@ read_block_for_search(struct btrfs_trans_handle *trans,
return 0;
}
free_extent_buffer(tmp);
btrfs_release_path(NULL, p);
btrfs_release_path(p);
return -EIO;
}
}
Expand All @@ -1489,7 +1489,7 @@ read_block_for_search(struct btrfs_trans_handle *trans,
if (p->reada)
reada_for_search(root, p, level, slot, key->objectid);

btrfs_release_path(NULL, p);
btrfs_release_path(p);

ret = -EAGAIN;
tmp = read_tree_block(root, blocknr, blocksize, 0);
Expand Down Expand Up @@ -1558,7 +1558,7 @@ setup_nodes_for_search(struct btrfs_trans_handle *trans,
}
b = p->nodes[level];
if (!b) {
btrfs_release_path(NULL, p);
btrfs_release_path(p);
goto again;
}
BUG_ON(btrfs_header_nritems(b) == 1);
Expand Down Expand Up @@ -1748,7 +1748,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
if (!p->leave_spinning)
btrfs_set_path_blocking(p);
if (ret < 0)
btrfs_release_path(root, p);
btrfs_release_path(p);
return ret;
}

Expand Down Expand Up @@ -3021,7 +3021,7 @@ static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans,
struct btrfs_file_extent_item);
extent_len = btrfs_file_extent_num_bytes(leaf, fi);
}
btrfs_release_path(root, path);
btrfs_release_path(path);

path->keep_locks = 1;
path->search_for_split = 1;
Expand Down Expand Up @@ -3641,7 +3641,6 @@ int setup_items_for_insert(struct btrfs_trans_handle *trans,

ret = 0;
if (slot == 0) {
struct btrfs_disk_key disk_key;
btrfs_cpu_key_to_disk(&disk_key, cpu_key);
ret = fixup_low_keys(trans, root, path, &disk_key, 1);
}
Expand Down Expand Up @@ -3943,7 +3942,7 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
else
return 1;

btrfs_release_path(root, path);
btrfs_release_path(path);
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
if (ret < 0)
return ret;
Expand Down Expand Up @@ -4067,7 +4066,7 @@ int btrfs_search_forward(struct btrfs_root *root, struct btrfs_key *min_key,
sret = btrfs_find_next_key(root, path, min_key, level,
cache_only, min_trans);
if (sret == 0) {
btrfs_release_path(root, path);
btrfs_release_path(path);
goto again;
} else {
goto out;
Expand Down Expand Up @@ -4146,7 +4145,7 @@ int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path,
btrfs_node_key_to_cpu(c, &cur_key, slot);

orig_lowest = path->lowest_level;
btrfs_release_path(root, path);
btrfs_release_path(path);
path->lowest_level = level;
ret = btrfs_search_slot(NULL, root, &cur_key, path,
0, 0);
Expand Down Expand Up @@ -4223,7 +4222,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
again:
level = 1;
next = NULL;
btrfs_release_path(root, path);
btrfs_release_path(path);

path->keep_locks = 1;

Expand Down Expand Up @@ -4279,7 +4278,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
goto again;

if (ret < 0) {
btrfs_release_path(root, path);
btrfs_release_path(path);
goto done;
}

Expand Down Expand Up @@ -4318,7 +4317,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
goto again;

if (ret < 0) {
btrfs_release_path(root, path);
btrfs_release_path(path);
goto done;
}

Expand Down
Loading

0 comments on commit 945d896

Please sign in to comment.