diff options
-rw-r--r-- | fs/f2fs/data.c | 13 | ||||
-rw-r--r-- | fs/f2fs/f2fs.h | 6 | ||||
-rw-r--r-- | include/linux/f2fs_fs.h | 2 |
3 files changed, 10 insertions, 11 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 0811d6509fce..64f9049a9f25 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -268,7 +268,7 @@ static int check_extent_cache(struct inode *inode, pgoff_t pgofs, | |||
268 | 268 | ||
269 | start_fofs = fi->ext.fofs; | 269 | start_fofs = fi->ext.fofs; |
270 | end_fofs = fi->ext.fofs + fi->ext.len - 1; | 270 | end_fofs = fi->ext.fofs + fi->ext.len - 1; |
271 | start_blkaddr = fi->ext.blk_addr; | 271 | start_blkaddr = fi->ext.blk; |
272 | 272 | ||
273 | if (pgofs >= start_fofs && pgofs <= end_fofs) { | 273 | if (pgofs >= start_fofs && pgofs <= end_fofs) { |
274 | unsigned int blkbits = inode->i_sb->s_blocksize_bits; | 274 | unsigned int blkbits = inode->i_sb->s_blocksize_bits; |
@@ -313,8 +313,8 @@ void update_extent_cache(struct dnode_of_data *dn) | |||
313 | 313 | ||
314 | start_fofs = fi->ext.fofs; | 314 | start_fofs = fi->ext.fofs; |
315 | end_fofs = fi->ext.fofs + fi->ext.len - 1; | 315 | end_fofs = fi->ext.fofs + fi->ext.len - 1; |
316 | start_blkaddr = fi->ext.blk_addr; | 316 | start_blkaddr = fi->ext.blk; |
317 | end_blkaddr = fi->ext.blk_addr + fi->ext.len - 1; | 317 | end_blkaddr = fi->ext.blk + fi->ext.len - 1; |
318 | 318 | ||
319 | /* Drop and initialize the matched extent */ | 319 | /* Drop and initialize the matched extent */ |
320 | if (fi->ext.len == 1 && fofs == start_fofs) | 320 | if (fi->ext.len == 1 && fofs == start_fofs) |
@@ -324,7 +324,7 @@ void update_extent_cache(struct dnode_of_data *dn) | |||
324 | if (fi->ext.len == 0) { | 324 | if (fi->ext.len == 0) { |
325 | if (dn->data_blkaddr != NULL_ADDR) { | 325 | if (dn->data_blkaddr != NULL_ADDR) { |
326 | fi->ext.fofs = fofs; | 326 | fi->ext.fofs = fofs; |
327 | fi->ext.blk_addr = dn->data_blkaddr; | 327 | fi->ext.blk = dn->data_blkaddr; |
328 | fi->ext.len = 1; | 328 | fi->ext.len = 1; |
329 | } | 329 | } |
330 | goto end_update; | 330 | goto end_update; |
@@ -333,7 +333,7 @@ void update_extent_cache(struct dnode_of_data *dn) | |||
333 | /* Front merge */ | 333 | /* Front merge */ |
334 | if (fofs == start_fofs - 1 && dn->data_blkaddr == start_blkaddr - 1) { | 334 | if (fofs == start_fofs - 1 && dn->data_blkaddr == start_blkaddr - 1) { |
335 | fi->ext.fofs--; | 335 | fi->ext.fofs--; |
336 | fi->ext.blk_addr--; | 336 | fi->ext.blk--; |
337 | fi->ext.len++; | 337 | fi->ext.len++; |
338 | goto end_update; | 338 | goto end_update; |
339 | } | 339 | } |
@@ -351,8 +351,7 @@ void update_extent_cache(struct dnode_of_data *dn) | |||
351 | fi->ext.len = fofs - start_fofs; | 351 | fi->ext.len = fofs - start_fofs; |
352 | } else { | 352 | } else { |
353 | fi->ext.fofs = fofs + 1; | 353 | fi->ext.fofs = fofs + 1; |
354 | fi->ext.blk_addr = start_blkaddr + | 354 | fi->ext.blk = start_blkaddr + fofs - start_fofs + 1; |
355 | fofs - start_fofs + 1; | ||
356 | fi->ext.len -= fofs - start_fofs + 1; | 355 | fi->ext.len -= fofs - start_fofs + 1; |
357 | } | 356 | } |
358 | } else { | 357 | } else { |
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index c3caa3cb5beb..5d2e52e31fac 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
@@ -278,7 +278,7 @@ enum { | |||
278 | 278 | ||
279 | struct extent_info { | 279 | struct extent_info { |
280 | unsigned int fofs; /* start offset in a file */ | 280 | unsigned int fofs; /* start offset in a file */ |
281 | u32 blk_addr; /* start block address of the extent */ | 281 | u32 blk; /* start block address of the extent */ |
282 | unsigned int len; /* length of the extent */ | 282 | unsigned int len; /* length of the extent */ |
283 | }; | 283 | }; |
284 | 284 | ||
@@ -320,7 +320,7 @@ static inline void get_extent_info(struct extent_info *ext, | |||
320 | struct f2fs_extent i_ext) | 320 | struct f2fs_extent i_ext) |
321 | { | 321 | { |
322 | ext->fofs = le32_to_cpu(i_ext.fofs); | 322 | ext->fofs = le32_to_cpu(i_ext.fofs); |
323 | ext->blk_addr = le32_to_cpu(i_ext.blk_addr); | 323 | ext->blk = le32_to_cpu(i_ext.blk); |
324 | ext->len = le32_to_cpu(i_ext.len); | 324 | ext->len = le32_to_cpu(i_ext.len); |
325 | } | 325 | } |
326 | 326 | ||
@@ -328,7 +328,7 @@ static inline void set_raw_extent(struct extent_info *ext, | |||
328 | struct f2fs_extent *i_ext) | 328 | struct f2fs_extent *i_ext) |
329 | { | 329 | { |
330 | i_ext->fofs = cpu_to_le32(ext->fofs); | 330 | i_ext->fofs = cpu_to_le32(ext->fofs); |
331 | i_ext->blk_addr = cpu_to_le32(ext->blk_addr); | 331 | i_ext->blk = cpu_to_le32(ext->blk); |
332 | i_ext->len = cpu_to_le32(ext->len); | 332 | i_ext->len = cpu_to_le32(ext->len); |
333 | } | 333 | } |
334 | 334 | ||
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h index a23556c32703..502f28cfb78e 100644 --- a/include/linux/f2fs_fs.h +++ b/include/linux/f2fs_fs.h | |||
@@ -153,7 +153,7 @@ struct f2fs_orphan_block { | |||
153 | */ | 153 | */ |
154 | struct f2fs_extent { | 154 | struct f2fs_extent { |
155 | __le32 fofs; /* start file offset of the extent */ | 155 | __le32 fofs; /* start file offset of the extent */ |
156 | __le32 blk_addr; /* start block address of the extent */ | 156 | __le32 blk; /* start block address of the extent */ |
157 | __le32 len; /* lengh of the extent */ | 157 | __le32 len; /* lengh of the extent */ |
158 | } __packed; | 158 | } __packed; |
159 | 159 | ||