Commit d397712b authored by Chris Mason's avatar Chris Mason
Browse files

Btrfs: Fix checkpatch.pl warnings



There were many, most are fixed now.  struct-funcs.c generates some warnings
but these are bogus.
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 1f3c79a2
......@@ -161,8 +161,7 @@ static int btrfs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
ret = __btrfs_setxattr(inode, name, value, size, 0);
out:
if (value)
kfree(value);
kfree(value);
if (!ret)
btrfs_update_cached_acl(inode, p_acl, acl);
......@@ -213,7 +212,7 @@ static int btrfs_xattr_acl_default_get(struct inode *inode, const char *name,
}
static int btrfs_xattr_acl_default_set(struct inode *inode, const char *name,
const void *value, size_t size, int flags)
const void *value, size_t size, int flags)
{
return btrfs_xattr_set_acl(inode, ACL_TYPE_DEFAULT, value, size);
}
......
......@@ -104,7 +104,7 @@ static noinline int run_ordered_completions(struct btrfs_workers *workers,
spin_lock_irqsave(&workers->lock, flags);
while(!list_empty(&workers->order_list)) {
while (!list_empty(&workers->order_list)) {
work = list_entry(workers->order_list.next,
struct btrfs_work, order_list);
......@@ -143,7 +143,7 @@ static int worker_loop(void *arg)
struct btrfs_work *work;
do {
spin_lock_irq(&worker->lock);
while(!list_empty(&worker->pending)) {
while (!list_empty(&worker->pending)) {
cur = worker->pending.next;
work = list_entry(cur, struct btrfs_work, list);
list_del(&work->list);
......@@ -188,7 +188,7 @@ int btrfs_stop_workers(struct btrfs_workers *workers)
struct btrfs_worker_thread *worker;
list_splice_init(&workers->idle_list, &workers->worker_list);
while(!list_empty(&workers->worker_list)) {
while (!list_empty(&workers->worker_list)) {
cur = workers->worker_list.next;
worker = list_entry(cur, struct btrfs_worker_thread,
worker_list);
......
......@@ -4,7 +4,7 @@
#define btrfs_drop_nlink(inode) drop_nlink(inode)
#define btrfs_inc_nlink(inode) inc_nlink(inode)
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,27)
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
static inline struct dentry *d_obtain_alias(struct inode *inode)
{
struct dentry *d;
......@@ -21,7 +21,7 @@ static inline struct dentry *d_obtain_alias(struct inode *inode)
}
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28)
# define __pagevec_lru_add_file __pagevec_lru_add
# define open_bdev_exclusive open_bdev_excl
# define close_bdev_exclusive(bdev, mode) close_bdev_excl(bdev)
......
......@@ -137,7 +137,8 @@ static int check_compressed_csum(struct inode *inode,
kunmap_atomic(kaddr, KM_USER0);
if (csum != *cb_sum) {
printk("btrfs csum failed ino %lu extent %llu csum %u "
printk(KERN_INFO "btrfs csum failed ino %lu "
"extent %llu csum %u "
"wanted %u mirror %d\n", inode->i_ino,
(unsigned long long)disk_start,
csum, *cb_sum, cb->mirror_num);
......@@ -217,7 +218,7 @@ csum_failed:
* we have verified the checksum already, set page
* checked so the end_io handlers know about it
*/
while(bio_index < cb->orig_bio->bi_vcnt) {
while (bio_index < cb->orig_bio->bi_vcnt) {
SetPageChecked(bvec->bv_page);
bvec++;
bio_index++;
......@@ -246,7 +247,7 @@ static noinline int end_compressed_writeback(struct inode *inode, u64 start,
int i;
int ret;
while(nr_pages > 0) {
while (nr_pages > 0) {
ret = find_get_pages_contig(inode->i_mapping, index,
min_t(unsigned long,
nr_pages, ARRAY_SIZE(pages)), pages);
......@@ -463,7 +464,7 @@ static noinline int add_ra_bio_pages(struct inode *inode,
end_index = (i_size_read(inode) - 1) >> PAGE_CACHE_SHIFT;
pagevec_init(&pvec, 0);
while(last_offset < compressed_end) {
while (last_offset < compressed_end) {
page_index = last_offset >> PAGE_CACHE_SHIFT;
if (page_index > end_index)
......@@ -697,9 +698,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
ret = btrfs_bio_wq_end_io(root->fs_info, comp_bio, 0);
BUG_ON(ret);
if (!btrfs_test_flag(inode, NODATASUM)) {
if (!btrfs_test_flag(inode, NODATASUM))
btrfs_lookup_bio_sums(root, inode, comp_bio, sums);
}
ret = btrfs_map_bio(root, READ, comp_bio, mirror_num, 0);
BUG_ON(ret);
......
......@@ -67,7 +67,7 @@ void btrfs_free_path(struct btrfs_path *p)
*
* It is safe to call this on paths that no locks or extent buffers held.
*/
void noinline btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p)
noinline void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p)
{
int i;
......@@ -112,7 +112,7 @@ struct extent_buffer *btrfs_lock_root_node(struct btrfs_root *root)
{
struct extent_buffer *eb;
while(1) {
while (1) {
eb = btrfs_root_node(root);
btrfs_tree_lock(eb);
......@@ -202,22 +202,22 @@ int btrfs_copy_root(struct btrfs_trans_handle *trans,
}
/*
* does the dirty work in cow of a single block. The parent block
* (if supplied) is updated to point to the new cow copy. The new
* buffer is marked dirty and returned locked. If you modify the block
* it needs to be marked dirty again.
* does the dirty work in cow of a single block. The parent block (if
* supplied) is updated to point to the new cow copy. The new buffer is marked
* dirty and returned locked. If you modify the block it needs to be marked
* dirty again.
*
* search_start -- an allocation hint for the new block
*
* empty_size -- a hint that you plan on doing more cow. This is the size in bytes
* the allocator should try to find free next to the block it returns. This is
* just a hint and may be ignored by the allocator.
* empty_size -- a hint that you plan on doing more cow. This is the size in
* bytes the allocator should try to find free next to the block it returns.
* This is just a hint and may be ignored by the allocator.
*
* prealloc_dest -- if you have already reserved a destination for the cow,
* this uses that block instead of allocating a new one. btrfs_alloc_reserved_extent
* is used to finish the allocation.
* this uses that block instead of allocating a new one.
* btrfs_alloc_reserved_extent is used to finish the allocation.
*/
static int noinline __btrfs_cow_block(struct btrfs_trans_handle *trans,
static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
struct extent_buffer *buf,
struct extent_buffer *parent, int parent_slot,
......@@ -366,7 +366,7 @@ static int noinline __btrfs_cow_block(struct btrfs_trans_handle *trans,
* This version of it has extra checks so that a block isn't cow'd more than
* once per transaction, as long as it hasn't been written yet
*/
int noinline btrfs_cow_block(struct btrfs_trans_handle *trans,
noinline int btrfs_cow_block(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct extent_buffer *buf,
struct extent_buffer *parent, int parent_slot,
struct extent_buffer **cow_ret, u64 prealloc_dest)
......@@ -375,13 +375,16 @@ int noinline btrfs_cow_block(struct btrfs_trans_handle *trans,
int ret;
if (trans->transaction != root->fs_info->running_transaction) {
printk(KERN_CRIT "trans %Lu running %Lu\n", trans->transid,
printk(KERN_CRIT "trans %llu running %llu\n",
(unsigned long long)trans->transid,
(unsigned long long)
root->fs_info->running_transaction->transid);
WARN_ON(1);
}
if (trans->transid != root->fs_info->generation) {
printk(KERN_CRIT "trans %Lu running %Lu\n", trans->transid,
root->fs_info->generation);
printk(KERN_CRIT "trans %llu running %llu\n",
(unsigned long long)trans->transid,
(unsigned long long)root->fs_info->generation);
WARN_ON(1);
}
......@@ -489,16 +492,10 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans,
if (cache_only && parent_level != 1)
return 0;
if (trans->transaction != root->fs_info->running_transaction) {
printk(KERN_CRIT "trans %Lu running %Lu\n", trans->transid,
root->fs_info->running_transaction->transid);
if (trans->transaction != root->fs_info->running_transaction)
WARN_ON(1);
}
if (trans->transid != root->fs_info->generation) {
printk(KERN_CRIT "trans %Lu running %Lu\n", trans->transid,
root->fs_info->generation);
if (trans->transid != root->fs_info->generation)
WARN_ON(1);
}
parent_nritems = btrfs_header_nritems(parent);
blocksize = btrfs_level_size(root, parent_level - 1);
......@@ -681,51 +678,18 @@ static int check_leaf(struct btrfs_root *root, struct btrfs_path *path,
BUG_ON(btrfs_node_blockptr(parent, parent_slot) !=
btrfs_header_bytenr(leaf));
}
#if 0
for (i = 0; nritems > 1 && i < nritems - 2; i++) {
btrfs_item_key_to_cpu(leaf, &cpukey, i + 1);
btrfs_item_key(leaf, &leaf_key, i);
if (comp_keys(&leaf_key, &cpukey) >= 0) {
btrfs_print_leaf(root, leaf);
printk("slot %d offset bad key\n", i);
BUG_ON(1);
}
if (btrfs_item_offset_nr(leaf, i) !=
btrfs_item_end_nr(leaf, i + 1)) {
btrfs_print_leaf(root, leaf);
printk("slot %d offset bad\n", i);
BUG_ON(1);
}
if (i == 0) {
if (btrfs_item_offset_nr(leaf, i) +
btrfs_item_size_nr(leaf, i) !=
BTRFS_LEAF_DATA_SIZE(root)) {
btrfs_print_leaf(root, leaf);
printk("slot %d first offset bad\n", i);
BUG_ON(1);
}
}
}
if (nritems > 0) {
if (btrfs_item_size_nr(leaf, nritems - 1) > 4096) {
btrfs_print_leaf(root, leaf);
printk("slot %d bad size \n", nritems - 1);
BUG_ON(1);
}
}
#endif
if (slot != 0 && slot < nritems - 1) {
btrfs_item_key(leaf, &leaf_key, slot);
btrfs_item_key_to_cpu(leaf, &cpukey, slot - 1);
if (comp_keys(&leaf_key, &cpukey) <= 0) {
btrfs_print_leaf(root, leaf);
printk("slot %d offset bad key\n", slot);
printk(KERN_CRIT "slot %d offset bad key\n", slot);
BUG_ON(1);
}
if (btrfs_item_offset_nr(leaf, slot - 1) !=
btrfs_item_end_nr(leaf, slot)) {
btrfs_print_leaf(root, leaf);
printk("slot %d offset bad\n", slot);
printk(KERN_CRIT "slot %d offset bad\n", slot);
BUG_ON(1);
}
}
......@@ -736,7 +700,7 @@ static int check_leaf(struct btrfs_root *root, struct btrfs_path *path,
if (btrfs_item_offset_nr(leaf, slot) !=
btrfs_item_end_nr(leaf, slot + 1)) {
btrfs_print_leaf(root, leaf);
printk("slot %d offset bad\n", slot);
printk(KERN_CRIT "slot %d offset bad\n", slot);
BUG_ON(1);
}
}
......@@ -745,30 +709,10 @@ static int check_leaf(struct btrfs_root *root, struct btrfs_path *path,
return 0;
}
static int noinline check_block(struct btrfs_root *root,
static noinline int check_block(struct btrfs_root *root,
struct btrfs_path *path, int level)
{
u64 found_start;
return 0;
if (btrfs_header_level(path->nodes[level]) != level)
printk("warning: bad level %Lu wanted %d found %d\n",
path->nodes[level]->start, level,
btrfs_header_level(path->nodes[level]));
found_start = btrfs_header_bytenr(path->nodes[level]);
if (found_start != path->nodes[level]->start) {
printk("warning: bad bytentr %Lu found %Lu\n",
path->nodes[level]->start, found_start);
}
#if 0
struct extent_buffer *buf = path->nodes[level];
if (memcmp_extent_buffer(buf, root->fs_info->fsid,
(unsigned long)btrfs_header_fsid(buf),
BTRFS_FSID_SIZE)) {
printk("warning bad block %Lu\n", buf->start);
return 1;
}
#endif
if (level == 0)
return check_leaf(root, path, level);
return check_node(root, path, level);
......@@ -802,7 +746,7 @@ static noinline int generic_bin_search(struct extent_buffer *eb,
unsigned long map_len = 0;
int err;
while(low < high) {
while (low < high) {
mid = (low + high) / 2;
offset = p + mid * item_size;
......@@ -1130,7 +1074,7 @@ enospc:
* when they are completely full. This is also done top down, so we
* have to be pessimistic.
*/
static int noinline push_nodes_for_insert(struct btrfs_trans_handle *trans,
static noinline int push_nodes_for_insert(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
struct btrfs_path *path, int level)
{
......@@ -1296,7 +1240,7 @@ static noinline void reada_for_search(struct btrfs_root *root,
nritems = btrfs_header_nritems(node);
nr = slot;
while(1) {
while (1) {
if (direction < 0) {
if (nr == 0)
break;
......@@ -1322,7 +1266,8 @@ static noinline void reada_for_search(struct btrfs_root *root,
nscan++;
if (path->reada < 2 && (nread > (64 * 1024) || nscan > 32))
break;
if(nread > (256 * 1024) || nscan > 128)
if (nread > (256 * 1024) || nscan > 128)
break;
if (search < lowest_read)
......@@ -1333,17 +1278,17 @@ static noinline void reada_for_search(struct btrfs_root *root,
}
/*
* when we walk down the tree, it is usually safe to unlock the higher layers in
* the tree. The exceptions are when our path goes through slot 0, because operations
* on the tree might require changing key pointers higher up in the tree.
* when we walk down the tree, it is usually safe to unlock the higher layers
* in the tree. The exceptions are when our path goes through slot 0, because
* operations on the tree might require changing key pointers higher up in the
* tree.
*
* callers might also have set path->keep_locks, which tells this code to
* keep the lock if the path points to the last slot in the block. This is
* part of walking through the tree, and selecting the next slot in the higher
* block.
* callers might also have set path->keep_locks, which tells this code to keep
* the lock if the path points to the last slot in the block. This is part of
* walking through the tree, and selecting the next slot in the higher block.
*
* lowest_unlock sets the lowest level in the tree we're allowed to unlock.
* so if lowest_unlock is 1, level 0 won't be unlocked
* lowest_unlock sets the lowest level in the tree we're allowed to unlock. so
* if lowest_unlock is 1, level 0 won't be unlocked
*/
static noinline void unlock_up(struct btrfs_path *path, int level,
int lowest_unlock)
......@@ -1832,9 +1777,8 @@ static int push_node_left(struct btrfs_trans_handle *trans,
if (!empty && src_nritems <= 8)
return 1;
if (push_items <= 0) {
if (push_items <= 0)
return 1;
}
if (empty) {
push_items = min(src_nritems, push_items);
......@@ -1854,7 +1798,7 @@ static int push_node_left(struct btrfs_trans_handle *trans,
copy_extent_buffer(dst, src,
btrfs_node_key_ptr_offset(dst_nritems),
btrfs_node_key_ptr_offset(0),
push_items * sizeof(struct btrfs_key_ptr));
push_items * sizeof(struct btrfs_key_ptr));
if (push_items < src_nritems) {
memmove_extent_buffer(src, btrfs_node_key_ptr_offset(0),
......@@ -1899,19 +1843,16 @@ static int balance_node_right(struct btrfs_trans_handle *trans,
src_nritems = btrfs_header_nritems(src);
dst_nritems = btrfs_header_nritems(dst);
push_items = BTRFS_NODEPTRS_PER_BLOCK(root) - dst_nritems;
if (push_items <= 0) {
if (push_items <= 0)
return 1;
}
if (src_nritems < 4) {
if (src_nritems < 4)
return 1;
}
max_push = src_nritems / 2 + 1;
/* don't try to empty the node */
if (max_push >= src_nritems) {
if (max_push >= src_nritems)
return 1;
}
if (max_push < push_items)
push_items = max_push;
......@@ -1924,7 +1865,7 @@ static int balance_node_right(struct btrfs_trans_handle *trans,
copy_extent_buffer(dst, src,
btrfs_node_key_ptr_offset(0),
btrfs_node_key_ptr_offset(src_nritems - push_items),
push_items * sizeof(struct btrfs_key_ptr));
push_items * sizeof(struct btrfs_key_ptr));
btrfs_set_header_nritems(src, src_nritems - push_items);
btrfs_set_header_nritems(dst, dst_nritems + push_items);
......@@ -1945,7 +1886,7 @@ static int balance_node_right(struct btrfs_trans_handle *trans,
*
* returns zero on success or < 0 on failure.
*/
static int noinline insert_new_root(struct btrfs_trans_handle *trans,
static noinline int insert_new_root(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
struct btrfs_path *path, int level)
{
......@@ -2176,14 +2117,15 @@ static int leaf_space_used(struct extent_buffer *l, int start, int nr)
* the start of the leaf data. IOW, how much room
* the leaf has left for both items and data
*/
int noinline btrfs_leaf_free_space(struct btrfs_root *root,
noinline int btrfs_leaf_free_space(struct btrfs_root *root,
struct extent_buffer *leaf)
{
int nritems = btrfs_header_nritems(leaf);
int ret;
ret = BTRFS_LEAF_DATA_SIZE(root) - leaf_space_used(leaf, 0, nritems);
if (ret < 0) {
printk("leaf free space ret %d, leaf data size %lu, used %d nritems %d\n",
printk(KERN_CRIT "leaf free space ret %d, leaf data size %lu, "
"used %d nritems %d\n",
ret, (unsigned long) BTRFS_LEAF_DATA_SIZE(root),
leaf_space_used(leaf, 0, nritems), nritems);
}
......@@ -2219,9 +2161,9 @@ static int push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root
int ret;
slot = path->slots[1];
if (!path->nodes[1]) {
if (!path->nodes[1])
return 1;
}
upper = path->nodes[1];
if (slot >= btrfs_header_nritems(upper) - 1)
return 1;
......@@ -2418,9 +2360,8 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root
return 1;
right_nritems = btrfs_header_nritems(right);
if (right_nritems == 0) {
if (right_nritems == 0)
return 1;
}
WARN_ON(!btrfs_tree_locked(path->nodes[1]));
......@@ -2502,7 +2443,7 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root
push_items * sizeof(struct btrfs_item));
push_space = BTRFS_LEAF_DATA_SIZE(root) -
btrfs_item_offset_nr(right, push_items -1);
btrfs_item_offset_nr(right, push_items - 1);
copy_extent_buffer(left, right, btrfs_leaf_data(left) +
leaf_data_end(root, left) - push_space,
......@@ -2537,7 +2478,8 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root
/* fixup right node */
if (push_items > right_nritems) {
printk("push items %d nr %u\n", push_items, right_nritems);
printk(KERN_CRIT "push items %d nr %u\n", push_items,
right_nritems);
WARN_ON(1);
}
......@@ -2640,9 +2582,8 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans,
/* first try to make some room by pushing left and right */
if (data_size && ins_key->type != BTRFS_DIR_ITEM_KEY) {
wret = push_leaf_right(trans, root, path, data_size, 0);
if (wret < 0) {
if (wret < 0)
return wret;
}
if (wret) {
wret = push_leaf_left(trans, root, path, data_size, 0);
if (wret < 0)
......@@ -2665,7 +2606,7 @@ again:
l = path->nodes[0];
slot = path->slots[0];
nritems = btrfs_header_nritems(l);
mid = (nritems + 1)/ 2;
mid = (nritems + 1) / 2;
right = btrfs_alloc_free_block(trans, root, root->leafsize,
path->nodes[1]->start,
......@@ -2734,7 +2675,7 @@ again:
path->slots[0] = 0;
if (path->slots[1] == 0) {
wret = fixup_low_keys(trans, root,
path, &disk_key, 1);
path, &disk_key, 1);
if (wret)
ret = wret;
}
......@@ -3033,8 +2974,8 @@ int btrfs_truncate_item(struct btrfs_trans_handle *trans,
BTRFS_FILE_EXTENT_INLINE) {
ptr = btrfs_item_ptr_offset(leaf, slot);
memmove_extent_buffer(leaf, ptr,
(unsigned long)fi,
offsetof(struct btrfs_file_extent_item,
(unsigned long)fi,
offsetof(struct btrfs_file_extent_item,
disk_bytenr));
}
}
......@@ -3096,7 +3037,8 @@ int btrfs_extend_item(struct btrfs_trans_handle *trans,
BUG_ON(slot < 0);
if (slot >= nritems) {
btrfs_print_leaf(root, leaf);
printk("slot %d too large, nritems %d\n", slot, nritems);
printk(KERN_CRIT "slot %d too large, nritems %d\n",
slot, nritems);
BUG_ON(1);
}
......@@ -3218,7 +3160,7 @@ int btrfs_insert_some_items(struct btrfs_trans_handle *trans,
if (old_data < data_end) {
btrfs_print_leaf(root, leaf);
printk("slot %d old_data %d data_end %d\n",
printk(KERN_CRIT "slot %d old_data %d data_end %d\n",
slot, old_data, data_end);
BUG_ON(1);
}
......@@ -3317,9 +3259,8 @@ int btrfs_insert_empty_items(struct btrfs_trans_handle *trans,
unsigned int data_end;
struct btrfs_disk_key disk_key;
for (i = 0; i < nr; i++) {
for (i = 0; i < nr; i++)
total_data += data_size[i];
}
total_size = total_data + (nr * sizeof(struct btrfs_item));
ret = btrfs_search_slot(trans, root, cpu_key, path, total_size, 1);
......@@ -3336,7 +3277,7 @@ int btrfs_insert_empty_items(struct btrfs_trans_handle *trans,
if (btrfs_leaf_free_space(root, leaf) < total_size) {
btrfs_print_leaf(root, leaf);
printk("not enough freespace need %u have %d\n",
printk(KERN_CRIT "not enough freespace need %u have %d\n",
total_size, btrfs_leaf_free_space(root, leaf));
BUG();
}
......@@ -3349,7 +3290,7 @@ int btrfs_insert_empty_items(struct btrfs_trans_handle *trans,
if (old_data < data_end) {
btrfs_print_leaf(root, leaf);
printk("slot %d old_data %d data_end %d\n",
printk(KERN_CRIT "slot %d old_data %d data_end %d\n",
slot, old_data, data_end);
BUG_ON(1);
}
......@@ -3457,7 +3398,7 @@ static int del_ptr(struct btrfs_trans_handle *trans, struct btrfs_root *root,
int wret;
nritems = btrfs_header_nritems(parent);
if (slot != nritems -1) {
if (slot != nritems - 1) {
memmove_extent_buffer(parent,
btrfs_node_key_ptr_offset(slot),
btrfs_node_key_ptr_offset(slot + 1),
......@@ -3614,7 +3555,8 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
if (btrfs_header_nritems(leaf) == 0) {
path->slots[1] = slot;
ret = btrfs_del_leaf(trans, root, path, leaf->start);
ret = btrfs_del_leaf(trans, root, path,
leaf->start);
BUG_ON(ret);
free_extent_buffer(leaf);
} else {
......@@ -3717,7 +3659,7 @@ again:
ret = 1;
goto out;
}
while(1) {
while (1) {
nritems = btrfs_header_nritems(cur);
level = btrfs_header_level(cur);
sret = bin_search(cur, min_key, level, &slot);
......@@ -3738,7 +3680,7 @@ again:
* min_trans parameters. If it isn't in cache or is too
* old, skip to the next one.
*/
while(slot < nritems) {
while (slot < nritems) {
u64 blockptr;
u64 gen;
struct extent_buffer *tmp;
......@@ -3830,7 +3772,7 @@ int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path,
struct extent_buffer *c;
WARN_ON(!path->keep_locks);
while(level < BTRFS_MAX_LEVEL) {
while (level < BTRFS_MAX_LEVEL) {
if (!path->nodes[level])
return 1;
......@@ -3839,9 +3781,8 @@ int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path,
next:
if (slot >= btrfs_header_nritems(c)) {
level++;
if (level == BTRFS_MAX_LEVEL) {
if (level == BTRFS_MAX_LEVEL)
return 1;
}
continue;
}
if (level == 0)
......@@ -3889,9 +3830,8 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
int ret;
nritems = btrfs_header_nritems(path->nodes[0]);
if (nritems == 0) {
if (nritems == 0)
return 1;
}
btrfs_item_key_to_cpu(path->nodes[0], &key, nritems - 1);
......@@ -3915,7 +3855,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
goto done;
}