diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2022-08-08 15:18:18 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2022-08-08 15:20:24 -0700 |
commit | 6148db344eb25b23a7cbde36d026011cd15b6143 (patch) | |
tree | b3646a70ecacc535e0c437abe2019017ab490761 | |
parent | f09c2b7d4c52213d00d1635d81898ea23d3a38c9 (diff) | |
download | f2fs-tools-6148db344eb25b23a7cbde36d026011cd15b6143.tar.gz |
f2fs-tools: use F2FS_BLKSIZE instead of PAGE_*_SIZE
We don't need to check the running kernel configuration.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fsck/mount.c | 6 | ||||
-rw-r--r-- | fsck/xattr.c | 2 | ||||
-rw-r--r-- | fsck/xattr.h | 2 | ||||
-rw-r--r-- | include/f2fs_fs.h | 15 |
4 files changed, 8 insertions, 17 deletions
diff --git a/fsck/mount.c b/fsck/mount.c index 584e6d1..e2caac0 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -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", diff --git a/fsck/xattr.c b/fsck/xattr.c index f0c5343..8e66873 100644 --- a/fsck/xattr.c +++ b/fsck/xattr.c @@ -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); diff --git a/fsck/xattr.h b/fsck/xattr.h index 74aa541..22ea35c 100644 --- a/fsck/xattr.h +++ b/fsck/xattr.h @@ -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 - \ diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index 8125e9f..509d75a 100644 --- a/include/f2fs_fs.h +++ b/include/f2fs_fs.h @@ -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 |