staging: erofs: remove needless CONFIG_EROFS_FS_SECURITY
PATCH 1/1 staging: erofs: remove needless CONFIG_EROFS_FS_SECURITY
From: Yue Hu <[email protected]>
erofs_xattr_security_handler is already marked __maybe_unused, no need to add CONFIG_EROFS_FS_SECURITY condition.
--- drivers/staging/erofs/xattr.c | 2 -- 1 file changed, 2 deletions(-)
drivers/staging/erofs/xattr.c +0 -2
@@ -499,13 +499,11 @@ static int erofs_xattr_generic_get(const struct xattr_handler *handler, .get = erofs_xattr_generic_get, }; -#ifdef CONFIG_EROFS_FS_SECURITY const struct xattr_handler __maybe_unused erofs_xattr_security_handler = { .prefix =XATTR_SECURITY_PREFIX , .flags =EROFS_XATTR_INDEX_SECURITY , .get = erofs_xattr_generic_get, }; -#endif const struct xattr_handler *erofs_xattr_handlers[] = { &erofs_xattr_user_handler,
Signature · 1 line
1.9.1
PATCH 1/1 staging: erofs: remove needless CONFIG_EROFS_FS_SECURITY
Hi Yue,
Quoted 15 lines · Yue Hu
From: Yue Hu <huyue2 at yulong.com>
erofs_xattr_security_handleris already marked__maybe_unused, no need to addCONFIG_EROFS_FS_SECURITYcondition.Signed-off-by Yue Hu <huyue2 at yulong.com>--- drivers/staging/erofs/xattr.c | 2 -- 1 file changed, 2 deletions(-)drivers/staging/erofs/xattr.c +0
-0
drivers/staging/erofs/xattr.c static int erofs_xattr_generic_get(const struct xattr_handler *handler, · line 508
Quoted 10 lines
drivers/staging/erofs/xattr.c +0
-2@@ -499,13 +499,11 @@ static int erofs_xattr_generic_get(const struct xattr_handler *handler, .get = erofs_xattr_generic_get, }; -#ifdef CONFIG_EROFS_FS_SECURITY const struct xattr_handler __maybe_unused erofs_xattr_security_handler = { .prefix =XATTR_SECURITY_PREFIX , .flags =EROFS_XATTR_INDEX_SECURITY , .get = erofs_xattr_generic_get, }; -#endif
Thanks for your patch.
In that case...erofs_xattr_security_handler could be compiled into .rodata section? I am not sure...
Thanks,
Gao Xiang
Quoted 4 lines
drivers/staging/erofs/xattr.c +0
-0const struct xattr_handler *erofs_xattr_handlers[] = { &erofs_xattr_user_handler,
PATCH 1/1 staging: erofs: remove needless CONFIG_EROFS_FS_SECURITY
Quoted 7 lines · Gao Xiang
Hi Yue,
Quoted 4 lines · Yue Hu
From: Yue Hu <huyue2 at yulong.com>
erofs_xattr_security_handleris already marked__maybe_unused, no need to addCONFIG_EROFS_FS_SECURITYcondition.
CONFIG_EROFS_FS_SECURITY is used as a control switch of erofs security labels feature, but __maybe_unused is to avoid unneeded compiler warning on unused variable, so I think we can't remove it.
Thanks,
Quoted 36 lines
Quoted 11 lines
Signed-off-by Yue Hu <huyue2 at yulong.com>--- drivers/staging/erofs/xattr.c | 2 -- 1 file changed, 2 deletions(-)drivers/staging/erofs/xattr.c +0
-0drivers/staging/erofs/xattr.c static int erofs_xattr_generic_get(const struct xattr_handler *handler, · line 508
Quoted 10 lines
drivers/staging/erofs/xattr.c +0
-2@@ -499,13 +499,11 @@ static int erofs_xattr_generic_get(const struct xattr_handler *handler, .get = erofs_xattr_generic_get, }; -#ifdef CONFIG_EROFS_FS_SECURITY const struct xattr_handler __maybe_unused erofs_xattr_security_handler = { .prefix =XATTR_SECURITY_PREFIX , .flags =EROFS_XATTR_INDEX_SECURITY , .get = erofs_xattr_generic_get, }; -#endif Thanks for your patch.
In that case...erofs_xattr_security_handler could be compiled into .rodata section? I am not sure...
Thanks,
Gao Xiangdrivers/staging/erofs/xattr.c static int erofs_xattr_generic_get(const struct xattr_handler *handler,
Quoted 4 lines
drivers/staging/erofs/xattr.c +0
-0const struct xattr_handler *erofs_xattr_handlers[] = { &erofs_xattr_user_handler,.
PATCH 1/1 staging: erofs: remove needless CONFIG_EROFS_FS_SECURITY
Quoted 4 lines · On Thu, 20 Jun 2019 17:22:48 +0800 Chao Yu <[email protected]> wrote:
Quoted 3 lines · Gao Xiang
Hi Yue,
On 2019/6/20 16:30, Yue Hu wrote:
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
From: Yue Hu <huyue2 at yulong.com>
erofs_xattr_security_handleris already marked__maybe_unused, no need to addCONFIG_EROFS_FS_SECURITYcondition.
CONFIG_EROFS_FS_SECURITYis used as a control switch of erofs security labels feature, but__maybe_unusedis to avoid unneeded compiler warning on unused variable, so I think we can't remove it.
However, erofs_xattr_security_handler will not unused under CONFIG_EROFS_FS_SECURITY condition, right?
Thx.
Quoted 39 lines
Thanks,
Quoted 36 lines
Quoted 11 lines
Signed-off-by Yue Hu <huyue2 at yulong.com>--- drivers/staging/erofs/xattr.c | 2 -- 1 file changed, 2 deletions(-)drivers/staging/erofs/xattr.c +0
-0drivers/staging/erofs/xattr.c static int erofs_xattr_generic_get(const struct xattr_handler *handler, · line 508
Quoted 10 lines
drivers/staging/erofs/xattr.c +0
-2@@ -499,13 +499,11 @@ static int erofs_xattr_generic_get(const struct xattr_handler *handler, .get = erofs_xattr_generic_get, }; -#ifdef CONFIG_EROFS_FS_SECURITY const struct xattr_handler __maybe_unused erofs_xattr_security_handler = { .prefix =XATTR_SECURITY_PREFIX , .flags =EROFS_XATTR_INDEX_SECURITY , .get = erofs_xattr_generic_get, }; -#endif Thanks for your patch.
In that case...erofs_xattr_security_handler could be compiled into .rodata section? I am not sure...
Thanks,
Gao Xiangdrivers/staging/erofs/xattr.c static int erofs_xattr_generic_get(const struct xattr_handler *handler,
Quoted 4 lines
drivers/staging/erofs/xattr.c +0
-0const struct xattr_handler *erofs_xattr_handlers[] = { &erofs_xattr_user_handler,.
PATCH 1/1 staging: erofs: remove needless CONFIG_EROFS_FS_SECURITY
Quoted 12 lines · Yue Hu
Quoted 9 lines · On Thu, 20 Jun 2019 17:22:48 +0800 Chao Yu <[email protected]> wrote:
Quoted 7 lines · Gao Xiang
Hi Yue,
Quoted 4 lines · Yue Hu
From: Yue Hu <huyue2 at yulong.com>
erofs_xattr_security_handleris already marked__maybe_unused, no need to addCONFIG_EROFS_FS_SECURITYcondition.
Quoted 6 lines
Quoted 3 lines
CONFIG_EROFS_FS_SECURITYis used as a control switch of erofs security labels feature, but__maybe_unusedis to avoid unneeded compiler warning on unused variable, so I think we can't remove it.However,
erofs_xattr_security_handlerwill not unused underCONFIG_EROFS_FS_SECURITYcondition, right?
Yes, we will referred it in erofs_xattr_handlers anyway, so, maybe we can remove __maybe_unused instead?
Thanks,
Quoted 45 lines
Thx.
Quoted 39 lines
Thanks,
Quoted 36 lines
Quoted 11 lines
Signed-off-by Yue Hu <huyue2 at yulong.com>--- drivers/staging/erofs/xattr.c | 2 -- 1 file changed, 2 deletions(-)drivers/staging/erofs/xattr.c +0
-0drivers/staging/erofs/xattr.c static int erofs_xattr_generic_get(const struct xattr_handler *handler, · line 508
Quoted 10 lines
drivers/staging/erofs/xattr.c +0
-2@@ -499,13 +499,11 @@ static int erofs_xattr_generic_get(const struct xattr_handler *handler, .get = erofs_xattr_generic_get, }; -#ifdef CONFIG_EROFS_FS_SECURITY const struct xattr_handler __maybe_unused erofs_xattr_security_handler = { .prefix =XATTR_SECURITY_PREFIX , .flags =EROFS_XATTR_INDEX_SECURITY , .get = erofs_xattr_generic_get, }; -#endif Thanks for your patch.
In that case...erofs_xattr_security_handler could be compiled into .rodata section? I am not sure...
Thanks,
Gao Xiangdrivers/staging/erofs/xattr.c static int erofs_xattr_generic_get(const struct xattr_handler *handler,
Quoted 4 lines
drivers/staging/erofs/xattr.c +0
-0const struct xattr_handler *erofs_xattr_handlers[] = { &erofs_xattr_user_handler,.
.
PATCH 1/1 staging: erofs: remove needless CONFIG_EROFS_FS_SECURITY
Quoted 17 lines · On Thu, 20 Jun 2019 17:52:39 +0800 Chao Yu <[email protected]> wrote:
Quoted 16 lines · Yue Hu
Quoted 12 lines · On Thu, 20 Jun 2019 17:22:48 +0800 Chao Yu <[email protected]> wrote:
Quoted 7 lines · Gao Xiang
Hi Yue,
Quoted 4 lines · Yue Hu
From: Yue Hu <huyue2 at yulong.com>
erofs_xattr_security_handleris already marked__maybe_unused, no need to addCONFIG_EROFS_FS_SECURITYcondition.
CONFIG_EROFS_FS_SECURITYis used as a control switch of erofs security labels feature, but__maybe_unusedis to avoid unneeded compiler warning on unused variable, so I think we can't remove it.
Quoted 5 lines
Quoted 2 lines
However,
erofs_xattr_security_handlerwill not unused underCONFIG_EROFS_FS_SECURITYcondition, right?Yes, we will referred it in
erofs_xattr_handlersanyway, so, maybe we can remove__maybe_unusedinstead?
It's good to me.
Thx.
Quoted 48 lines
Thanks,
Quoted 45 lines
Thx.
Quoted 39 lines
Thanks,
Quoted 36 lines
Quoted 11 lines
Signed-off-by Yue Hu <huyue2 at yulong.com>--- drivers/staging/erofs/xattr.c | 2 -- 1 file changed, 2 deletions(-)drivers/staging/erofs/xattr.c +0
-0drivers/staging/erofs/xattr.c static int erofs_xattr_generic_get(const struct xattr_handler *handler, · line 508
Quoted 10 lines
drivers/staging/erofs/xattr.c +0
-2@@ -499,13 +499,11 @@ static int erofs_xattr_generic_get(const struct xattr_handler *handler, .get = erofs_xattr_generic_get, }; -#ifdef CONFIG_EROFS_FS_SECURITY const struct xattr_handler __maybe_unused erofs_xattr_security_handler = { .prefix =XATTR_SECURITY_PREFIX , .flags =EROFS_XATTR_INDEX_SECURITY , .get = erofs_xattr_generic_get, }; -#endif Thanks for your patch.
In that case...erofs_xattr_security_handler could be compiled into .rodata section? I am not sure...
Thanks,
Gao Xiangdrivers/staging/erofs/xattr.c static int erofs_xattr_generic_get(const struct xattr_handler *handler,
Quoted 4 lines
drivers/staging/erofs/xattr.c +0
-0const struct xattr_handler *erofs_xattr_handlers[] = { &erofs_xattr_user_handler,.
.
PATCH 1/1 staging: erofs: remove needless CONFIG_EROFS_FS_SECURITY
In reply to Gao XiangQuoted 31 lines · On Thu, 20 Jun 2019 16:32:01 +0800 Gao Xiang <[email protected]> wrote:
Hi Yue,
Quoted 15 lines · Yue Hu
From: Yue Hu <huyue2 at yulong.com>
erofs_xattr_security_handleris already marked__maybe_unused, no need to addCONFIG_EROFS_FS_SECURITYcondition.Signed-off-by Yue Hu <huyue2 at yulong.com>--- drivers/staging/erofs/xattr.c | 2 -- 1 file changed, 2 deletions(-)drivers/staging/erofs/xattr.c +0
-0drivers/staging/erofs/xattr.c static int erofs_xattr_generic_get(const struct xattr_handler *handler, · line 508
Quoted 10 lines
drivers/staging/erofs/xattr.c +0
-2@@ -499,13 +499,11 @@ static int erofs_xattr_generic_get(const struct xattr_handler *handler, .get = erofs_xattr_generic_get, }; -#ifdef CONFIG_EROFS_FS_SECURITY const struct xattr_handler __maybe_unused erofs_xattr_security_handler = { .prefix =XATTR_SECURITY_PREFIX , .flags =EROFS_XATTR_INDEX_SECURITY , .get = erofs_xattr_generic_get, }; -#endif Thanks for your patch.
Quoted 2 lines
In that case...erofs_xattr_security_handler could be compiled into .rodata section? I am not sure...
Yes, just like erofs_xattr_user_handler as below in System.map.
ffffffff820ec2a0 R erofs_xattr_security_handlerffffffff820ec2e0 R erofs_xattr_trusted_handlerffffffff820ec320 R erofs_xattr_user_handler
Thx.
Quoted 8 lines
Thanks,
Gao XiangQuoted 4 lines
drivers/staging/erofs/xattr.c +0
-0const struct xattr_handler *erofs_xattr_handlers[] = { &erofs_xattr_user_handler,
PATCH 1/1 staging: erofs: remove needless CONFIG_EROFS_FS_SECURITY
Quoted 34 lines · Yue Hu
Quoted 31 lines · On Thu, 20 Jun 2019 16:32:01 +0800 Gao Xiang <[email protected]> wrote:
Hi Yue,
Quoted 15 lines · Yue Hu
From: Yue Hu <huyue2 at yulong.com>
erofs_xattr_security_handleris already marked__maybe_unused, no need to addCONFIG_EROFS_FS_SECURITYcondition.Signed-off-by Yue Hu <huyue2 at yulong.com>--- drivers/staging/erofs/xattr.c | 2 -- 1 file changed, 2 deletions(-)drivers/staging/erofs/xattr.c +0
-0drivers/staging/erofs/xattr.c static int erofs_xattr_generic_get(const struct xattr_handler *handler, · line 508
Quoted 10 lines
drivers/staging/erofs/xattr.c +0
-2@@ -499,13 +499,11 @@ static int erofs_xattr_generic_get(const struct xattr_handler *handler, .get = erofs_xattr_generic_get, }; -#ifdef CONFIG_EROFS_FS_SECURITY const struct xattr_handler __maybe_unused erofs_xattr_security_handler = { .prefix =XATTR_SECURITY_PREFIX , .flags =EROFS_XATTR_INDEX_SECURITY , .get = erofs_xattr_generic_get, }; -#endif Thanks for your patch.
Quoted 8 lines
Quoted 2 lines
In that case...erofs_xattr_security_handler could be compiled into .rodata section? I am not sure...
Yes, just like
erofs_xattr_user_handleras below in System.map.
ffffffff820ec2a0Rerofs_xattr_security_handlerffffffff820ec2e0Rerofs_xattr_trusted_handlerffffffff820ec320Rerofs_xattr_user_handler
As a usual practice, CONFIG_{EXT2,EXT4,F2FS,EROFS}_FS_SECURITY are defined as kernel configuations.
It seems that for ext2/ext4 they leave
const struct xattr_handler ext2_xattr_security_handler = {
in xattr_security.c and the Makefiles are similar as
fs/ext2/Makefile
13:ext2-$(CONFIG_EXT2_FS_SECURITY) += xattr_security.o
But for f2fs, f2fs_xattr_security_handler is not wrapped with any configuration.
Actually I think that is not a big deal, I'd like to listen Chao and Greg's idea about this...
Thanks,
Gao Xiang
Quoted 12 lines
Thx.
Quoted 8 lines
Thanks,
Gao XiangQuoted 4 lines
drivers/staging/erofs/xattr.c +0
-0const struct xattr_handler *erofs_xattr_handlers[] = { &erofs_xattr_user_handler,
Greg KH
maintainerPATCH 1/1 staging: erofs: remove needless CONFIG_EROFS_FS_SECURITY
In reply to Yue HuQuoted 15 lines · Yue Hu
From: Yue Hu <huyue2 at yulong.com>
erofs_xattr_security_handleris already marked__maybe_unused, no need to addCONFIG_EROFS_FS_SECURITYcondition.Signed-off-by Yue Hu <huyue2 at yulong.com>--- drivers/staging/erofs/xattr.c | 2 -- 1 file changed, 2 deletions(-)drivers/staging/erofs/xattr.c +0
-0
drivers/staging/erofs/xattr.c static int erofs_xattr_generic_get(const struct xattr_handler *handler, · line 508
Quoted 10 lines
drivers/staging/erofs/xattr.c +0
-2@@ -499,13 +499,11 @@ static int erofs_xattr_generic_get(const struct xattr_handler *handler, .get = erofs_xattr_generic_get, }; -#ifdef CONFIG_EROFS_FS_SECURITY const struct xattr_handler __maybe_unused erofs_xattr_security_handler = { .prefix =XATTR_SECURITY_PREFIX , .flags =EROFS_XATTR_INDEX_SECURITY , .get = erofs_xattr_generic_get, }; -#endif
It's nicer just to leave this as-is for now, the memory savings isn't much at all.
thanks,
greg k-h