Browse Source

f2fs: simplfy a field name in struct f2fs_extent,extent_info

Rename a filed name from 'blk_addr' to 'blk' in struct {f2fs_extent,extent_info}
as annotation of this field descripts its meaning well to us.

By this way, we can avoid long statement in code of following patches.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu 10 years ago
parent
commit
4d0b0bd438
3 changed files with 10 additions and 11 deletions
  1. 6 7
      fs/f2fs/data.c
  2. 3 3
      fs/f2fs/f2fs.h
  3. 1 1
      include/linux/f2fs_fs.h

+ 6 - 7
fs/f2fs/data.c

@@ -268,7 +268,7 @@ static int check_extent_cache(struct inode *inode, pgoff_t pgofs,
 
 
 	start_fofs = fi->ext.fofs;
 	start_fofs = fi->ext.fofs;
 	end_fofs = fi->ext.fofs + fi->ext.len - 1;
 	end_fofs = fi->ext.fofs + fi->ext.len - 1;
-	start_blkaddr = fi->ext.blk_addr;
+	start_blkaddr = fi->ext.blk;
 
 
 	if (pgofs >= start_fofs && pgofs <= end_fofs) {
 	if (pgofs >= start_fofs && pgofs <= end_fofs) {
 		unsigned int blkbits = inode->i_sb->s_blocksize_bits;
 		unsigned int blkbits = inode->i_sb->s_blocksize_bits;
@@ -313,8 +313,8 @@ void update_extent_cache(struct dnode_of_data *dn)
 
 
 	start_fofs = fi->ext.fofs;
 	start_fofs = fi->ext.fofs;
 	end_fofs = fi->ext.fofs + fi->ext.len - 1;
 	end_fofs = fi->ext.fofs + fi->ext.len - 1;
-	start_blkaddr = fi->ext.blk_addr;
-	end_blkaddr = fi->ext.blk_addr + fi->ext.len - 1;
+	start_blkaddr = fi->ext.blk;
+	end_blkaddr = fi->ext.blk + fi->ext.len - 1;
 
 
 	/* Drop and initialize the matched extent */
 	/* Drop and initialize the matched extent */
 	if (fi->ext.len == 1 && fofs == start_fofs)
 	if (fi->ext.len == 1 && fofs == start_fofs)
@@ -324,7 +324,7 @@ void update_extent_cache(struct dnode_of_data *dn)
 	if (fi->ext.len == 0) {
 	if (fi->ext.len == 0) {
 		if (dn->data_blkaddr != NULL_ADDR) {
 		if (dn->data_blkaddr != NULL_ADDR) {
 			fi->ext.fofs = fofs;
 			fi->ext.fofs = fofs;
-			fi->ext.blk_addr = dn->data_blkaddr;
+			fi->ext.blk = dn->data_blkaddr;
 			fi->ext.len = 1;
 			fi->ext.len = 1;
 		}
 		}
 		goto end_update;
 		goto end_update;
@@ -333,7 +333,7 @@ void update_extent_cache(struct dnode_of_data *dn)
 	/* Front merge */
 	/* Front merge */
 	if (fofs == start_fofs - 1 && dn->data_blkaddr == start_blkaddr - 1) {
 	if (fofs == start_fofs - 1 && dn->data_blkaddr == start_blkaddr - 1) {
 		fi->ext.fofs--;
 		fi->ext.fofs--;
-		fi->ext.blk_addr--;
+		fi->ext.blk--;
 		fi->ext.len++;
 		fi->ext.len++;
 		goto end_update;
 		goto end_update;
 	}
 	}
@@ -351,8 +351,7 @@ void update_extent_cache(struct dnode_of_data *dn)
 			fi->ext.len = fofs - start_fofs;
 			fi->ext.len = fofs - start_fofs;
 		} else {
 		} else {
 			fi->ext.fofs = fofs + 1;
 			fi->ext.fofs = fofs + 1;
-			fi->ext.blk_addr = start_blkaddr +
-					fofs - start_fofs + 1;
+			fi->ext.blk = start_blkaddr + fofs - start_fofs + 1;
 			fi->ext.len -= fofs - start_fofs + 1;
 			fi->ext.len -= fofs - start_fofs + 1;
 		}
 		}
 	} else {
 	} else {

+ 3 - 3
fs/f2fs/f2fs.h

@@ -278,7 +278,7 @@ enum {
 
 
 struct extent_info {
 struct extent_info {
 	unsigned int fofs;	/* start offset in a file */
 	unsigned int fofs;	/* start offset in a file */
-	u32 blk_addr;		/* start block address of the extent */
+	u32 blk;		/* start block address of the extent */
 	unsigned int len;	/* length of the extent */
 	unsigned int len;	/* length of the extent */
 };
 };
 
 
@@ -320,7 +320,7 @@ static inline void get_extent_info(struct extent_info *ext,
 					struct f2fs_extent i_ext)
 					struct f2fs_extent i_ext)
 {
 {
 	ext->fofs = le32_to_cpu(i_ext.fofs);
 	ext->fofs = le32_to_cpu(i_ext.fofs);
-	ext->blk_addr = le32_to_cpu(i_ext.blk_addr);
+	ext->blk = le32_to_cpu(i_ext.blk);
 	ext->len = le32_to_cpu(i_ext.len);
 	ext->len = le32_to_cpu(i_ext.len);
 }
 }
 
 
@@ -328,7 +328,7 @@ static inline void set_raw_extent(struct extent_info *ext,
 					struct f2fs_extent *i_ext)
 					struct f2fs_extent *i_ext)
 {
 {
 	i_ext->fofs = cpu_to_le32(ext->fofs);
 	i_ext->fofs = cpu_to_le32(ext->fofs);
-	i_ext->blk_addr = cpu_to_le32(ext->blk_addr);
+	i_ext->blk = cpu_to_le32(ext->blk);
 	i_ext->len = cpu_to_le32(ext->len);
 	i_ext->len = cpu_to_le32(ext->len);
 }
 }
 
 

+ 1 - 1
include/linux/f2fs_fs.h

@@ -153,7 +153,7 @@ struct f2fs_orphan_block {
  */
  */
 struct f2fs_extent {
 struct f2fs_extent {
 	__le32 fofs;		/* start file offset of the extent */
 	__le32 fofs;		/* start file offset of the extent */
-	__le32 blk_addr;	/* start block address of the extent */
+	__le32 blk;		/* start block address of the extent */
 	__le32 len;		/* lengh of the extent */
 	__le32 len;		/* lengh of the extent */
 } __packed;
 } __packed;