Commit a4689d2b authored by David Sterba's avatar David Sterba Committed by Chris Mason

btrfs: use btrfs_ino to access inode number

commit 4cb5300b ("Btrfs: add mount -o auto_defrag") accesses inode
number directly while it should use the helper with the new inode
number allocator.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent d132a538
...@@ -144,7 +144,7 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, ...@@ -144,7 +144,7 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans,
if (!defrag) if (!defrag)
return -ENOMEM; return -ENOMEM;
defrag->ino = inode->i_ino; defrag->ino = btrfs_ino(inode);
defrag->transid = transid; defrag->transid = transid;
defrag->root = root->root_key.objectid; defrag->root = root->root_key.objectid;
......
...@@ -706,16 +706,17 @@ static int find_new_extents(struct btrfs_root *root, ...@@ -706,16 +706,17 @@ static int find_new_extents(struct btrfs_root *root,
struct btrfs_file_extent_item *extent; struct btrfs_file_extent_item *extent;
int type; int type;
int ret; int ret;
u64 ino = btrfs_ino(inode);
path = btrfs_alloc_path(); path = btrfs_alloc_path();
if (!path) if (!path)
return -ENOMEM; return -ENOMEM;
min_key.objectid = inode->i_ino; min_key.objectid = ino;
min_key.type = BTRFS_EXTENT_DATA_KEY; min_key.type = BTRFS_EXTENT_DATA_KEY;
min_key.offset = *off; min_key.offset = *off;
max_key.objectid = inode->i_ino; max_key.objectid = ino;
max_key.type = (u8)-1; max_key.type = (u8)-1;
max_key.offset = (u64)-1; max_key.offset = (u64)-1;
...@@ -726,7 +727,7 @@ static int find_new_extents(struct btrfs_root *root, ...@@ -726,7 +727,7 @@ static int find_new_extents(struct btrfs_root *root,
path, 0, newer_than); path, 0, newer_than);
if (ret != 0) if (ret != 0)
goto none; goto none;
if (min_key.objectid != inode->i_ino) if (min_key.objectid != ino)
goto none; goto none;
if (min_key.type != BTRFS_EXTENT_DATA_KEY) if (min_key.type != BTRFS_EXTENT_DATA_KEY)
goto none; goto none;
......
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