diff options
| author | David Sterba <dsterba@suse.cz> | 2011-05-31 13:08:14 -0400 |
|---|---|---|
| committer | Chris Mason <chris.mason@oracle.com> | 2011-06-04 08:03:46 -0400 |
| commit | a4689d2bd3b00dcf5c4320f06e0ab88810fbff9c (patch) | |
| tree | 295bcdb0fdbe5a4cda80eb886694efd45e276699 /fs | |
| parent | d132a538d258f8f52fd0cd8b5017755f4e915386 (diff) | |
btrfs: use btrfs_ino to access inode number
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>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/btrfs/file.c | 2 | ||||
| -rw-r--r-- | fs/btrfs/ioctl.c | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index e3a1b0c2394c..982b5ea9762f 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
| @@ -144,7 +144,7 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, | |||
| 144 | if (!defrag) | 144 | if (!defrag) |
| 145 | return -ENOMEM; | 145 | return -ENOMEM; |
| 146 | 146 | ||
| 147 | defrag->ino = inode->i_ino; | 147 | defrag->ino = btrfs_ino(inode); |
| 148 | defrag->transid = transid; | 148 | defrag->transid = transid; |
| 149 | defrag->root = root->root_key.objectid; | 149 | defrag->root = root->root_key.objectid; |
| 150 | 150 | ||
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 74c80595d707..ac37040e426a 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
| @@ -706,16 +706,17 @@ static int find_new_extents(struct btrfs_root *root, | |||
| 706 | struct btrfs_file_extent_item *extent; | 706 | struct btrfs_file_extent_item *extent; |
| 707 | int type; | 707 | int type; |
| 708 | int ret; | 708 | int ret; |
| 709 | u64 ino = btrfs_ino(inode); | ||
| 709 | 710 | ||
| 710 | path = btrfs_alloc_path(); | 711 | path = btrfs_alloc_path(); |
| 711 | if (!path) | 712 | if (!path) |
| 712 | return -ENOMEM; | 713 | return -ENOMEM; |
| 713 | 714 | ||
| 714 | min_key.objectid = inode->i_ino; | 715 | min_key.objectid = ino; |
| 715 | min_key.type = BTRFS_EXTENT_DATA_KEY; | 716 | min_key.type = BTRFS_EXTENT_DATA_KEY; |
| 716 | min_key.offset = *off; | 717 | min_key.offset = *off; |
| 717 | 718 | ||
| 718 | max_key.objectid = inode->i_ino; | 719 | max_key.objectid = ino; |
| 719 | max_key.type = (u8)-1; | 720 | max_key.type = (u8)-1; |
| 720 | max_key.offset = (u64)-1; | 721 | max_key.offset = (u64)-1; |
| 721 | 722 | ||
| @@ -726,7 +727,7 @@ static int find_new_extents(struct btrfs_root *root, | |||
| 726 | path, 0, newer_than); | 727 | path, 0, newer_than); |
| 727 | if (ret != 0) | 728 | if (ret != 0) |
| 728 | goto none; | 729 | goto none; |
| 729 | if (min_key.objectid != inode->i_ino) | 730 | if (min_key.objectid != ino) |
| 730 | goto none; | 731 | goto none; |
| 731 | if (min_key.type != BTRFS_EXTENT_DATA_KEY) | 732 | if (min_key.type != BTRFS_EXTENT_DATA_KEY) |
| 732 | goto none; | 733 | goto none; |
