diff options
author | Chao Yu <yuchao0@huawei.com> | 2017-03-23 06:38:25 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-03-24 20:10:52 +0100 |
commit | 89e9eabd7ded4680f3b0f8ddc7398a3909de57c8 (patch) | |
tree | 433799bf85e08e0886216f990cefb1e52fbbda0c /fs/f2fs/xattr.h | |
parent | f2fs: don't track volatile file in dirty inode list (diff) | |
download | linux-89e9eabd7ded4680f3b0f8ddc7398a3909de57c8.tar.xz linux-89e9eabd7ded4680f3b0f8ddc7398a3909de57c8.zip |
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 '')
-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) |