* [PATCH] ext2: surround xattr related code with macro CONFIG_EXT2_FS_XATTR
@ 2018-11-17 12:59 Chengguang Xu
2018-11-19 10:02 ` Jan Kara
0 siblings, 1 reply; 2+ messages in thread
From: Chengguang Xu @ 2018-11-17 12:59 UTC (permalink / raw)
To: jack; +Cc: linux-ext4, Chengguang Xu
ext2_xattr_destroy_cache() is only needed when macro
CONFIG_EXT2_FS_XATTR is enabled, so surround related
code with the macro.
Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
fs/ext2/super.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index e4351c280608..67a71b0cb5e0 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -148,8 +148,10 @@ static void ext2_put_super (struct super_block * sb)
ext2_quota_off_umount(sb);
+#ifdef CONFIG_EXT2_FS_XATTR
ext2_xattr_destroy_cache(sbi->s_ea_block_cache);
sbi->s_ea_block_cache = NULL;
+#endif
if (!sb_rdonly(sb)) {
struct ext2_super_block *es = sbi->s_es;
@@ -1196,7 +1198,9 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
sb->s_id);
goto failed_mount;
failed_mount3:
+#ifdef CONFIG_EXT2_FS_XATTR
ext2_xattr_destroy_cache(sbi->s_ea_block_cache);
+#endif
percpu_counter_destroy(&sbi->s_freeblocks_counter);
percpu_counter_destroy(&sbi->s_freeinodes_counter);
percpu_counter_destroy(&sbi->s_dirs_counter);
--
2.17.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ext2: surround xattr related code with macro CONFIG_EXT2_FS_XATTR
2018-11-17 12:59 [PATCH] ext2: surround xattr related code with macro CONFIG_EXT2_FS_XATTR Chengguang Xu
@ 2018-11-19 10:02 ` Jan Kara
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2018-11-19 10:02 UTC (permalink / raw)
To: Chengguang Xu; +Cc: jack, linux-ext4
On Sat 17-11-18 20:59:16, Chengguang Xu wrote:
> ext2_xattr_destroy_cache() is only needed when macro
> CONFIG_EXT2_FS_XATTR is enabled, so surround related
> code with the macro.
True but I prefer (and it is a general kernel practice) to avoid ifdef
in code if reasonably possible.
Honza
> ---
> fs/ext2/super.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/fs/ext2/super.c b/fs/ext2/super.c
> index e4351c280608..67a71b0cb5e0 100644
> --- a/fs/ext2/super.c
> +++ b/fs/ext2/super.c
> @@ -148,8 +148,10 @@ static void ext2_put_super (struct super_block * sb)
>
> ext2_quota_off_umount(sb);
>
> +#ifdef CONFIG_EXT2_FS_XATTR
> ext2_xattr_destroy_cache(sbi->s_ea_block_cache);
> sbi->s_ea_block_cache = NULL;
> +#endif
>
> if (!sb_rdonly(sb)) {
> struct ext2_super_block *es = sbi->s_es;
> @@ -1196,7 +1198,9 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
> sb->s_id);
> goto failed_mount;
> failed_mount3:
> +#ifdef CONFIG_EXT2_FS_XATTR
> ext2_xattr_destroy_cache(sbi->s_ea_block_cache);
> +#endif
> percpu_counter_destroy(&sbi->s_freeblocks_counter);
> percpu_counter_destroy(&sbi->s_freeinodes_counter);
> percpu_counter_destroy(&sbi->s_dirs_counter);
> --
> 2.17.2
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-19 20:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-17 12:59 [PATCH] ext2: surround xattr related code with macro CONFIG_EXT2_FS_XATTR Chengguang Xu
2018-11-19 10:02 ` Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).