diff options
author | Nikolay Borisov <n.borisov.lkml@gmail.com> | 2017-01-10 20:35:31 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-02-14 15:50:51 +0100 |
commit | 4a0cc7ca6c40b607b8aaa0bf6e97ffd74d64c2d8 (patch) | |
tree | 9ed2b2b2960e4b5dc8bed1f3a35ae9de95dcb12f /fs/btrfs/delayed-inode.c | |
parent | 823bb20ab47071dc8a98acf272a470ccdcfcf6d1 (diff) |
btrfs: Make btrfs_ino take a struct btrfs_inode
Currently btrfs_ino takes a struct inode and this causes a lot of
internal btrfs functions which consume this ino to take a VFS inode,
rather than btrfs' own struct btrfs_inode. In order to fix this "leak"
of VFS structs into the internals of btrfs first it's necessary to
eliminate all uses of struct inode for the purpose of inode. This patch
does that by using BTRFS_I to convert an inode to btrfs_inode. With
this problem eliminated subsequent patches will start eliminating the
passing of struct inode altogether, eventually resulting in a lot cleaner
code.
Signed-off-by: Nikolay Borisov <n.borisov.lkml@gmail.com>
[ fix btrfs_get_extent tracepoint prototype ]
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/delayed-inode.c')
-rw-r--r-- | fs/btrfs/delayed-inode.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index 353e40fceba8..40be12891344 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -76,7 +76,7 @@ static struct btrfs_delayed_node *btrfs_get_delayed_node(struct inode *inode) { struct btrfs_inode *btrfs_inode = BTRFS_I(inode); struct btrfs_root *root = btrfs_inode->root; - u64 ino = btrfs_ino(inode); + u64 ino = btrfs_ino(btrfs_inode); struct btrfs_delayed_node *node; node = READ_ONCE(btrfs_inode->delayed_node); @@ -112,7 +112,7 @@ static struct btrfs_delayed_node *btrfs_get_or_create_delayed_node( struct btrfs_delayed_node *node; struct btrfs_inode *btrfs_inode = BTRFS_I(inode); struct btrfs_root *root = btrfs_inode->root; - u64 ino = btrfs_ino(inode); + u64 ino = btrfs_ino(btrfs_inode); int ret; again: @@ -637,7 +637,7 @@ static int btrfs_delayed_inode_reserve_metadata( node->bytes_reserved = num_bytes; trace_btrfs_space_reservation(fs_info, "delayed_inode", - btrfs_ino(inode), + btrfs_ino(BTRFS_I(inode)), num_bytes, 1); } return ret; @@ -660,13 +660,13 @@ static int btrfs_delayed_inode_reserve_metadata( */ if (!ret) { trace_btrfs_space_reservation(fs_info, "delayed_inode", - btrfs_ino(inode), num_bytes, 1); + btrfs_ino(BTRFS_I(inode)), num_bytes, 1); node->bytes_reserved = num_bytes; } if (release) { trace_btrfs_space_reservation(fs_info, "delalloc", - btrfs_ino(inode), num_bytes, 0); + btrfs_ino(BTRFS_I(inode)), num_bytes, 0); btrfs_block_rsv_release(fs_info, src_rsv, num_bytes); } @@ -1453,7 +1453,7 @@ int btrfs_insert_delayed_dir_index(struct btrfs_trans_handle *trans, goto release_node; } - delayed_item->key.objectid = btrfs_ino(dir); + delayed_item->key.objectid = btrfs_ino(BTRFS_I(dir)); delayed_item->key.type = BTRFS_DIR_INDEX_KEY; delayed_item->key.offset = index; @@ -1521,7 +1521,7 @@ int btrfs_delete_delayed_dir_index(struct btrfs_trans_handle *trans, if (IS_ERR(node)) return PTR_ERR(node); - item_key.objectid = btrfs_ino(dir); + item_key.objectid = btrfs_ino(BTRFS_I(dir)); item_key.type = BTRFS_DIR_INDEX_KEY; item_key.offset = index; |