Skip to content

Commit

Permalink
fs: drop unused posix acl handlers
Browse files Browse the repository at this point in the history
Remove struct posix_acl_{access,default}_handler for all filesystems
that don't depend on the xattr handler in their inode->i_op->listxattr()
method in any way. There's nothing more to do than to simply remove the
handler. It's been effectively unused ever since we introduced the new
posix acl api.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
  • Loading branch information
brauner committed Mar 6, 2023
1 parent 831be97 commit 0c95c02
Show file tree
Hide file tree
Showing 21 changed files with 0 additions and 80 deletions.
4 changes: 0 additions & 4 deletions fs/9p/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ static struct xattr_handler v9fs_xattr_security_handler = {
const struct xattr_handler *v9fs_xattr_handlers[] = {
&v9fs_xattr_user_handler,
&v9fs_xattr_trusted_handler,
#ifdef CONFIG_FS_POSIX_ACL
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
#endif
#ifdef CONFIG_9P_FS_SECURITY
&v9fs_xattr_security_handler,
#endif
Expand Down
4 changes: 0 additions & 4 deletions fs/btrfs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,6 @@ static const struct xattr_handler btrfs_btrfs_xattr_handler = {

const struct xattr_handler *btrfs_xattr_handlers[] = {
&btrfs_security_xattr_handler,
#ifdef CONFIG_BTRFS_FS_POSIX_ACL
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
#endif
&btrfs_trusted_xattr_handler,
&btrfs_user_xattr_handler,
&btrfs_btrfs_xattr_handler,
Expand Down
4 changes: 0 additions & 4 deletions fs/ceph/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1411,10 +1411,6 @@ void ceph_release_acl_sec_ctx(struct ceph_acl_sec_ctx *as_ctx)
* attributes are handled directly.
*/
const struct xattr_handler *ceph_xattr_handlers[] = {
#ifdef CONFIG_CEPH_FS_POSIX_ACL
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
#endif
&ceph_other_xattr_handler,
NULL,
};
4 changes: 0 additions & 4 deletions fs/cifs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,5 @@ const struct xattr_handler *cifs_xattr_handlers[] = {
&smb3_ntsd_xattr_handler, /* alias for above since avoiding "cifs" */
&cifs_cifs_ntsd_full_xattr_handler,
&smb3_ntsd_full_xattr_handler, /* alias for above since avoiding "cifs" */
#ifdef CONFIG_FS_POSIX_ACL
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
#endif
NULL
};
4 changes: 0 additions & 4 deletions fs/ecryptfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1210,10 +1210,6 @@ static const struct xattr_handler ecryptfs_xattr_handler = {
};

const struct xattr_handler *ecryptfs_xattr_handlers[] = {
#ifdef CONFIG_FS_POSIX_ACL
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
#endif
&ecryptfs_xattr_handler,
NULL
};
4 changes: 0 additions & 4 deletions fs/erofs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,6 @@ const struct xattr_handler __maybe_unused erofs_xattr_security_handler = {

const struct xattr_handler *erofs_xattr_handlers[] = {
&erofs_xattr_user_handler,
#ifdef CONFIG_EROFS_FS_POSIX_ACL
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
#endif
&erofs_xattr_trusted_handler,
#ifdef CONFIG_EROFS_FS_SECURITY
&erofs_xattr_security_handler,
Expand Down
4 changes: 0 additions & 4 deletions fs/ext2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ static const struct xattr_handler *ext2_xattr_handler_map[] = {
const struct xattr_handler *ext2_xattr_handlers[] = {
&ext2_xattr_user_handler,
&ext2_xattr_trusted_handler,
#ifdef CONFIG_EXT2_FS_POSIX_ACL
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
#endif
#ifdef CONFIG_EXT2_FS_SECURITY
&ext2_xattr_security_handler,
#endif
Expand Down
4 changes: 0 additions & 4 deletions fs/ext4/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ static const struct xattr_handler * const ext4_xattr_handler_map[] = {
const struct xattr_handler *ext4_xattr_handlers[] = {
&ext4_xattr_user_handler,
&ext4_xattr_trusted_handler,
#ifdef CONFIG_EXT4_FS_POSIX_ACL
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
#endif
#ifdef CONFIG_EXT4_FS_SECURITY
&ext4_xattr_security_handler,
#endif
Expand Down
4 changes: 0 additions & 4 deletions fs/f2fs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,6 @@ static const struct xattr_handler *f2fs_xattr_handler_map[] = {

const struct xattr_handler *f2fs_xattr_handlers[] = {
&f2fs_xattr_user_handler,
#ifdef CONFIG_F2FS_FS_POSIX_ACL
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
#endif
&f2fs_xattr_trusted_handler,
#ifdef CONFIG_F2FS_FS_SECURITY
&f2fs_xattr_security_handler,
Expand Down
2 changes: 0 additions & 2 deletions fs/gfs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1501,8 +1501,6 @@ const struct xattr_handler *gfs2_xattr_handlers_max[] = {
/* GFS2_FS_FORMAT_MIN */
&gfs2_xattr_user_handler,
&gfs2_xattr_security_handler,
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
NULL,
};

Expand Down
4 changes: 0 additions & 4 deletions fs/jffs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,10 +919,6 @@ const struct xattr_handler *jffs2_xattr_handlers[] = {
&jffs2_user_xattr_handler,
#ifdef CONFIG_JFFS2_FS_SECURITY
&jffs2_security_xattr_handler,
#endif
#ifdef CONFIG_JFFS2_FS_POSIX_ACL
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
#endif
&jffs2_trusted_xattr_handler,
NULL
Expand Down
4 changes: 0 additions & 4 deletions fs/jfs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -986,10 +986,6 @@ static const struct xattr_handler jfs_trusted_xattr_handler = {
};

const struct xattr_handler *jfs_xattr_handlers[] = {
#ifdef CONFIG_JFS_POSIX_ACL
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
#endif
&jfs_os2_xattr_handler,
&jfs_user_xattr_handler,
&jfs_security_xattr_handler,
Expand Down
1 change: 0 additions & 1 deletion fs/nfs/nfs3_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ extern int nfs3_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
extern int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,
struct posix_acl *dfacl);
extern ssize_t nfs3_listxattr(struct dentry *, char *, size_t);
extern const struct xattr_handler *nfs3_xattr_handlers[];
#else
static inline int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,
struct posix_acl *dfacl)
Expand Down
6 changes: 0 additions & 6 deletions fs/nfs/nfs3acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,6 @@ int nfs3_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
goto out;
}

const struct xattr_handler *nfs3_xattr_handlers[] = {
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
NULL,
};

static int
nfs3_list_one_acl(struct inode *inode, int type, const char *name, void *data,
size_t size, ssize_t *result)
Expand Down
3 changes: 0 additions & 3 deletions fs/nfs/nfs3super.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ struct nfs_subversion nfs_v3 = {
.rpc_vers = &nfs_version3,
.rpc_ops = &nfs_v3_clientops,
.sops = &nfs_sops,
#ifdef CONFIG_NFS_V3_ACL
.xattr = nfs3_xattr_handlers,
#endif
};

static int __init init_nfs_v3(void)
Expand Down
4 changes: 0 additions & 4 deletions fs/ntfs3/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,10 +1033,6 @@ static const struct xattr_handler ntfs_other_xattr_handler = {
};

const struct xattr_handler *ntfs_xattr_handlers[] = {
#ifdef CONFIG_NTFS3_FS_POSIX_ACL
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
#endif
&ntfs_other_xattr_handler,
NULL,
};
Expand Down
2 changes: 0 additions & 2 deletions fs/ocfs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ static struct ocfs2_xattr_def_value_root def_xv = {

const struct xattr_handler *ocfs2_xattr_handlers[] = {
&ocfs2_xattr_user_handler,
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
&ocfs2_xattr_trusted_handler,
&ocfs2_xattr_security_handler,
NULL
Expand Down
2 changes: 0 additions & 2 deletions fs/orangefs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,6 @@ static const struct xattr_handler orangefs_xattr_default_handler = {
};

const struct xattr_handler *orangefs_xattr_handlers[] = {
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
&orangefs_xattr_default_handler,
NULL
};
8 changes: 0 additions & 8 deletions fs/overlayfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1055,20 +1055,12 @@ static const struct xattr_handler ovl_other_xattr_handler = {
};

static const struct xattr_handler *ovl_trusted_xattr_handlers[] = {
#ifdef CONFIG_FS_POSIX_ACL
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
#endif
&ovl_own_trusted_xattr_handler,
&ovl_other_xattr_handler,
NULL
};

static const struct xattr_handler *ovl_user_xattr_handlers[] = {
#ifdef CONFIG_FS_POSIX_ACL
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
#endif
&ovl_own_user_xattr_handler,
&ovl_other_xattr_handler,
NULL
Expand Down
4 changes: 0 additions & 4 deletions fs/xfs/xfs_xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,6 @@ const struct xattr_handler *xfs_xattr_handlers[] = {
&xfs_xattr_user_handler,
&xfs_xattr_trusted_handler,
&xfs_xattr_security_handler,
#ifdef CONFIG_XFS_POSIX_ACL
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
#endif
NULL
};

Expand Down
4 changes: 0 additions & 4 deletions mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -3339,10 +3339,6 @@ static const struct xattr_handler shmem_trusted_xattr_handler = {
};

static const struct xattr_handler *shmem_xattr_handlers[] = {
#ifdef CONFIG_TMPFS_POSIX_ACL
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
#endif
&shmem_security_xattr_handler,
&shmem_trusted_xattr_handler,
NULL
Expand Down

0 comments on commit 0c95c02

Please sign in to comment.