btrfs-progs: drop unused parameter from btrfs_item_nr

Remove unused eb parameter from btrfs_item_nr, unused since introduced
in 7777e63b42

Signed-off-by: Ross Kirk <ross.kirk@gmail.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
Ross Kirk 2013-09-20 10:55:26 +01:00 committed by Chris Mason
parent 7985fe64e0
commit af86684e9b
8 changed files with 46 additions and 47 deletions

View File

@ -74,7 +74,7 @@ static int walk_leaf(struct btrfs_root *root, struct btrfs_path *path,
if (btrfs_file_extent_type(b, fi) == BTRFS_FILE_EXTENT_INLINE)
stat->total_inline +=
btrfs_file_extent_inline_item_len(b,
btrfs_item_nr(b, i));
btrfs_item_nr(i));
}
return 0;

View File

@ -516,7 +516,7 @@ static void zero_items(struct metadump_struct *md, u8 *dst,
int i, extent_type;
for (i = 0; i < nritems; i++) {
item = btrfs_item_nr(src, i);
item = btrfs_item_nr(i);
btrfs_item_key_to_cpu(src, &key, i);
if (key.type == BTRFS_CSUM_ITEM_KEY) {
size = btrfs_item_size_nr(src, i);
@ -1459,7 +1459,7 @@ static void truncate_item(struct extent_buffer *eb, int slot, u32 new_size)
for (i = slot; i < nritems; i++) {
u32 ioff;
item = btrfs_item_nr(eb, i);
item = btrfs_item_nr(i);
ioff = btrfs_item_offset(eb, item);
btrfs_set_item_offset(eb, item, ioff + size_diff);
}
@ -1467,7 +1467,7 @@ static void truncate_item(struct extent_buffer *eb, int slot, u32 new_size)
memmove_extent_buffer(eb, btrfs_leaf_data(eb) + data_end + size_diff,
btrfs_leaf_data(eb) + data_end,
old_data_start + new_size - data_end);
item = btrfs_item_nr(eb, slot);
item = btrfs_item_nr(slot);
btrfs_set_item_size(eb, item, new_size);
}

View File

@ -229,7 +229,7 @@ static int copy_one_inline(int fd, struct btrfs_path *path, u64 pos)
struct btrfs_file_extent_item);
ptr = btrfs_file_extent_inline_start(fi);
len = btrfs_file_extent_inline_item_len(leaf,
btrfs_item_nr(leaf, path->slots[0]));
btrfs_item_nr(path->slots[0]));
read_extent_buffer(leaf, buf, ptr, len);
compress = btrfs_file_extent_compression(leaf, fi);

30
ctree.c
View File

