Skip to content

Commit

Permalink
f2fs: align data types between on-disk and in-memory block addresses
Browse files Browse the repository at this point in the history
The on-disk block address is defined as __le32, but in-memory block address,
block_t, does as u64.

Let's synchronize them to 32 bits.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
  • Loading branch information
Jaegeuk Kim committed May 28, 2013
1 parent f28c06f commit a9841c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion fs/f2fs/f2fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
typecheck(unsigned long long, b) && \
((long long)((a) - (b)) > 0))

typedef u64 block_t;
typedef u32 block_t; /*
* should not change u32, since it is the on-disk block
* address format, __le32.
*/
typedef u32 nid_t;

struct f2fs_mount_info {
Expand Down
4 changes: 2 additions & 2 deletions include/linux/f2fs_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#define F2FS_BLKSIZE 4096 /* support only 4KB block */
#define F2FS_MAX_EXTENSION 64 /* # of extension entries */

#define NULL_ADDR 0x0U
#define NEW_ADDR -1U
#define NULL_ADDR ((block_t)0) /* used as block_t addresses */
#define NEW_ADDR ((block_t)-1) /* used as block_t addresses */

#define F2FS_ROOT_INO(sbi) (sbi->root_ino_num)
#define F2FS_NODE_INO(sbi) (sbi->node_ino_num)
Expand Down

0 comments on commit a9841c4

Please sign in to comment.