Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

btrfs: Remove fs_info from btrfs_add_root_ref

It can be referenced from the passed transaction handle.

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Lu Fengqi and committed by
David Sterba
6025c19f 3ee1c553

+10 -14
+3 -4
fs/btrfs/ctree.h
··· 2984 2984 int btrfs_old_root_level(struct btrfs_root *root, u64 time_seq); 2985 2985 2986 2986 /* root-item.c */ 2987 - int btrfs_add_root_ref(struct btrfs_trans_handle *trans, 2988 - struct btrfs_fs_info *fs_info, 2989 - u64 root_id, u64 ref_id, u64 dirid, u64 sequence, 2990 - const char *name, int name_len); 2987 + int btrfs_add_root_ref(struct btrfs_trans_handle *trans, u64 root_id, 2988 + u64 ref_id, u64 dirid, u64 sequence, const char *name, 2989 + int name_len); 2991 2990 int btrfs_del_root_ref(struct btrfs_trans_handle *trans, u64 root_id, 2992 2991 u64 ref_id, u64 dirid, u64 *sequence, const char *name, 2993 2992 int name_len);
+1 -2
fs/btrfs/inode.c
··· 6385 6385 struct btrfs_inode *parent_inode, struct btrfs_inode *inode, 6386 6386 const char *name, int name_len, int add_backref, u64 index) 6387 6387 { 6388 - struct btrfs_fs_info *fs_info = trans->fs_info; 6389 6388 int ret = 0; 6390 6389 struct btrfs_key key; 6391 6390 struct btrfs_root *root = parent_inode->root; ··· 6400 6401 } 6401 6402 6402 6403 if (unlikely(ino == BTRFS_FIRST_FREE_OBJECTID)) { 6403 - ret = btrfs_add_root_ref(trans, fs_info, key.objectid, 6404 + ret = btrfs_add_root_ref(trans, key.objectid, 6404 6405 root->root_key.objectid, parent_ino, 6405 6406 index, name, name_len); 6406 6407 } else if (add_backref) {
+1 -2
fs/btrfs/ioctl.c
··· 698 698 ret = btrfs_update_inode(trans, root, dir); 699 699 BUG_ON(ret); 700 700 701 - ret = btrfs_add_root_ref(trans, fs_info, 702 - objectid, root->root_key.objectid, 701 + ret = btrfs_add_root_ref(trans, objectid, root->root_key.objectid, 703 702 btrfs_ino(BTRFS_I(dir)), index, name, namelen); 704 703 BUG_ON(ret); 705 704
+4 -5
fs/btrfs/root-tree.c
··· 412 412 * 413 413 * Will return 0, -ENOMEM, or anything from the CoW path 414 414 */ 415 - int btrfs_add_root_ref(struct btrfs_trans_handle *trans, 416 - struct btrfs_fs_info *fs_info, 417 - u64 root_id, u64 ref_id, u64 dirid, u64 sequence, 418 - const char *name, int name_len) 415 + int btrfs_add_root_ref(struct btrfs_trans_handle *trans, u64 root_id, 416 + u64 ref_id, u64 dirid, u64 sequence, const char *name, 417 + int name_len) 419 418 { 420 - struct btrfs_root *tree_root = fs_info->tree_root; 419 + struct btrfs_root *tree_root = trans->fs_info->tree_root; 421 420 struct btrfs_key key; 422 421 int ret; 423 422 struct btrfs_path *path;
+1 -1
fs/btrfs/transaction.c
··· 1573 1573 /* 1574 1574 * insert root back/forward references 1575 1575 */ 1576 - ret = btrfs_add_root_ref(trans, fs_info, objectid, 1576 + ret = btrfs_add_root_ref(trans, objectid, 1577 1577 parent_root->root_key.objectid, 1578 1578 btrfs_ino(BTRFS_I(parent_inode)), index, 1579 1579 dentry->d_name.name, dentry->d_name.len);