@ -1601,7 +1601,7 @@ static int push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root
i = left_nritems - 1;
while (i >= nr) {
item = btrfs_item_nr(left, i);
item = btrfs_item_nr(i);
if (path->slots[0] == i)
push_space += data_size + sizeof(*item);
@ -1657,7 +1657,7 @@ static int push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_header_nritems(right, right_nritems);
push_space = BTRFS_LEAF_DATA_SIZE(root);
for (i = 0; i < right_nritems; i++) {
item = btrfs_item_nr(right, i);
item = btrfs_item_nr(i);
push_space -= btrfs_item_size(right, item);
btrfs_set_item_offset(right, item, push_space);
}
@ -1748,7 +1748,7 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root
nr = right_nritems - 1;
for (i = 0; i < nr; i++) {
item = btrfs_item_nr(right, i);
item = btrfs_item_nr(i);
if (path->slots[0] == i)
push_space += data_size + sizeof(*item);
@ -1789,7 +1789,7 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root
for (i = old_left_nritems; i < old_left_nritems + push_items; i++) {
u32 ioff;
item = btrfs_item_nr(left, i);
item = btrfs_item_nr(i);
ioff = btrfs_item_offset(left, item);
btrfs_set_item_offset(left, item,
ioff - (BTRFS_LEAF_DATA_SIZE(root) - old_left_item_size));
@ -1819,7 +1819,7 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_header_nritems(right, right_nritems);
push_space = BTRFS_LEAF_DATA_SIZE(root);
for (i = 0; i < right_nritems; i++) {
item = btrfs_item_nr(right, i);
item = btrfs_item_nr(i);
push_space = push_space - btrfs_item_size(right, item);
btrfs_set_item_offset(right, item, push_space);
}
@ -1884,7 +1884,7 @@ static noinline int copy_for_split(struct btrfs_trans_handle *trans,
btrfs_item_end_nr(l, mid);
for (i = 0; i < nritems; i++) {
struct btrfs_item *item = btrfs_item_nr(right, i);
struct btrfs_item *item = btrfs_item_nr(i);
u32 ioff = btrfs_item_offset(right, item);
btrfs_set_item_offset(right, item, ioff + rt_data_off);
}
@ -2133,7 +2133,7 @@ int btrfs_split_item(struct btrfs_trans_handle *trans,
leaf = path->nodes[0];
split:
item = btrfs_item_nr(leaf, path->slots[0]);
item = btrfs_item_nr(path->slots[0]);
orig_offset = btrfs_item_offset(leaf, item);
item_size = btrfs_item_size(leaf, item);
@ -2157,7 +2157,7 @@ split:
btrfs_cpu_key_to_disk(&disk_key, new_key);
btrfs_set_item_key(leaf, &disk_key, slot);
new_item = btrfs_item_nr(leaf, slot);
new_item = btrfs_item_nr(slot);
btrfs_set_item_offset(leaf, new_item, orig_offset);
btrfs_set_item_size(leaf, new_item, item_size - split_offset);
@ -2227,7 +2227,7 @@ int btrfs_truncate_item(struct btrfs_trans_handle *trans,
/* first correct the data pointers */
for (i = slot; i < nritems; i++) {
u32 ioff;
item = btrfs_item_nr(leaf, i);
item = btrfs_item_nr(i);
ioff = btrfs_item_offset(leaf, item);
btrfs_set_item_offset(leaf, item, ioff + size_diff);
}
@ -2273,7 +2273,7 @@ int btrfs_truncate_item(struct btrfs_trans_handle *trans,
fixup_low_keys(trans, root, path, &disk_key, 1);
}
item = btrfs_item_nr(leaf, slot);
item = btrfs_item_nr(slot);
btrfs_set_item_size(leaf, item, new_size);
btrfs_mark_buffer_dirty(leaf);
@ -2324,7 +2324,7 @@ int btrfs_extend_item(struct btrfs_trans_handle *trans,
/* first correct the data pointers */
for (i = slot; i < nritems; i++) {
u32 ioff;
item = btrfs_item_nr(leaf, i);
item = btrfs_item_nr(i);
ioff = btrfs_item_offset(leaf, item);
btrfs_set_item_offset(leaf, item, ioff - data_size);
}
@ -2336,7 +2336,7 @@ int btrfs_extend_item(struct btrfs_trans_handle *trans,
data_end = old_data;
old_size = btrfs_item_size_nr(leaf, slot);
item = btrfs_item_nr(leaf, slot);
item = btrfs_item_nr(slot);
btrfs_set_item_size(leaf, item, old_size + data_size);
btrfs_mark_buffer_dirty(leaf);
@ -2416,7 +2416,7 @@ int btrfs_insert_empty_items(struct btrfs_trans_handle *trans,
for (i = slot; i < nritems; i++) {
u32 ioff;
item = btrfs_item_nr(leaf, i);
item = btrfs_item_nr(i);
ioff = btrfs_item_offset(leaf, item);
btrfs_set_item_offset(leaf, item, ioff - total_data);
}
@ -2437,7 +2437,7 @@ int btrfs_insert_empty_items(struct btrfs_trans_handle *trans,
for (i = 0; i < nr; i++) {
btrfs_cpu_key_to_disk(&disk_key, cpu_key + i);
btrfs_set_item_key(leaf, &disk_key, slot + i);
item = btrfs_item_nr(leaf, slot + i);
item = btrfs_item_nr(slot + i);
btrfs_set_item_offset(leaf, item, data_end - data_size[i]);
data_end -= data_size[i];
btrfs_set_item_size(leaf, item, data_size[i]);
@ -2589,7 +2589,7 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
for (i = slot + nr; i < nritems; i++) {
u32 ioff;
item = btrfs_item_nr(leaf, i);
item = btrfs_item_nr(i);
ioff = btrfs_item_offset(leaf, item);
btrfs_set_item_offset(leaf, item, ioff + dsize);
}

13
ctree.h
View File

@ -1573,8 +1573,7 @@ static inline unsigned long btrfs_item_nr_offset(int nr)
sizeof(struct btrfs_item) * nr;
}
static inline struct btrfs_item *btrfs_item_nr(struct extent_buffer *eb,
int nr)
static inline struct btrfs_item *btrfs_item_nr(int nr)
{
return (struct btrfs_item *)btrfs_item_nr_offset(nr);
}
@ -1587,30 +1586,30 @@ static inline u32 btrfs_item_end(struct extent_buffer *eb,
static inline u32 btrfs_item_end_nr(struct extent_buffer *eb, int nr)
{
return btrfs_item_end(eb, btrfs_item_nr(eb, nr));
return btrfs_item_end(eb, btrfs_item_nr(nr));
}
static inline u32 btrfs_item_offset_nr(struct extent_buffer *eb, int nr)
{
return btrfs_item_offset(eb, btrfs_item_nr(eb, nr));
return btrfs_item_offset(eb, btrfs_item_nr(nr));
}
static inline u32 btrfs_item_size_nr(struct extent_buffer *eb, int nr)
{
return btrfs_item_size(eb, btrfs_item_nr(eb, nr));
return btrfs_item_size(eb, btrfs_item_nr(nr));
}
static inline void btrfs_item_key(struct extent_buffer *eb,
struct btrfs_disk_key *disk_key, int nr)
{
struct btrfs_item *item = btrfs_item_nr(eb, nr);
struct btrfs_item *item = btrfs_item_nr(nr);
read_eb_member(eb, item, struct btrfs_item, key, disk_key);
}
static inline void btrfs_set_item_key(struct extent_buffer *eb,
struct btrfs_disk_key *disk_key, int nr)
{
struct btrfs_item *item = btrfs_item_nr(eb, nr);
struct btrfs_item *item = btrfs_item_nr(nr);
write_eb_member(eb, item, struct btrfs_item, key, disk_key);
}

View File

@ -52,7 +52,7 @@ static struct btrfs_dir_item *insert_with_overflow(struct btrfs_trans_handle
return ERR_PTR(ret);
WARN_ON(ret > 0);
leaf = path->nodes[0];
item = btrfs_item_nr(leaf, path->slots[0]);
item = btrfs_item_nr(path->slots[0]);
ptr = btrfs_item_ptr(leaf, path->slots[0], char);
BUG_ON(data_size > btrfs_item_size(leaf, item));
ptr += btrfs_item_size(leaf, item) - data_size;

View File

@ -730,7 +730,7 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
print_uuids(l);
fflush(stdout);
for (i = 0 ; i < nr ; i++) {
item = btrfs_item_nr(l, i);
item = btrfs_item_nr(i);
btrfs_item_key(l, &disk_key, i);
objectid = btrfs_disk_key_objectid(&disk_key);
type = btrfs_disk_key_type(&disk_key);

36
utils.c
View File

@ -164,8 +164,8 @@ int make_btrfs(int fd, const char *device, const char *label,
btrfs_set_root_bytenr(&root_item, blocks[2]);
btrfs_set_disk_key_objectid(&disk_key, BTRFS_EXTENT_TREE_OBJECTID);
btrfs_set_item_key(buf, &disk_key, nritems);
btrfs_set_item_offset(buf, btrfs_item_nr(buf, nritems), itemoff);
btrfs_set_item_size(buf, btrfs_item_nr(buf, nritems),
btrfs_set_item_offset(buf, btrfs_item_nr(nritems), itemoff);
btrfs_set_item_size(buf, btrfs_item_nr(nritems),
sizeof(root_item));
write_extent_buffer(buf, &root_item, btrfs_item_ptr_offset(buf,
nritems), sizeof(root_item));
@ -175,8 +175,8 @@ int make_btrfs(int fd, const char *device, const char *label,
btrfs_set_root_bytenr(&root_item, blocks[4]);
btrfs_set_disk_key_objectid(&disk_key, BTRFS_DEV_TREE_OBJECTID);
btrfs_set_item_key(buf, &disk_key, nritems);
btrfs_set_item_offset(buf, btrfs_item_nr(buf, nritems), itemoff);
btrfs_set_item_size(buf, btrfs_item_nr(buf, nritems),
btrfs_set_item_offset(buf, btrfs_item_nr(nritems), itemoff);
btrfs_set_item_size(buf, btrfs_item_nr(nritems),
sizeof(root_item));
write_extent_buffer(buf, &root_item,
btrfs_item_ptr_offset(buf, nritems),
@ -187,8 +187,8 @@ int make_btrfs(int fd, const char *device, const char *label,
btrfs_set_root_bytenr(&root_item, blocks[5]);
btrfs_set_disk_key_objectid(&disk_key, BTRFS_FS_TREE_OBJECTID);
btrfs_set_item_key(buf, &disk_key, nritems);
btrfs_set_item_offset(buf, btrfs_item_nr(buf, nritems), itemoff);
btrfs_set_item_size(buf, btrfs_item_nr(buf, nritems),
btrfs_set_item_offset(buf, btrfs_item_nr(nritems), itemoff);
btrfs_set_item_size(buf, btrfs_item_nr(nritems),
sizeof(root_item));
write_extent_buffer(buf, &root_item,
btrfs_item_ptr_offset(buf, nritems),
@ -199,8 +199,8 @@ int make_btrfs(int fd, const char *device, const char *label,
btrfs_set_root_bytenr(&root_item, blocks[6]);
btrfs_set_disk_key_objectid(&disk_key, BTRFS_CSUM_TREE_OBJECTID);
btrfs_set_item_key(buf, &disk_key, nritems);
btrfs_set_item_offset(buf, btrfs_item_nr(buf, nritems), itemoff);
btrfs_set_item_size(buf, btrfs_item_nr(buf, nritems),
btrfs_set_item_offset(buf, btrfs_item_nr(nritems), itemoff);
btrfs_set_item_size(buf, btrfs_item_nr(nritems),
sizeof(root_item));
write_extent_buffer(buf, &root_item,
btrfs_item_ptr_offset(buf, nritems),
@ -241,9 +241,9 @@ int make_btrfs(int fd, const char *device, const char *label,
btrfs_set_disk_key_offset(&disk_key, leafsize);
}
btrfs_set_item_key(buf, &disk_key, nritems);
btrfs_set_item_offset(buf, btrfs_item_nr(buf, nritems),
btrfs_set_item_offset(buf, btrfs_item_nr(nritems),
itemoff);
btrfs_set_item_size(buf, btrfs_item_nr(buf, nritems),
btrfs_set_item_size(buf, btrfs_item_nr(nritems),
item_size);
extent_item = btrfs_item_ptr(buf, nritems,
struct btrfs_extent_item);
@ -259,9 +259,9 @@ int make_btrfs(int fd, const char *device, const char *label,
btrfs_set_disk_key_offset(&disk_key, ref_root);
btrfs_set_disk_key_type(&disk_key, BTRFS_TREE_BLOCK_REF_KEY);
btrfs_set_item_key(buf, &disk_key, nritems);
btrfs_set_item_offset(buf, btrfs_item_nr(buf, nritems),
btrfs_set_item_offset(buf, btrfs_item_nr(nritems),
itemoff);
btrfs_set_item_size(buf, btrfs_item_nr(buf, nritems), 0);
btrfs_set_item_size(buf, btrfs_item_nr(nritems), 0);
nritems++;
}
btrfs_set_header_bytenr(buf, blocks[2]);
@ -286,8 +286,8 @@ int make_btrfs(int fd, const char *device, const char *label,
btrfs_set_disk_key_offset(&disk_key, 1);
btrfs_set_disk_key_type(&disk_key, BTRFS_DEV_ITEM_KEY);
btrfs_set_item_key(buf, &disk_key, nritems);
btrfs_set_item_offset(buf, btrfs_item_nr(buf, nritems), itemoff);
btrfs_set_item_size(buf, btrfs_item_nr(buf, nritems), item_size);
btrfs_set_item_offset(buf, btrfs_item_nr(nritems), itemoff);
btrfs_set_item_size(buf, btrfs_item_nr(nritems), item_size);
dev_item = btrfs_item_ptr(buf, nritems, struct btrfs_dev_item);
btrfs_set_device_id(buf, dev_item, 1);
@ -318,8 +318,8 @@ int make_btrfs(int fd, const char *device, const char *label,
btrfs_set_disk_key_offset(&disk_key, 0);
btrfs_set_disk_key_type(&disk_key, BTRFS_CHUNK_ITEM_KEY);
btrfs_set_item_key(buf, &disk_key, nritems);
btrfs_set_item_offset(buf, btrfs_item_nr(buf, nritems), itemoff);
btrfs_set_item_size(buf, btrfs_item_nr(buf, nritems), item_size);
btrfs_set_item_offset(buf, btrfs_item_nr(nritems), itemoff);
btrfs_set_item_size(buf, btrfs_item_nr(nritems), item_size);
chunk = btrfs_item_ptr(buf, nritems, struct btrfs_chunk);
btrfs_set_chunk_length(buf, chunk, BTRFS_MKFS_SYSTEM_GROUP_SIZE);
@ -372,8 +372,8 @@ int make_btrfs(int fd, const char *device, const char *label,
btrfs_set_disk_key_offset(&disk_key, 0);
btrfs_set_disk_key_type(&disk_key, BTRFS_DEV_EXTENT_KEY);
btrfs_set_item_key(buf, &disk_key, nritems);
btrfs_set_item_offset(buf, btrfs_item_nr(buf, nritems), itemoff);
btrfs_set_item_size(buf, btrfs_item_nr(buf, nritems),
btrfs_set_item_offset(buf, btrfs_item_nr(nritems), itemoff);
btrfs_set_item_size(buf, btrfs_item_nr(nritems),
sizeof(struct btrfs_dev_extent));
dev_extent = btrfs_item_ptr(buf, nritems, struct btrfs_dev_extent);
btrfs_set_dev_extent_chunk_tree(buf, dev_extent,