Commit 73980bec authored by Jeff Mahoney's avatar Jeff Mahoney Committed by David Sterba

btrfs: backref, constify some arguments

This constifies a few buffers used in the backref code.
Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 9a35b637
...@@ -299,10 +299,11 @@ static int ref_tree_add(struct ref_root *ref_tree, u64 root_id, u64 object_id, ...@@ -299,10 +299,11 @@ static int ref_tree_add(struct ref_root *ref_tree, u64 root_id, u64 object_id,
return 0; return 0;
} }
static int check_extent_in_eb(struct btrfs_key *key, struct extent_buffer *eb, static int check_extent_in_eb(const struct btrfs_key *key,
struct btrfs_file_extent_item *fi, const struct extent_buffer *eb,
u64 extent_item_pos, const struct btrfs_file_extent_item *fi,
struct extent_inode_elem **eie) u64 extent_item_pos,
struct extent_inode_elem **eie)
{ {
u64 offset = 0; u64 offset = 0;
struct extent_inode_elem *e; struct extent_inode_elem *e;
...@@ -344,9 +345,9 @@ static void free_inode_elem_list(struct extent_inode_elem *eie) ...@@ -344,9 +345,9 @@ static void free_inode_elem_list(struct extent_inode_elem *eie)
} }
} }
static int find_extent_in_eb(struct extent_buffer *eb, u64 wanted_disk_byte, static int find_extent_in_eb(const struct extent_buffer *eb,
u64 extent_item_pos, u64 wanted_disk_byte, u64 extent_item_pos,
struct extent_inode_elem **eie) struct extent_inode_elem **eie)
{ {
u64 disk_byte; u64 disk_byte;
struct btrfs_key key; struct btrfs_key key;
...@@ -456,7 +457,7 @@ void btrfs_prelim_ref_exit(void) ...@@ -456,7 +457,7 @@ void btrfs_prelim_ref_exit(void)
*/ */
static int __add_prelim_ref(struct list_head *head, u64 root_id, static int __add_prelim_ref(struct list_head *head, u64 root_id,
struct btrfs_key *key, int level, const struct btrfs_key *key, int level,
u64 parent, u64 wanted_disk_byte, int count, u64 parent, u64 wanted_disk_byte, int count,
gfp_t gfp_mask) gfp_t gfp_mask)
{ {
...@@ -1649,7 +1650,7 @@ int btrfs_find_one_extref(struct btrfs_root *root, u64 inode_objectid, ...@@ -1649,7 +1650,7 @@ int btrfs_find_one_extref(struct btrfs_root *root, u64 inode_objectid,
struct btrfs_key key; struct btrfs_key key;
struct btrfs_key found_key; struct btrfs_key found_key;
struct btrfs_inode_extref *extref; struct btrfs_inode_extref *extref;
struct extent_buffer *leaf; const struct extent_buffer *leaf;
unsigned long ptr; unsigned long ptr;
key.objectid = inode_objectid; key.objectid = inode_objectid;
...@@ -1806,7 +1807,7 @@ int extent_from_logical(struct btrfs_fs_info *fs_info, u64 logical, ...@@ -1806,7 +1807,7 @@ int extent_from_logical(struct btrfs_fs_info *fs_info, u64 logical,
u64 flags; u64 flags;
u64 size = 0; u64 size = 0;
u32 item_size; u32 item_size;
struct extent_buffer *eb; const struct extent_buffer *eb;
struct btrfs_extent_item *ei; struct btrfs_extent_item *ei;
struct btrfs_key key; struct btrfs_key key;
...@@ -1874,9 +1875,11 @@ int extent_from_logical(struct btrfs_fs_info *fs_info, u64 logical, ...@@ -1874,9 +1875,11 @@ int extent_from_logical(struct btrfs_fs_info *fs_info, u64 logical,
* next ref. after the last ref was processed, 1 is returned. * next ref. after the last ref was processed, 1 is returned.
* returns <0 on error * returns <0 on error
*/ */
static int __get_extent_inline_ref(unsigned long *ptr, struct extent_buffer *eb, static int __get_extent_inline_ref(unsigned long *ptr,
struct btrfs_key *key, const struct extent_buffer *eb,
struct btrfs_extent_item *ei, u32 item_size, const struct btrfs_key *key,
const struct btrfs_extent_item *ei,
u32 item_size,
struct btrfs_extent_inline_ref **out_eiref, struct btrfs_extent_inline_ref **out_eiref,
int *out_type) int *out_type)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment