mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
btrfs: pass a btrfs_inode to btrfs_readdir_get_delayed_items()
Pass a struct btrfs_inode to btrfs_readdir_get_delayed_items() as it's an internal interface, allowing to remove some use of BTRFS_I. Reviewed-by: Boris Burkov <boris@bur.io> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
849c01ae90
commit
a0d7e98ced
@ -1682,7 +1682,7 @@ int btrfs_inode_delayed_dir_index_count(struct btrfs_inode *inode)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool btrfs_readdir_get_delayed_items(struct inode *inode,
|
||||
bool btrfs_readdir_get_delayed_items(struct btrfs_inode *inode,
|
||||
u64 last_index,
|
||||
struct list_head *ins_list,
|
||||
struct list_head *del_list)
|
||||
@ -1690,7 +1690,7 @@ bool btrfs_readdir_get_delayed_items(struct inode *inode,
|
||||
struct btrfs_delayed_node *delayed_node;
|
||||
struct btrfs_delayed_item *item;
|
||||
|
||||
delayed_node = btrfs_get_delayed_node(BTRFS_I(inode));
|
||||
delayed_node = btrfs_get_delayed_node(inode);
|
||||
if (!delayed_node)
|
||||
return false;
|
||||
|
||||
@ -1698,8 +1698,8 @@ bool btrfs_readdir_get_delayed_items(struct inode *inode,
|
||||
* We can only do one readdir with delayed items at a time because of
|
||||
* item->readdir_list.
|
||||
*/
|
||||
btrfs_inode_unlock(BTRFS_I(inode), BTRFS_ILOCK_SHARED);
|
||||
btrfs_inode_lock(BTRFS_I(inode), 0);
|
||||
btrfs_inode_unlock(inode, BTRFS_ILOCK_SHARED);
|
||||
btrfs_inode_lock(inode, 0);
|
||||
|
||||
mutex_lock(&delayed_node->mutex);
|
||||
item = __btrfs_first_delayed_insertion_item(delayed_node);
|
||||
|
@ -143,7 +143,7 @@ void btrfs_kill_all_delayed_nodes(struct btrfs_root *root);
|
||||
void btrfs_destroy_delayed_inodes(struct btrfs_fs_info *fs_info);
|
||||
|
||||
/* Used for readdir() */
|
||||
bool btrfs_readdir_get_delayed_items(struct inode *inode,
|
||||
bool btrfs_readdir_get_delayed_items(struct btrfs_inode *inode,
|
||||
u64 last_index,
|
||||
struct list_head *ins_list,
|
||||
struct list_head *del_list);
|
||||
|
@ -5947,7 +5947,7 @@ static int btrfs_real_readdir(struct file *file, struct dir_context *ctx)
|
||||
addr = private->filldir_buf;
|
||||
path->reada = READA_FORWARD;
|
||||
|
||||
put = btrfs_readdir_get_delayed_items(inode, private->last_index,
|
||||
put = btrfs_readdir_get_delayed_items(BTRFS_I(inode), private->last_index,
|
||||
&ins_list, &del_list);
|
||||
|
||||
again:
|
||||
|
Loading…
Reference in New Issue
Block a user