Skip to content

Commit

Permalink
btrfs: pass a btrfs_inode to btrfs_readdir_put_delayed_items()
Browse files Browse the repository at this point in the history
Pass a struct btrfs_inode to btrfs_readdir_put_delayed_items() as it's
an internal interface, allowing to remove some use of BTRFS_I.

Reviewed-by: Boris Burkov <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
kdave committed Jul 11, 2024
1 parent 2422547 commit 849c01a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions fs/btrfs/delayed-inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1730,7 +1730,7 @@ bool btrfs_readdir_get_delayed_items(struct inode *inode,
return true;
}

void btrfs_readdir_put_delayed_items(struct inode *inode,
void btrfs_readdir_put_delayed_items(struct btrfs_inode *inode,
struct list_head *ins_list,
struct list_head *del_list)
{
Expand All @@ -1752,7 +1752,7 @@ void btrfs_readdir_put_delayed_items(struct inode *inode,
* The VFS is going to do up_read(), so we need to downgrade back to a
* read lock.
*/
downgrade_write(&inode->i_rwsem);
downgrade_write(&inode->vfs_inode.i_rwsem);
}

int btrfs_should_delete_dir_index(const struct list_head *del_list,
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/delayed-inode.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ bool btrfs_readdir_get_delayed_items(struct inode *inode,
u64 last_index,
struct list_head *ins_list,
struct list_head *del_list);
void btrfs_readdir_put_delayed_items(struct inode *inode,
void btrfs_readdir_put_delayed_items(struct btrfs_inode *inode,
struct list_head *ins_list,
struct list_head *del_list);
int btrfs_should_delete_dir_index(const struct list_head *del_list,
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -6037,7 +6037,7 @@ static int btrfs_real_readdir(struct file *file, struct dir_context *ctx)
ret = 0;
err:
if (put)
btrfs_readdir_put_delayed_items(inode, &ins_list, &del_list);
btrfs_readdir_put_delayed_items(BTRFS_I(inode), &ins_list, &del_list);
btrfs_free_path(path);
return ret;
}
Expand Down

0 comments on commit 849c01a

Please sign in to comment.