diff options
author | Chao Yu <yuchao0@huawei.com> | 2017-03-23 13:38:25 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-03-24 15:10:52 -0400 |
commit | 89e9eabd7ded4680f3b0f8ddc7398a3909de57c8 (patch) | |
tree | 433799bf85e08e0886216f990cefb1e52fbbda0c /fs/f2fs/xattr.h | |
parent | 99f4b917b0411f660b06ffd30f3dc36cf7b05710 (diff) |
f2fs: clean up xattr operation
1. don't allocate redundant memory in read_all_xattrs.
2. introduce RESERVED_XATTR_SIZE for cleanup.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/xattr.h')
-rw-r--r-- | fs/f2fs/xattr.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/xattr.h b/fs/f2fs/xattr.h index d5a94928c116..1e7db8d0806e 100644 --- a/fs/f2fs/xattr.h +++ b/fs/f2fs/xattr.h @@ -73,7 +73,8 @@ struct f2fs_xattr_entry { !IS_XATTR_LAST_ENTRY(entry);\ entry = XATTR_NEXT_ENTRY(entry)) #define MAX_XATTR_BLOCK_SIZE (PAGE_SIZE - sizeof(struct node_footer)) -#define VALID_XATTR_BLOCK_SIZE (MAX_XATTR_BLOCK_SIZE - sizeof(__u32)) +#define RESERVED_XATTR_SIZE (sizeof(__u32)) +#define VALID_XATTR_BLOCK_SIZE (MAX_XATTR_BLOCK_SIZE - RESERVED_XATTR_SIZE) #define MIN_OFFSET(i) XATTR_ALIGN(inline_xattr_size(i) + \ VALID_XATTR_BLOCK_SIZE) |