From 8939a3af5c08daca7914c53d9f99c222569b6509 Mon Sep 17 00:00:00 2001 From: Chengguang Xu Date: Fri, 22 May 2020 12:40:34 +0800 Subject: ext2: Fix i_op setting for special inode Let's always set special inode i_op to &ext2_special_inode_operations regardless of CONFIG_EXT2_FS_XATTR setting. It makes sence to be able to query extended inode flags (needing ->setattr and ->getattr callbacks) even when CONFIG_EXT2_FS_XATTR is not set. Link: https://lore.kernel.org/r/20200522044035.24190-1-cgxu519@mykernel.net Signed-off-by: Chengguang Xu Signed-off-by: Jan Kara --- fs/ext2/namei.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'fs') diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c index ccfbbf59e2fc..1a5421a34ef7 100644 --- a/fs/ext2/namei.c +++ b/fs/ext2/namei.c @@ -136,9 +136,7 @@ static int ext2_mknod (struct inode * dir, struct dentry *dentry, umode_t mode, err = PTR_ERR(inode); if (!IS_ERR(inode)) { init_special_inode(inode, inode->i_mode, rdev); -#ifdef CONFIG_EXT2_FS_XATTR inode->i_op = &ext2_special_inode_operations; -#endif mark_inode_dirty(inode); err = ext2_add_nondir(dentry, inode); } -- cgit v1.2.3 From 91a087153d9db2aaabd4fddcb3fa12fa10168136 Mon Sep 17 00:00:00 2001 From: Chengguang Xu Date: Fri, 22 May 2020 12:40:35 +0800 Subject: 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 Signed-off-by: Jan Kara --- fs/ext2/file.c | 2 -- fs/ext2/namei.c | 4 ---- fs/ext2/symlink.c | 4 ---- fs/ext2/xattr.h | 1 + 4 files changed, 1 insertion(+), 10 deletions(-) (limited to 'fs') diff --git a/fs/ext2/file.c b/fs/ext2/file.c index 39c4772e96c9..b4de9a0f170d 100644 --- a/fs/ext2/file.c +++ b/fs/ext2/file.c @@ -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, diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c index 1a5421a34ef7..ba3e3e075891 100644 --- a/fs/ext2/namei.c +++ b/fs/ext2/namei.c @@ -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, diff --git a/fs/ext2/symlink.c b/fs/ext2/symlink.c index 00cdb8679486..948d3a441403 100644 --- a/fs/ext2/symlink.c +++ b/fs/ext2/symlink.c @@ -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 }; diff --git a/fs/ext2/xattr.h b/fs/ext2/xattr.h index 16272e6ddcf4..7925f596e8e2 100644 --- a/fs/ext2/xattr.h +++ b/fs/ext2/xattr.h @@ -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 */ -- cgit v1.2.3 From 5626de1e96f75cc4bede0743ac994e504e2e7726 Mon Sep 17 00:00:00 2001 From: Liao Pingfang Date: Fri, 29 May 2020 09:02:30 +0800 Subject: reiserfs: Replace kmalloc with kcalloc in the comment Use kcalloc instead of kmalloc in the comment according to the previous kcalloc() call. Link: https://lore.kernel.org/r/1590714150-15895-1-git-send-email-wang.yi59@zte.com.cn Signed-off-by: Liao Pingfang Signed-off-by: Jan Kara --- fs/reiserfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs') diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 6419e6dacc39..21ad762c9ac6 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c @@ -1066,7 +1066,7 @@ research: } else { /* paste hole to the indirect item */ /* - * If kmalloc failed, max_to_insert becomes + * If kcalloc failed, max_to_insert becomes * zero and it means we only have space for * one block */ -- cgit v1.2.3