]> Git Repo - linux.git/commitdiff
ext2: code cleanup by removing ifdef macro surrounding
authorChengguang Xu <[email protected]>
Fri, 22 May 2020 04:40:35 +0000 (12:40 +0800)
committerJan Kara <[email protected]>
Fri, 22 May 2020 13:11:00 +0000 (15:11 +0200)
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]>
fs/ext2/file.c
fs/ext2/namei.c
fs/ext2/symlink.c
fs/ext2/xattr.h

index 39c4772e96c9d5decd93d71a2c5303fd2af95917..b4de9a0f170df28c7aef0e1635c739a3ece4d638 100644 (file)
@@ -196,9 +196,7 @@ const struct file_operations ext2_file_operations = {
 };
 
 const struct inode_operations ext2_file_inode_operations = {
-#ifdef CONFIG_EXT2_FS_XATTR
        .listxattr      = ext2_listxattr,
-#endif
        .getattr        = ext2_getattr,
        .setattr        = ext2_setattr,
        .get_acl        = ext2_get_acl,
index 1a5421a34ef7f190e68c95233ee4bc488f7812f8..ba3e3e0758913b110dbd1ca31311df137d8eafea 100644 (file)
@@ -411,9 +411,7 @@ const struct inode_operations ext2_dir_inode_operations = {
        .rmdir          = ext2_rmdir,
        .mknod          = ext2_mknod,
        .rename         = ext2_rename,
-#ifdef CONFIG_EXT2_FS_XATTR
        .listxattr      = ext2_listxattr,
-#endif
        .getattr        = ext2_getattr,
        .setattr        = ext2_setattr,
        .get_acl        = ext2_get_acl,
@@ -422,9 +420,7 @@ const struct inode_operations ext2_dir_inode_operations = {
 };
 
 const struct inode_operations ext2_special_inode_operations = {
-#ifdef CONFIG_EXT2_FS_XATTR
        .listxattr      = ext2_listxattr,
-#endif
        .getattr        = ext2_getattr,
        .setattr        = ext2_setattr,
        .get_acl        = ext2_get_acl,
index 00cdb86794861d77b161f3297895c7cc11e0c7c0..948d3a4414030e0c4718ae42b6c11d90c9708ba7 100644 (file)
@@ -25,16 +25,12 @@ const struct inode_operations ext2_symlink_inode_operations = {
        .get_link       = page_get_link,
        .getattr        = ext2_getattr,
        .setattr        = ext2_setattr,
-#ifdef CONFIG_EXT2_FS_XATTR
        .listxattr      = ext2_listxattr,
-#endif
 };
  
 const struct inode_operations ext2_fast_symlink_inode_operations = {
        .get_link       = simple_get_link,
        .getattr        = ext2_getattr,
        .setattr        = ext2_setattr,
-#ifdef CONFIG_EXT2_FS_XATTR
        .listxattr      = ext2_listxattr,
-#endif
 };
index 16272e6ddcf444498f451082c94e2b2d4a68deb2..7925f596e8e2a353bbb0a699307d7a835b5167b6 100644 (file)
@@ -100,6 +100,7 @@ static inline void ext2_xattr_destroy_cache(struct mb_cache *cache)
 }
 
 #define ext2_xattr_handlers NULL
+#define ext2_listxattr NULL
 
 # endif  /* CONFIG_EXT2_FS_XATTR */
 
This page took 0.061369 seconds and 4 git commands to generate.