summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/xattr.h
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2020-02-25 18:17:10 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2020-03-22 21:16:27 -0700
commita999150f4fe3abbb7efd05411fd5b460be699943 (patch)
tree08afcb75aaf48ab33888a594827aa68883789964 /fs/f2fs/xattr.h
parentdabfbbc8f914504670a7fbeaf933aa253cbb8acc (diff)
downloadlinux-a999150f4fe3abbb7efd05411fd5b460be699943.tar.gz
linux-a999150f4fe3abbb7efd05411fd5b460be699943.tar.bz2
linux-a999150f4fe3abbb7efd05411fd5b460be699943.zip
f2fs: use kmem_cache pool during inline xattr lookups
It's been observed that kzalloc() on lookup_all_xattrs() are called millions of times on Android, quickly becoming the top abuser of slub memory allocator. Use a dedicated kmem cache pool for xattr lookups to mitigate this. Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com> Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/xattr.h')
-rw-r--r--fs/f2fs/xattr.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/f2fs/xattr.h b/fs/f2fs/xattr.h
index 574beea46494..0153b4c9ef21 100644
--- a/fs/f2fs/xattr.h
+++ b/fs/f2fs/xattr.h
@@ -131,6 +131,8 @@ extern int f2fs_setxattr(struct inode *, int, const char *,
extern int f2fs_getxattr(struct inode *, int, const char *, void *,
size_t, struct page *);
extern ssize_t f2fs_listxattr(struct dentry *, char *, size_t);
+extern int f2fs_init_xattr_caches(struct f2fs_sb_info *);
+extern void f2fs_destroy_xattr_caches(struct f2fs_sb_info *);
#else
#define f2fs_xattr_handlers NULL
@@ -151,6 +153,8 @@ static inline ssize_t f2fs_listxattr(struct dentry *dentry, char *buffer,
{
return -EOPNOTSUPP;
}
+static int f2fs_init_xattr_caches(struct f2fs_sb_info *sbi) { return 0; }
+static void f2fs_destroy_xattr_caches(struct f2fs_sb_info *sbi) { }
#endif
#ifdef CONFIG_F2FS_FS_SECURITY