staging: erofs: remove needless dummy functions of erofs_{get, list}xattr
PATCH 1/1 staging: erofs: remove needless dummy functions of erofs_{get, list}xattr
From: Yue Hu <[email protected]>
The two dummy functions of erofs_getxattr()/erofs_listxattr() will never be used if disable CONFIG_EROFS_FS_XATTR.
--- drivers/staging/erofs/xattr.h | 13 ------------- 1 file changed, 13 deletions(-)
drivers/staging/erofs/xattr.h +0 -13
@@ -72,19 +72,6 @@ static inline const struct xattr_handler *erofs_xattr_handler(unsigned index)int erofs_getxattr (struct inode *,int ,const char *,void *,size_t );ssize_t erofs_listxattr (struct dentry *,char *,size_t ); -#else -static int __maybe_unused erofs_getxattr (struct inode *inode,int index, -const char *name, -void *buffer,size_t buffer_size) -{ -return -ENOTSUPP ; -} - -static ssize_t __maybe_unused erofs_listxattr (struct dentry *dentry, -char *buffer,size_t buffer_size) -{ -return -ENOTSUPP ; -}#endif #ifdef CONFIG_EROFS_FS_POSIX_ACL
Signature · 1 line
1.9.1
PATCH 1/1 staging: erofs: remove needless dummy functions of erofs_{get,list}xattr
Hi Yue,
Quoted 22 lines · Yue Hu
From: Yue Hu <huyue2 at yulong.com>
The two dummy functions of erofs_getxattr()/erofs_listxattr() will never be used if disable
CONFIG_EROFS_FS_XATTR.Signed-off-by Yue Hu <huyue2 at yulong.com>--- drivers/staging/erofs/xattr.h | 13 ------------- 1 file changed, 13 deletions(-)drivers/staging/erofs/xattr.h +0
-4@@ -72,19 +72,6 @@ static inline const struct xattr_handler *erofs_xattr_handler(unsigned index)int erofs_getxattr (struct inode *,int ,const char *,void *,size_t );ssize_t erofs_listxattr (struct dentry *,char *,size_t ); -#else -static int __maybe_unused erofs_getxattr (struct inode *inode,int index, -const char *name, -void *buffer,size_t buffer_size)
drivers/staging/erofs/xattr.h static inline const struct xattr_handler *erofs_xattr_handler(unsigned index) · line 75
Quoted 10 lines
drivers/staging/erofs/xattr.h +0
-9-{ -return -ENOTSUPP ; -} - -static ssize_t __maybe_unused erofs_listxattr (struct dentry *dentry, -char *buffer,size_t buffer_size) -{ -return -ENOTSUPP ; -}#endif
It's mainly used for erofs to directly call erofs_getxattr / erofs_listxattr (even xattr feature is off) to get a xattr in erofs itself, just follow what other filesystems (e.g. f2fs) did, although these apis have not been used internally yet but used as callbacks in inode_operations only.
I have no positive or negative tendency since the patch is minor and the only benefit of this patch is that it removes some code which seems redundant currently. However, if erofs_getxattr is needed later, it should be added back of course. Therefore I think it could depend on Greg whether accept this patch or not.
Thanks,
Gao Xiang
Quoted 3 lines
drivers/staging/erofs/xattr.h +0
-0#ifdef CONFIG_EROFS_FS_POSIX_ACL
Greg KH
maintainerPATCH 1/1 staging: erofs: remove needless dummy functions of erofs_{get,list}xattr
Quoted 41 lines · Gao Xiang
Hi Yue,
Quoted 22 lines · Yue Hu
From: Yue Hu <huyue2 at yulong.com>
The two dummy functions of erofs_getxattr()/erofs_listxattr() will never be used if disable
CONFIG_EROFS_FS_XATTR.Signed-off-by Yue Hu <huyue2 at yulong.com>--- drivers/staging/erofs/xattr.h | 13 ------------- 1 file changed, 13 deletions(-)drivers/staging/erofs/xattr.h +0
-4@@ -72,19 +72,6 @@ static inline const struct xattr_handler *erofs_xattr_handler(unsigned index)int erofs_getxattr (struct inode *,int ,const char *,void *,size_t );ssize_t erofs_listxattr (struct dentry *,char *,size_t ); -#else -static int __maybe_unused erofs_getxattr (struct inode *inode,int index, -const char *name, -void *buffer,size_t buffer_size)drivers/staging/erofs/xattr.h static inline const struct xattr_handler *erofs_xattr_handler(unsigned index) · line 75
Quoted 10 lines
drivers/staging/erofs/xattr.h +0
-9-{ -return -ENOTSUPP ; -} - -static ssize_t __maybe_unused erofs_listxattr (struct dentry *dentry, -char *buffer,size_t buffer_size) -{ -return -ENOTSUPP ; -}#endif It's mainly used for erofs to directly call
erofs_getxattr/erofs_listxattr(even xattr feature is off) to get a xattr in erofs itself, just follow what other filesystems (e.g. f2fs) did, although these apis have not been used internally yet but used as callbacks ininode_operationsonly.
Quoted 4 lines
I have no positive or negative tendency since the patch is minor and the only benefit of this patch is that it removes some code which seems redundant currently. However, if
erofs_getxattris needed later, it should be added back of course. Therefore I think it could depend on Greg whether accept this patch or not.
Let's leave this as-is for now.
thanks,
greg k-h