Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs: rename generic posix acl handlers

Reflect in their naming and document that they are kept around for
legacy reasons and shouldn't be used anymore by new code.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>

+36 -27
+2 -4
fs/erofs/xattr.h
··· 49 49 static const struct xattr_handler *xattr_handler_map[] = { 50 50 [EROFS_XATTR_INDEX_USER] = &erofs_xattr_user_handler, 51 51 #ifdef CONFIG_EROFS_FS_POSIX_ACL 52 - [EROFS_XATTR_INDEX_POSIX_ACL_ACCESS] = 53 - &posix_acl_access_xattr_handler, 54 - [EROFS_XATTR_INDEX_POSIX_ACL_DEFAULT] = 55 - &posix_acl_default_xattr_handler, 52 + [EROFS_XATTR_INDEX_POSIX_ACL_ACCESS] = &nop_posix_acl_access, 53 + [EROFS_XATTR_INDEX_POSIX_ACL_DEFAULT] = &nop_posix_acl_default, 56 54 #endif 57 55 [EROFS_XATTR_INDEX_TRUSTED] = &erofs_xattr_trusted_handler, 58 56 #ifdef CONFIG_EROFS_FS_SECURITY
+2 -2
fs/ext2/xattr.c
··· 101 101 static const struct xattr_handler *ext2_xattr_handler_map[] = { 102 102 [EXT2_XATTR_INDEX_USER] = &ext2_xattr_user_handler, 103 103 #ifdef CONFIG_EXT2_FS_POSIX_ACL 104 - [EXT2_XATTR_INDEX_POSIX_ACL_ACCESS] = &posix_acl_access_xattr_handler, 105 - [EXT2_XATTR_INDEX_POSIX_ACL_DEFAULT] = &posix_acl_default_xattr_handler, 104 + [EXT2_XATTR_INDEX_POSIX_ACL_ACCESS] = &nop_posix_acl_access, 105 + [EXT2_XATTR_INDEX_POSIX_ACL_DEFAULT] = &nop_posix_acl_default, 106 106 #endif 107 107 [EXT2_XATTR_INDEX_TRUSTED] = &ext2_xattr_trusted_handler, 108 108 #ifdef CONFIG_EXT2_FS_SECURITY
+2 -2
fs/ext4/xattr.c
··· 88 88 static const struct xattr_handler * const ext4_xattr_handler_map[] = { 89 89 [EXT4_XATTR_INDEX_USER] = &ext4_xattr_user_handler, 90 90 #ifdef CONFIG_EXT4_FS_POSIX_ACL 91 - [EXT4_XATTR_INDEX_POSIX_ACL_ACCESS] = &posix_acl_access_xattr_handler, 92 - [EXT4_XATTR_INDEX_POSIX_ACL_DEFAULT] = &posix_acl_default_xattr_handler, 91 + [EXT4_XATTR_INDEX_POSIX_ACL_ACCESS] = &nop_posix_acl_access, 92 + [EXT4_XATTR_INDEX_POSIX_ACL_DEFAULT] = &nop_posix_acl_default, 93 93 #endif 94 94 [EXT4_XATTR_INDEX_TRUSTED] = &ext4_xattr_trusted_handler, 95 95 #ifdef CONFIG_EXT4_FS_SECURITY
+2 -2
fs/f2fs/xattr.c
··· 192 192 static const struct xattr_handler *f2fs_xattr_handler_map[] = { 193 193 [F2FS_XATTR_INDEX_USER] = &f2fs_xattr_user_handler, 194 194 #ifdef CONFIG_F2FS_FS_POSIX_ACL 195 - [F2FS_XATTR_INDEX_POSIX_ACL_ACCESS] = &posix_acl_access_xattr_handler, 196 - [F2FS_XATTR_INDEX_POSIX_ACL_DEFAULT] = &posix_acl_default_xattr_handler, 195 + [F2FS_XATTR_INDEX_POSIX_ACL_ACCESS] = &nop_posix_acl_access, 196 + [F2FS_XATTR_INDEX_POSIX_ACL_DEFAULT] = &nop_posix_acl_default, 197 197 #endif 198 198 [F2FS_XATTR_INDEX_TRUSTED] = &f2fs_xattr_trusted_handler, 199 199 #ifdef CONFIG_F2FS_FS_SECURITY
+2 -2
fs/jffs2/xattr.c
··· 939 939 #endif 940 940 #ifdef CONFIG_JFFS2_FS_POSIX_ACL 941 941 case JFFS2_XPREFIX_ACL_ACCESS: 942 - ret = &posix_acl_access_xattr_handler; 942 + ret = &nop_posix_acl_access; 943 943 break; 944 944 case JFFS2_XPREFIX_ACL_DEFAULT: 945 - ret = &posix_acl_default_xattr_handler; 945 + ret = &nop_posix_acl_default; 946 946 break; 947 947 #endif 948 948 case JFFS2_XPREFIX_TRUSTED:
+5 -7
fs/ocfs2/xattr.c
··· 95 95 }; 96 96 97 97 static const struct xattr_handler *ocfs2_xattr_handler_map[OCFS2_XATTR_MAX] = { 98 - [OCFS2_XATTR_INDEX_USER] = &ocfs2_xattr_user_handler, 99 - [OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS] 100 - = &posix_acl_access_xattr_handler, 101 - [OCFS2_XATTR_INDEX_POSIX_ACL_DEFAULT] 102 - = &posix_acl_default_xattr_handler, 103 - [OCFS2_XATTR_INDEX_TRUSTED] = &ocfs2_xattr_trusted_handler, 104 - [OCFS2_XATTR_INDEX_SECURITY] = &ocfs2_xattr_security_handler, 98 + [OCFS2_XATTR_INDEX_USER] = &ocfs2_xattr_user_handler, 99 + [OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS] = &nop_posix_acl_access, 100 + [OCFS2_XATTR_INDEX_POSIX_ACL_DEFAULT] = &nop_posix_acl_default, 101 + [OCFS2_XATTR_INDEX_TRUSTED] = &ocfs2_xattr_trusted_handler, 102 + [OCFS2_XATTR_INDEX_SECURITY] = &ocfs2_xattr_security_handler, 105 103 }; 106 104 107 105 struct ocfs2_xattr_info {
+18 -6
fs/posix_acl.c
··· 988 988 return IS_POSIXACL(d_backing_inode(dentry)); 989 989 } 990 990 991 - const struct xattr_handler posix_acl_access_xattr_handler = { 991 + /* 992 + * nop_posix_acl_access - legacy xattr handler for access POSIX ACLs 993 + * 994 + * This is the legacy POSIX ACL access xattr handler. It is used by some 995 + * filesystems to implement their ->listxattr() inode operation. New code 996 + * should never use them. 997 + */ 998 + const struct xattr_handler nop_posix_acl_access = { 992 999 .name = XATTR_NAME_POSIX_ACL_ACCESS, 993 - .flags = ACL_TYPE_ACCESS, 994 1000 .list = posix_acl_xattr_list, 995 1001 }; 996 - EXPORT_SYMBOL_GPL(posix_acl_access_xattr_handler); 1002 + EXPORT_SYMBOL_GPL(nop_posix_acl_access); 997 1003 998 - const struct xattr_handler posix_acl_default_xattr_handler = { 1004 + /* 1005 + * nop_posix_acl_default - legacy xattr handler for default POSIX ACLs 1006 + * 1007 + * This is the legacy POSIX ACL default xattr handler. It is used by some 1008 + * filesystems to implement their ->listxattr() inode operation. New code 1009 + * should never use them. 1010 + */ 1011 + const struct xattr_handler nop_posix_acl_default = { 999 1012 .name = XATTR_NAME_POSIX_ACL_DEFAULT, 1000 - .flags = ACL_TYPE_DEFAULT, 1001 1013 .list = posix_acl_xattr_list, 1002 1014 }; 1003 - EXPORT_SYMBOL_GPL(posix_acl_default_xattr_handler); 1015 + EXPORT_SYMBOL_GPL(nop_posix_acl_default); 1004 1016 1005 1017 int simple_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, 1006 1018 struct posix_acl *acl, int type)
+3 -2
include/linux/posix_acl_xattr.h
··· 68 68 return -1; 69 69 } 70 70 71 - extern const struct xattr_handler posix_acl_access_xattr_handler; 72 - extern const struct xattr_handler posix_acl_default_xattr_handler; 71 + /* These are legacy handlers. Don't use them for new code. */ 72 + extern const struct xattr_handler nop_posix_acl_access; 73 + extern const struct xattr_handler nop_posix_acl_default; 73 74 74 75 #endif /* _POSIX_ACL_XATTR_H */