Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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/20200522044035.24190-2-cgxu519@mykernel.net
Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
Signed-off-by: Jan Kara <jack@suse.cz>

authored by

Chengguang Xu and committed by
Jan Kara
91a08715 8939a3af

+1 -10
-2
fs/ext2/file.c
··· 196 196 }; 197 197 198 198 const struct inode_operations ext2_file_inode_operations = { 199 - #ifdef CONFIG_EXT2_FS_XATTR 200 199 .listxattr = ext2_listxattr, 201 - #endif 202 200 .getattr = ext2_getattr, 203 201 .setattr = ext2_setattr, 204 202 .get_acl = ext2_get_acl,
-4
fs/ext2/namei.c
··· 411 411 .rmdir = ext2_rmdir, 412 412 .mknod = ext2_mknod, 413 413 .rename = ext2_rename, 414 - #ifdef CONFIG_EXT2_FS_XATTR 415 414 .listxattr = ext2_listxattr, 416 - #endif 417 415 .getattr = ext2_getattr, 418 416 .setattr = ext2_setattr, 419 417 .get_acl = ext2_get_acl, ··· 420 422 }; 421 423 422 424 const struct inode_operations ext2_special_inode_operations = { 423 - #ifdef CONFIG_EXT2_FS_XATTR 424 425 .listxattr = ext2_listxattr, 425 - #endif 426 426 .getattr = ext2_getattr, 427 427 .setattr = ext2_setattr, 428 428 .get_acl = ext2_get_acl,
-4
fs/ext2/symlink.c
··· 25 25 .get_link = page_get_link, 26 26 .getattr = ext2_getattr, 27 27 .setattr = ext2_setattr, 28 - #ifdef CONFIG_EXT2_FS_XATTR 29 28 .listxattr = ext2_listxattr, 30 - #endif 31 29 }; 32 30 33 31 const struct inode_operations ext2_fast_symlink_inode_operations = { 34 32 .get_link = simple_get_link, 35 33 .getattr = ext2_getattr, 36 34 .setattr = ext2_setattr, 37 - #ifdef CONFIG_EXT2_FS_XATTR 38 35 .listxattr = ext2_listxattr, 39 - #endif 40 36 };
+1
fs/ext2/xattr.h
··· 100 100 } 101 101 102 102 #define ext2_xattr_handlers NULL 103 + #define ext2_listxattr NULL 103 104 104 105 # endif /* CONFIG_EXT2_FS_XATTR */ 105 106