Skip to content

Commit 195f406

Browse files
cgxu519Jaegeuk Kim
authored andcommitted
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: Chengguang Xu <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 6d7c865 commit 195f406

File tree

3 files changed

+1
-15
lines changed

3 files changed

+1
-15
lines changed

fs/f2fs/file.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -979,9 +979,7 @@ const struct inode_operations f2fs_file_inode_operations = {
979979
.setattr = f2fs_setattr,
980980
.get_acl = f2fs_get_acl,
981981
.set_acl = f2fs_set_acl,
982-
#ifdef CONFIG_F2FS_FS_XATTR
983982
.listxattr = f2fs_listxattr,
984-
#endif
985983
.fiemap = f2fs_fiemap,
986984
};
987985

fs/f2fs/namei.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,9 +1287,7 @@ const struct inode_operations f2fs_encrypted_symlink_inode_operations = {
12871287
.get_link = f2fs_encrypted_get_link,
12881288
.getattr = f2fs_getattr,
12891289
.setattr = f2fs_setattr,
1290-
#ifdef CONFIG_F2FS_FS_XATTR
12911290
.listxattr = f2fs_listxattr,
1292-
#endif
12931291
};
12941292

12951293
const struct inode_operations f2fs_dir_inode_operations = {
@@ -1307,27 +1305,21 @@ const struct inode_operations f2fs_dir_inode_operations = {
13071305
.setattr = f2fs_setattr,
13081306
.get_acl = f2fs_get_acl,
13091307
.set_acl = f2fs_set_acl,
1310-
#ifdef CONFIG_F2FS_FS_XATTR
13111308
.listxattr = f2fs_listxattr,
1312-
#endif
13131309
.fiemap = f2fs_fiemap,
13141310
};
13151311

13161312
const struct inode_operations f2fs_symlink_inode_operations = {
13171313
.get_link = f2fs_get_link,
13181314
.getattr = f2fs_getattr,
13191315
.setattr = f2fs_setattr,
1320-
#ifdef CONFIG_F2FS_FS_XATTR
13211316
.listxattr = f2fs_listxattr,
1322-
#endif
13231317
};
13241318

13251319
const struct inode_operations f2fs_special_inode_operations = {
13261320
.getattr = f2fs_getattr,
13271321
.setattr = f2fs_setattr,
13281322
.get_acl = f2fs_get_acl,
13291323
.set_acl = f2fs_set_acl,
1330-
#ifdef CONFIG_F2FS_FS_XATTR
13311324
.listxattr = f2fs_listxattr,
1332-
#endif
13331325
};

fs/f2fs/xattr.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ extern void f2fs_destroy_xattr_caches(struct f2fs_sb_info *);
136136
#else
137137

138138
#define f2fs_xattr_handlers NULL
139+
#define f2fs_listxattr NULL
139140
static inline int f2fs_setxattr(struct inode *inode, int index,
140141
const char *name, const void *value, size_t size,
141142
struct page *page, int flags)
@@ -148,11 +149,6 @@ static inline int f2fs_getxattr(struct inode *inode, int index,
148149
{
149150
return -EOPNOTSUPP;
150151
}
151-
static inline ssize_t f2fs_listxattr(struct dentry *dentry, char *buffer,
152-
size_t buffer_size)
153-
{
154-
return -EOPNOTSUPP;
155-
}
156152
static inline int f2fs_init_xattr_caches(struct f2fs_sb_info *sbi) { return 0; }
157153
static inline void f2fs_destroy_xattr_caches(struct f2fs_sb_info *sbi) { }
158154
#endif

0 commit comments

Comments
 (0)