aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorLukas Czerner <lczerner@redhat.com>2012-11-28 12:33:22 -0500
committerTheodore Ts'o <tytso@mit.edu>2012-11-28 12:33:22 -0500
commit06348679c9f69b3b031cf84c1f5f9f2488fc1f7d (patch)
tree8c0017c92c8d9dea787102bc17d952cad174bfba /fs/ext4
parent91dd8c114499e9818f2d5919ef0b9eee61810220 (diff)
ext4: simple cleanup in fiemap codepath
This commit is simple cleanup of fiemap codepath which has not been included in previous commit to make the changes clearer. In this commit we rename cbex variable to newex in ext4_fill_fiemap_extents() because callback is no longer present Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/extents.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index fbe7dc284240..56251466750c 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -1967,7 +1967,7 @@ static int ext4_fill_fiemap_extents(struct inode *inode,
1967 struct fiemap_extent_info *fieinfo) 1967 struct fiemap_extent_info *fieinfo)
1968{ 1968{
1969 struct ext4_ext_path *path = NULL; 1969 struct ext4_ext_path *path = NULL;
1970 struct ext4_ext_cache cbex; 1970 struct ext4_ext_cache newex;
1971 struct ext4_extent *ex; 1971 struct ext4_extent *ex;
1972 ext4_lblk_t next, next_del, start = 0, end = 0; 1972 ext4_lblk_t next, next_del, start = 0, end = 0;
1973 ext4_lblk_t last = block + num; 1973 ext4_lblk_t last = block + num;
@@ -2042,31 +2042,31 @@ static int ext4_fill_fiemap_extents(struct inode *inode,
2042 BUG_ON(end <= start); 2042 BUG_ON(end <= start);
2043 2043
2044 if (!exists) { 2044 if (!exists) {
2045 cbex.ec_block = start; 2045 newex.ec_block = start;
2046 cbex.ec_len = end - start; 2046 newex.ec_len = end - start;
2047 cbex.ec_start = 0; 2047 newex.ec_start = 0;
2048 } else { 2048 } else {
2049 cbex.ec_block = le32_to_cpu(ex->ee_block); 2049 newex.ec_block = le32_to_cpu(ex->ee_block);
2050 cbex.ec_len = ext4_ext_get_actual_len(ex); 2050 newex.ec_len = ext4_ext_get_actual_len(ex);
2051 cbex.ec_start = ext4_ext_pblock(ex); 2051 newex.ec_start = ext4_ext_pblock(ex);
2052 if (ext4_ext_is_uninitialized(ex)) 2052 if (ext4_ext_is_uninitialized(ex))
2053 flags |= FIEMAP_EXTENT_UNWRITTEN; 2053 flags |= FIEMAP_EXTENT_UNWRITTEN;
2054 } 2054 }
2055 2055
2056 /* 2056 /*
2057 * Find delayed extent and update cbex accordingly. We call 2057 * Find delayed extent and update newex accordingly. We call
2058 * it even in !exists case to find out whether cbex is the 2058 * it even in !exists case to find out whether newex is the
2059 * last existing extent or not. 2059 * last existing extent or not.
2060 */ 2060 */
2061 next_del = ext4_find_delayed_extent(inode, &cbex); 2061 next_del = ext4_find_delayed_extent(inode, &newex);
2062 if (!exists && next_del) { 2062 if (!exists && next_del) {
2063 exists = 1; 2063 exists = 1;
2064 flags |= FIEMAP_EXTENT_DELALLOC; 2064 flags |= FIEMAP_EXTENT_DELALLOC;
2065 } 2065 }
2066 up_read(&EXT4_I(inode)->i_data_sem); 2066 up_read(&EXT4_I(inode)->i_data_sem);
2067 2067
2068 if (unlikely(cbex.ec_len == 0)) { 2068 if (unlikely(newex.ec_len == 0)) {
2069 EXT4_ERROR_INODE(inode, "cbex.ec_len == 0"); 2069 EXT4_ERROR_INODE(inode, "newex.ec_len == 0");
2070 err = -EIO; 2070 err = -EIO;
2071 break; 2071 break;
2072 } 2072 }
@@ -2087,9 +2087,9 @@ static int ext4_fill_fiemap_extents(struct inode *inode,
2087 2087
2088 if (exists) { 2088 if (exists) {
2089 err = fiemap_fill_next_extent(fieinfo, 2089 err = fiemap_fill_next_extent(fieinfo,
2090 (__u64)cbex.ec_block << blksize_bits, 2090 (__u64)newex.ec_block << blksize_bits,
2091 (__u64)cbex.ec_start << blksize_bits, 2091 (__u64)newex.ec_start << blksize_bits,
2092 (__u64)cbex.ec_len << blksize_bits, 2092 (__u64)newex.ec_len << blksize_bits,
2093 flags); 2093 flags);
2094 if (err < 0) 2094 if (err < 0)
2095 break; 2095 break;
@@ -2099,7 +2099,7 @@ static int ext4_fill_fiemap_extents(struct inode *inode,
2099 } 2099 }
2100 } 2100 }
2101 2101
2102 block = cbex.ec_block + cbex.ec_len; 2102 block = newex.ec_block + newex.ec_len;
2103 } 2103 }
2104 2104
2105 if (path) { 2105 if (path) {