Commit 91a08715 authored by Chengguang Xu's avatar Chengguang Xu Committed by Jan Kara
Browse files

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: default avatarChengguang Xu <cgxu519@mykernel.net>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 8939a3af
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -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,
+0 −4
Original line number Diff line number Diff line
@@ -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,
+0 −4
Original line number Diff line number Diff line
@@ -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
};
+1 −0
Original line number Diff line number Diff line
@@ -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 */