Skip to content

Commit 91a0871

Browse files
cgxu519jankara
authored andcommitted
ext2: code cleanup by removing ifdef macro surrounding
Define ext2_listxattr to NULL when CONFIG_EROFS_FS_XATTR is not enabled, then we can remove many ugly ifdef macros in the code. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Chengguang Xu <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent 8939a3a commit 91a0871

File tree

4 files changed

+1
-10
lines changed

4 files changed

+1
-10
lines changed

fs/ext2/file.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,7 @@ const struct file_operations ext2_file_operations = {
196196
};
197197

198198
const struct inode_operations ext2_file_inode_operations = {
199-
#ifdef CONFIG_EXT2_FS_XATTR
200199
.listxattr = ext2_listxattr,
201-
#endif
202200
.getattr = ext2_getattr,
203201
.setattr = ext2_setattr,
204202
.get_acl = ext2_get_acl,

fs/ext2/namei.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,7 @@ const struct inode_operations ext2_dir_inode_operations = {
411411
.rmdir = ext2_rmdir,
412412
.mknod = ext2_mknod,
413413
.rename = ext2_rename,
414-
#ifdef CONFIG_EXT2_FS_XATTR
415414
.listxattr = ext2_listxattr,
416-
#endif
417415
.getattr = ext2_getattr,
418416
.setattr = ext2_setattr,
419417
.get_acl = ext2_get_acl,
@@ -422,9 +420,7 @@ const struct inode_operations ext2_dir_inode_operations = {
422420
};
423421

424422
const struct inode_operations ext2_special_inode_operations = {
425-
#ifdef CONFIG_EXT2_FS_XATTR
426423
.listxattr = ext2_listxattr,
427-
#endif
428424
.getattr = ext2_getattr,
429425
.setattr = ext2_setattr,
430426
.get_acl = ext2_get_acl,

fs/ext2/symlink.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,12 @@ const struct inode_operations ext2_symlink_inode_operations = {
2525
.get_link = page_get_link,
2626
.getattr = ext2_getattr,
2727
.setattr = ext2_setattr,
28-
#ifdef CONFIG_EXT2_FS_XATTR
2928
.listxattr = ext2_listxattr,
30-
#endif
3129
};
3230

3331
const struct inode_operations ext2_fast_symlink_inode_operations = {
3432
.get_link = simple_get_link,
3533
.getattr = ext2_getattr,
3634
.setattr = ext2_setattr,
37-
#ifdef CONFIG_EXT2_FS_XATTR
3835
.listxattr = ext2_listxattr,
39-
#endif
4036
};

fs/ext2/xattr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ static inline void ext2_xattr_destroy_cache(struct mb_cache *cache)
100100
}
101101

102102
#define ext2_xattr_handlers NULL
103+
#define ext2_listxattr NULL
103104

104105
# endif /* CONFIG_EXT2_FS_XATTR */
105106

0 commit comments

Comments
 (0)