f2fs-tools: use F2FS_BLKSIZE instead of PAGE_*_SIZE
PATCH 1/1 f2fs-tools: use F2FS_BLKSIZE instead of PAGE_*_SIZE
We don't need to check the running kernel configuration.
Signed-off-by Jaegeuk Kim <[email protected]>
--- fsck/mount.c | 6 ------ fsck/xattr.c | 2 +- fsck/xattr.h | 2 +- include/f2fs_fs.h | 15 ++++++--------- 4 files changed, 8 insertions(+), 17 deletions(-)
fsck/mount.c +0 -6
@@ -812,12 +812,6 @@ int sanity_check_raw_super(struct f2fs_super_block *sb, enum SB_ADDR sb_addr)return -1 ; } -if (F2FS_BLKSIZE !=PAGE_CACHE_SIZE ) { -MSG (0 ,"Invalid page_cache_size (%d), supports only 4KB\n" , -PAGE_CACHE_SIZE ); -return -1 ; - } - blocksize =1 <<get_sb (log_blocksize);if (F2FS_BLKSIZE != blocksize) { MSG(0, "Invalid blocksize (%u), supports only 4KB\n",
fsck/xattr.c +1 -1
@@ -121,7 +121,7 @@ static void write_all_xattrs(struct f2fs_sb_info *sbi,/* write to xattr node block */ xattr_addr = (void *)xattr_node;memcpy (xattr_addr, txattr_addr + inline_size, -PAGE_SIZE -sizeof (struct node_footer )); +F2FS_BLKSIZE -sizeof (struct node_footer )); ret =dev_write_block (xattr_node, blkaddr);
fsck/xattr.h +1 -1
@@ -132,7 +132,7 @@ static inline int f2fs_acl_count(int size) !IS_XATTR_LAST_ENTRY (entry); \ entry = XATTR_NEXT_ENTRY(entry)) -#define MIN_OFFSET XATTR_ALIGN(PAGE_SIZE - \ +#define MIN_OFFSET XATTR_ALIGN(F2FS_BLKSIZE - \ sizeof(struct node_footer) - sizeof(__u32))#define MAX_VALUE_LEN (MIN_OFFSET - \
include/f2fs_fs.h +6 -9
@@ -349,10 +349,6 @@ static inline uint64_t bswap_64(uint64_t val) snprintf(buf, len, #member) /* these are defined in kernel */ -#ifndef PAGE_SIZE -#define PAGE_SIZE 4096 -#endif -#define PAGE_CACHE_SIZE 4096 #define BITS_PER_BYTE 8 #ifndef SECTOR_SHIFT #define SECTOR_SHIFT 9
@@ -949,9 +945,10 @@ static_assert(sizeof(struct f2fs_extent) == 12, ""); DEFAULT_INLINE_XATTR_ADDRS - \ F2FS_TOTAL_EXTRA_ATTR_SIZE - \ DEF_INLINE_RESERVED_SIZE)) -#define INLINE_DATA_OFFSET (PAGE_CACHE_SIZE - sizeof(struct node_footer) \ - - sizeof(__le32)*(DEF_ADDRS_PER_INODE + 5 - \ - DEF_INLINE_RESERVED_SIZE)) +#define INLINE_DATA_OFFSET (F2FS_BLKSIZE - \ + sizeof(struct node_footer) - \ + sizeof(__le32) * (DEF_ADDRS_PER_INODE + \ + 5 - DEF_INLINE_RESERVED_SIZE))#define DEF_DIR_LEVEL 0
@@ -1093,7 +1090,7 @@ static_assert(sizeof(struct f2fs_node) == 4096, "");/* * For NAT entries */ -#define NAT_ENTRY_PER_BLOCK (PAGE_CACHE_SIZE / sizeof(struct f2fs_nat_entry)) +#define NAT_ENTRY_PER_BLOCK (F2FS_BLKSIZE / sizeof(struct f2fs_nat_entry))#define NAT_BLOCK_OFFSET (start_nid) (start_nid / NAT_ENTRY_PER_BLOCK)#define DEFAULT_NAT_ENTRY_RATIO 20
@@ -1120,7 +1117,7 @@ static_assert(sizeof(struct f2fs_nat_block) == 4095, "");* Not allow to change this. */ #define SIT_VBLOCK_MAP_SIZE 64 -#define SIT_ENTRY_PER_BLOCK (PAGE_CACHE_SIZE / sizeof(struct f2fs_sit_entry)) +#define SIT_ENTRY_PER_BLOCK (F2FS_BLKSIZE / sizeof(struct f2fs_sit_entry))/* * F2FS uses 4 bytes to represent block address. As a result, supported size of
Signature · 8 lines
2.37.1.559.g78731f0fdb-goog _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel