]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
btrfs: use btrfs_ino to access inode number
authorDavid Sterba <dsterba@suse.cz>
Tue, 31 May 2011 17:08:14 +0000 (17:08 +0000)
committerChris Mason <chris.mason@oracle.com>
Sat, 4 Jun 2011 12:03:46 +0000 (08:03 -0400)
commit 4cb5300bc ("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: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/file.c
fs/btrfs/ioctl.c

index e3a1b0c2394c4a9196e72ccc4f1c57850ca1b456..982b5ea9762f2dca4686fe73576b6a4a2f6a5faf 100644 (file)
@@ -144,7 +144,7 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans,
        if (!defrag)
                return -ENOMEM;
 
-       defrag->ino = inode->i_ino;
+       defrag->ino = btrfs_ino(inode);
        defrag->transid = transid;
        defrag->root = root->root_key.objectid;
 
index 74c80595d707e3a9583706110111db3533da38ce..ac37040e426a0794b1eff39e8f74de96d07db75e 100644 (file)
@@ -706,16 +706,17 @@ static int find_new_extents(struct btrfs_root *root,
        struct btrfs_file_extent_item *extent;
        int type;
        int ret;
+       u64 ino = btrfs_ino(inode);
 
        path = btrfs_alloc_path();
        if (!path)
                return -ENOMEM;
 
-       min_key.objectid = inode->i_ino;
+       min_key.objectid = ino;
        min_key.type = BTRFS_EXTENT_DATA_KEY;
        min_key.offset = *off;
 
-       max_key.objectid = inode->i_ino;
+       max_key.objectid = ino;
        max_key.type = (u8)-1;
        max_key.offset = (u64)-1;
 
@@ -726,7 +727,7 @@ static int find_new_extents(struct btrfs_root *root,
                                           path, 0, newer_than);
                if (ret != 0)
                        goto none;
-               if (min_key.objectid != inode->i_ino)
+               if (min_key.objectid != ino)
                        goto none;
                if (min_key.type != BTRFS_EXTENT_DATA_KEY)
                        goto none;