Commit 195f4065 authored by Chengguang Xu's avatar Chengguang Xu Committed by Jaegeuk Kim

f2fs: code cleanup by removing ifdef macro surrounding

Define f2fs_listxattr and to NULL when CONFIG_F2FS_FS_XATTR is not
enabled, then we can remove many ugly ifdef macros in the code.
Signed-off-by: default avatarChengguang Xu <cgxu519@mykernel.net>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 6d7c865c
...@@ -979,9 +979,7 @@ const struct inode_operations f2fs_file_inode_operations = { ...@@ -979,9 +979,7 @@ const struct inode_operations f2fs_file_inode_operations = {
.setattr = f2fs_setattr, .setattr = f2fs_setattr,
.get_acl = f2fs_get_acl, .get_acl = f2fs_get_acl,
.set_acl = f2fs_set_acl, .set_acl = f2fs_set_acl,
#ifdef CONFIG_F2FS_FS_XATTR
.listxattr = f2fs_listxattr, .listxattr = f2fs_listxattr,
#endif
.fiemap = f2fs_fiemap, .fiemap = f2fs_fiemap,
}; };
......
...@@ -1287,9 +1287,7 @@ const struct inode_operations f2fs_encrypted_symlink_inode_operations = { ...@@ -1287,9 +1287,7 @@ const struct inode_operations f2fs_encrypted_symlink_inode_operations = {
.get_link = f2fs_encrypted_get_link, .get_link = f2fs_encrypted_get_link,
.getattr = f2fs_getattr, .getattr = f2fs_getattr,
.setattr = f2fs_setattr, .setattr = f2fs_setattr,
#ifdef CONFIG_F2FS_FS_XATTR
.listxattr = f2fs_listxattr, .listxattr = f2fs_listxattr,
#endif
}; };
const struct inode_operations f2fs_dir_inode_operations = { const struct inode_operations f2fs_dir_inode_operations = {
...@@ -1307,9 +1305,7 @@ const struct inode_operations f2fs_dir_inode_operations = { ...@@ -1307,9 +1305,7 @@ const struct inode_operations f2fs_dir_inode_operations = {
.setattr = f2fs_setattr, .setattr = f2fs_setattr,
.get_acl = f2fs_get_acl, .get_acl = f2fs_get_acl,
.set_acl = f2fs_set_acl, .set_acl = f2fs_set_acl,
#ifdef CONFIG_F2FS_FS_XATTR
.listxattr = f2fs_listxattr, .listxattr = f2fs_listxattr,
#endif
.fiemap = f2fs_fiemap, .fiemap = f2fs_fiemap,
}; };
...@@ -1317,9 +1313,7 @@ const struct inode_operations f2fs_symlink_inode_operations = { ...@@ -1317,9 +1313,7 @@ const struct inode_operations f2fs_symlink_inode_operations = {
.get_link = f2fs_get_link, .get_link = f2fs_get_link,
.getattr = f2fs_getattr, .getattr = f2fs_getattr,
.setattr = f2fs_setattr, .setattr = f2fs_setattr,
#ifdef CONFIG_F2FS_FS_XATTR
.listxattr = f2fs_listxattr, .listxattr = f2fs_listxattr,
#endif
}; };
const struct inode_operations f2fs_special_inode_operations = { const struct inode_operations f2fs_special_inode_operations = {
...@@ -1327,7 +1321,5 @@ const struct inode_operations f2fs_special_inode_operations = { ...@@ -1327,7 +1321,5 @@ const struct inode_operations f2fs_special_inode_operations = {
.setattr = f2fs_setattr, .setattr = f2fs_setattr,
.get_acl = f2fs_get_acl, .get_acl = f2fs_get_acl,
.set_acl = f2fs_set_acl, .set_acl = f2fs_set_acl,
#ifdef CONFIG_F2FS_FS_XATTR
.listxattr = f2fs_listxattr, .listxattr = f2fs_listxattr,
#endif
}; };
...@@ -136,6 +136,7 @@ extern void f2fs_destroy_xattr_caches(struct f2fs_sb_info *); ...@@ -136,6 +136,7 @@ extern void f2fs_destroy_xattr_caches(struct f2fs_sb_info *);
#else #else
#define f2fs_xattr_handlers NULL #define f2fs_xattr_handlers NULL
#define f2fs_listxattr NULL
static inline int f2fs_setxattr(struct inode *inode, int index, static inline int f2fs_setxattr(struct inode *inode, int index,
const char *name, const void *value, size_t size, const char *name, const void *value, size_t size,
struct page *page, int flags) struct page *page, int flags)
...@@ -148,11 +149,6 @@ static inline int f2fs_getxattr(struct inode *inode, int index, ...@@ -148,11 +149,6 @@ static inline int f2fs_getxattr(struct inode *inode, int index,
{ {
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
static inline ssize_t f2fs_listxattr(struct dentry *dentry, char *buffer,
size_t buffer_size)
{
return -EOPNOTSUPP;
}
static inline int f2fs_init_xattr_caches(struct f2fs_sb_info *sbi) { return 0; } static inline int f2fs_init_xattr_caches(struct f2fs_sb_info *sbi) { return 0; }
static inline void f2fs_destroy_xattr_caches(struct f2fs_sb_info *sbi) { } static inline void f2fs_destroy_xattr_caches(struct f2fs_sb_info *sbi) { }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment