diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2011-04-19 22:31:50 -0400 |
---|---|---|
committer | Li Zefan <lizf@cn.fujitsu.com> | 2011-04-25 04:46:09 -0400 |
commit | 33345d01522f8152f99dc84a3e7a1a45707f387f (patch) | |
tree | 6a978702dc4421768e63501fa15bc8fedd5bff32 /fs/btrfs/extent_io.c | |
parent | 0414efae7989a2183fb2cc000ab285c4c2836a00 (diff) |
Btrfs: Always use 64bit inode number
There's a potential problem in 32bit system when we exhaust 32bit inode
numbers and start to allocate big inode numbers, because btrfs uses
inode->i_ino in many places.
So here we always use BTRFS_I(inode)->location.objectid, which is an
u64 variable.
There are 2 exceptions that BTRFS_I(inode)->location.objectid !=
inode->i_ino: the btree inode (0 vs 1) and empty subvol dirs (256 vs 2),
and inode->i_ino will be used in those cases.
Another reason to make this change is I'm going to use a special inode
to save free ino cache, and the inode number must be > (u64)-256.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 5ae0bffaa4d8..41d313a0d098 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -3030,7 +3030,7 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | |||
3030 | * because there might be preallocation past i_size | 3030 | * because there might be preallocation past i_size |
3031 | */ | 3031 | */ |
3032 | ret = btrfs_lookup_file_extent(NULL, BTRFS_I(inode)->root, | 3032 | ret = btrfs_lookup_file_extent(NULL, BTRFS_I(inode)->root, |
3033 | path, inode->i_ino, -1, 0); | 3033 | path, btrfs_ino(inode), -1, 0); |
3034 | if (ret < 0) { | 3034 | if (ret < 0) { |
3035 | btrfs_free_path(path); | 3035 | btrfs_free_path(path); |
3036 | return ret; | 3036 | return ret; |
@@ -3043,7 +3043,7 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | |||
3043 | found_type = btrfs_key_type(&found_key); | 3043 | found_type = btrfs_key_type(&found_key); |
3044 | 3044 | ||
3045 | /* No extents, but there might be delalloc bits */ | 3045 | /* No extents, but there might be delalloc bits */ |
3046 | if (found_key.objectid != inode->i_ino || | 3046 | if (found_key.objectid != btrfs_ino(inode) || |
3047 | found_type != BTRFS_EXTENT_DATA_KEY) { | 3047 | found_type != BTRFS_EXTENT_DATA_KEY) { |
3048 | /* have to trust i_size as the end */ | 3048 | /* have to trust i_size as the end */ |
3049 | last = (u64)-1; | 3049 | last = (u64)-1; |