ext4: remove double definitions of xattr macros
PATCH 1/1 ext4: remove double definitions of xattr macros
remove the definitions of macros:XATTR_TRUSTED_PREFIXXATTR_USER_PREFIX
since they are defined in linux/xattr.h
Signed-off-by Shen Feng <[email protected]>
--- fs/ext4/xattr_trusted.c | 4 +--- fs/ext4/xattr_user.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)
fs/ext4/xattr_trusted.c +1 -3
@@ -13,13 +13,11 @@#include "ext4.h" #include "xattr.h" -#define XATTR_TRUSTED_PREFIX "trusted." -static size_t ext4_xattr_trusted_list (struct inode *inode,char *list,size_t list_size,const char *name,size_t name_len) { -const size_t prefix_len =sizeof (XATTR_TRUSTED_PREFIX )-1 ; +const size_t prefix_len =XATTR_TRUSTED_PREFIX_LEN ;const size_t total_len = prefix_len + name_len +1 ;if (!capable (CAP_SYS_ADMIN ))
fs/ext4/xattr_user.c +0 -1
@@ -12,13 +12,11 @@#include "ext4.h" #include "xattr.h" -#define XATTR_USER_PREFIX "user."
Quoted 6 lines · Shen Feng
remove the definitions of macros:
XATTR_TRUSTED_PREFIXXATTR_USER_PREFIX
since they are defined inlinux/xattr.hSigned-off-by Shen Feng <[email protected]>
Signed-off-by Mingming Cao <[email protected]>
BTW, the similar duplication also appear in in ext2/3/reiserfs, clean up should also done there too?
Quoted 43 lines
--- fs/ext4/xattr_trusted.c | 4 +--- fs/ext4/xattr_user.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)fs/ext4/xattr_trusted.c +1
-3@@ -13,13 +13,11 @@#include "ext4.h" #include "xattr.h" -#define XATTR_TRUSTED_PREFIX "trusted." -static size_t ext4_xattr_trusted_list (struct inode *inode,char *list,size_t list_size,const char *name,size_t name_len) { -const size_t prefix_len =sizeof (XATTR_TRUSTED_PREFIX )-1 ; +const size_t prefix_len =XATTR_TRUSTED_PREFIX_LEN ;const size_t total_len = prefix_len + name_len +1 ;if (!capable (CAP_SYS_ADMIN ))fs/ext4/xattr_user.c +1
-3@@ -12,13 +12,11 @@#include "ext4.h" #include "xattr.h" -#define XATTR_USER_PREFIX "user." -static size_t ext4_xattr_user_list (struct inode *inode,char *list,size_t list_size,const char *name,size_t name_len) { -const size_t prefix_len =sizeof (XATTR_USER_PREFIX )-1 ; +const size_t prefix_len =XATTR_USER_PREFIX_LEN ;const size_t total_len = prefix_len + name_len +1 ;if (!test_opt (inode->i_sb,XATTR_USER ))
Mingming Cao Wrote:
Quoted 6 lines · Shen Feng
Quoted 5 lines
remove the definitions of macros:
XATTR_TRUSTED_PREFIXXATTR_USER_PREFIX
since they are defined inlinux/xattr.h
Quoted 6 lines
Quoted 1 line
Signed-off-by Shen Feng <[email protected]>Signed-off-by Mingming Cao <[email protected]>BTW, the similar duplication also appear in in ext2/3/reiserfs, clean up should also done there too?
Yes. I will send a patch series to fix this.
Quoted 47 lines
Quoted 44 lines
--- fs/ext4/xattr_trusted.c | 4 +--- fs/ext4/xattr_user.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)fs/ext4/xattr_trusted.c +1
-3@@ -13,13 +13,11 @@#include "ext4.h" #include "xattr.h" -#define XATTR_TRUSTED_PREFIX "trusted." -static size_t ext4_xattr_trusted_list (struct inode *inode,char *list,size_t list_size,const char *name,size_t name_len) { -const size_t prefix_len =sizeof (XATTR_TRUSTED_PREFIX )-1 ; +const size_t prefix_len =XATTR_TRUSTED_PREFIX_LEN ;const size_t total_len = prefix_len + name_len +1 ;if (!capable (CAP_SYS_ADMIN ))fs/ext4/xattr_user.c +1
-3@@ -12,13 +12,11 @@#include "ext4.h" #include "xattr.h" -#define XATTR_USER_PREFIX "user." -static size_t ext4_xattr_user_list (struct inode *inode,char *list,size_t list_size,const char *name,size_t name_len) { -const size_t prefix_len =sizeof (XATTR_USER_PREFIX )-1 ; +const size_t prefix_len =XATTR_USER_PREFIX_LEN ;const size_t total_len = prefix_len + name_len +1 ;if (!test_opt (inode->i_sb,XATTR_USER ))