fs: port ->set_acl() to pass const mnt_idmap

Convert to const struct mnt_idmap.

A mount's idmapping is immutable. The only thing that is allowed to be
modified afterwards is the reference count and that is hidden behind
mnt_idmap_get() and mnt_idmap_put(). Everything else only ever reads
from the idmapping. This is the same model that struct cred uses and the
idmapping is also rather sensitive.

So make the idmap argument const wherever we can. The conversion is done
from the bottom up so callers can continue to pass a non-const pointer
to a const parameter until the conversion is finished.

No functional changes.

Link: https://patch.msgid.link/20260901-work-idmap-const-v1-15-54ccd48e100b@kernel.org
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Seth Forshee <sforshee@kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
This commit is contained in:
Christian Brauner 2026-09-01 14:14:40 +02:00
parent 51e7cfbd10
commit 737362c701
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2
48 changed files with 67 additions and 67 deletions

View File

@ -440,7 +440,7 @@ As of kernel 2.6.22, the following members are defined:
unsigned open_flag, umode_t create_mode);
int (*tmpfile) (struct mnt_idmap *, struct inode *, struct file *, umode_t);
struct posix_acl * (*get_acl)(struct mnt_idmap *, struct dentry *, int);
int (*set_acl)(struct mnt_idmap *, struct dentry *, struct posix_acl *, int);
int (*set_acl)(const struct mnt_idmap *, struct dentry *, struct posix_acl *, int);
int (*fileattr_set)(const struct mnt_idmap *idmap,
struct dentry *dentry, struct file_kattr *fa);
int (*fileattr_get)(struct dentry *dentry, struct file_kattr *fa);

View File

@ -152,7 +152,7 @@ struct posix_acl *v9fs_iop_get_acl(struct mnt_idmap *idmap,
return v9fs_get_cached_acl(d_inode(dentry), type);
}
int v9fs_iop_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int v9fs_iop_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
int retval;

View File

@ -12,7 +12,7 @@ struct posix_acl *v9fs_iop_get_inode_acl(struct inode *inode, int type,
bool rcu);
struct posix_acl *v9fs_iop_get_acl(struct mnt_idmap *idmap,
struct dentry *dentry, int type);
int v9fs_iop_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int v9fs_iop_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type);
int v9fs_acl_chmod(struct inode *inode, struct p9_fid *fid);
int v9fs_set_create_acl(struct inode *inode, struct p9_fid *fid,

View File

@ -153,7 +153,7 @@ static int bad_inode_tmpfile(struct mnt_idmap *idmap,
return -EIO;
}
static int bad_inode_set_acl(struct mnt_idmap *idmap,
static int bad_inode_set_acl(const struct mnt_idmap *idmap,
struct dentry *dentry, struct posix_acl *acl,
int type)
{

View File

@ -101,7 +101,7 @@ int __btrfs_set_acl(struct btrfs_trans_handle *trans, struct inode *inode,
return 0;
}
int btrfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int btrfs_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
int ret;

View File

@ -15,7 +15,7 @@ struct mnt_idmap;
struct dentry;
struct posix_acl *btrfs_get_acl(struct inode *inode, int type, bool rcu);
int btrfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int btrfs_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type);
int __btrfs_set_acl(struct btrfs_trans_handle *trans, struct inode *inode,
struct posix_acl *acl, int type);

View File

@ -87,7 +87,7 @@ struct posix_acl *ceph_get_acl(struct inode *inode, int type, bool rcu)
return acl;
}
int ceph_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int ceph_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
int ret = 0;

View File

@ -1252,7 +1252,7 @@ void ceph_release_acl_sec_ctx(struct ceph_acl_sec_ctx *as_ctx);
#ifdef CONFIG_CEPH_FS_POSIX_ACL
struct posix_acl *ceph_get_acl(struct inode *, int, bool);
int ceph_set_acl(struct mnt_idmap *idmap,
int ceph_set_acl(const struct mnt_idmap *idmap,
struct dentry *dentry, struct posix_acl *acl, int type);
int ceph_pre_init_acls(struct inode *dir, umode_t *mode,
struct ceph_acl_sec_ctx *as_ctx);

View File

@ -1097,7 +1097,7 @@ static struct posix_acl *ecryptfs_get_acl(struct mnt_idmap *idmap,
posix_acl_xattr_name(type));
}
static int ecryptfs_set_acl(struct mnt_idmap *idmap,
static int ecryptfs_set_acl(const struct mnt_idmap *idmap,
struct dentry *dentry, struct posix_acl *acl,
int type)
{

View File

@ -219,7 +219,7 @@ __ext2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
* inode->i_mutex: down
*/
int
ext2_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
ext2_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
int error;

View File

@ -56,7 +56,7 @@ static inline int ext2_acl_count(size_t size)
/* acl.c */
extern struct posix_acl *ext2_get_acl(struct inode *inode, int type, bool rcu);
extern int ext2_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
extern int ext2_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type);
extern int ext2_init_acl (struct inode *, struct inode *);

View File

@ -225,7 +225,7 @@ __ext4_set_acl(handle_t *handle, struct inode *inode, int type,
}
int
ext4_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
ext4_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
handle_t *handle;

View File

@ -56,7 +56,7 @@ static inline int ext4_acl_count(size_t size)
/* acl.c */
struct posix_acl *ext4_get_acl(struct inode *inode, int type, bool rcu);
int ext4_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int ext4_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type);
extern int ext4_init_acl(handle_t *, struct inode *, struct inode *);

View File

@ -289,7 +289,7 @@ static int __f2fs_set_acl(const struct mnt_idmap *idmap,
return error;
}
int f2fs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int f2fs_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
struct inode *inode = d_inode(dentry);

View File

@ -34,7 +34,7 @@ struct f2fs_acl_header {
#ifdef CONFIG_F2FS_FS_POSIX_ACL
struct posix_acl *f2fs_get_acl(struct inode *, int, bool);
int f2fs_set_acl(struct mnt_idmap *, struct dentry *,
int f2fs_set_acl(const struct mnt_idmap *, struct dentry *,
struct posix_acl *, int);
int f2fs_init_acl(struct inode *, struct inode *, struct folio *ifolio,
struct folio *dfolio);

View File

@ -90,7 +90,7 @@ struct posix_acl *fuse_get_inode_acl(struct inode *inode, int type, bool rcu)
return __fuse_get_acl(fc, inode, type, rcu);
}
int fuse_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int fuse_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
struct inode *inode = d_inode(dentry);

View File

@ -1207,7 +1207,7 @@ struct posix_acl;
struct posix_acl *fuse_get_inode_acl(struct inode *inode, int type, bool rcu);
struct posix_acl *fuse_get_acl(struct mnt_idmap *idmap,
struct dentry *dentry, int type);
int fuse_set_acl(struct mnt_idmap *, struct dentry *dentry,
int fuse_set_acl(const struct mnt_idmap *, struct dentry *dentry,
struct posix_acl *acl, int type);
/* readdir.c */

View File

@ -102,7 +102,7 @@ int __gfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
return error;
}
int gfs2_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int gfs2_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
struct inode *inode = d_inode(dentry);

View File

@ -13,7 +13,7 @@
struct posix_acl *gfs2_get_acl(struct inode *inode, int type, bool rcu);
int __gfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type);
int gfs2_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int gfs2_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type);
#endif /* __ACL_DOT_H__ */

View File

@ -302,12 +302,12 @@ int import_xattr_name(struct xattr_name *kname, const char __user *name);
int may_write_xattr(const struct mnt_idmap *idmap, struct inode *inode);
#ifdef CONFIG_FS_POSIX_ACL
int do_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int do_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
const char *acl_name, const void *kvalue, size_t size);
ssize_t do_get_acl(struct mnt_idmap *idmap, struct dentry *dentry,
const char *acl_name, void *kvalue, size_t size);
#else
static inline int do_set_acl(struct mnt_idmap *idmap,
static inline int do_set_acl(const struct mnt_idmap *idmap,
struct dentry *dentry, const char *acl_name,
const void *kvalue, size_t size)
{

View File

@ -228,7 +228,7 @@ static int __jffs2_set_acl(struct inode *inode, int xprefix, struct posix_acl *a
return rc;
}
int jffs2_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int jffs2_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
int rc, xprefix;

View File

@ -28,7 +28,7 @@ struct jffs2_acl_header {
#ifdef CONFIG_JFFS2_FS_POSIX_ACL
struct posix_acl *jffs2_get_acl(struct inode *inode, int type, bool rcu);
int jffs2_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int jffs2_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type);
extern int jffs2_init_acl_pre(struct inode *, struct inode *, umode_t *);
extern int jffs2_init_acl_post(struct inode *);

View File

@ -89,7 +89,7 @@ static int __jfs_set_acl(tid_t tid, struct inode *inode, int type,
return rc;
}
int jfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int jfs_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
int rc;

View File

@ -8,7 +8,7 @@
#ifdef CONFIG_JFS_POSIX_ACL
struct posix_acl *jfs_get_acl(struct inode *inode, int type, bool rcu);
int jfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int jfs_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type);
int jfs_init_acl(tid_t, struct inode *, struct inode *);

View File

@ -12,7 +12,7 @@
*/
#ifdef CONFIG_NFS_V3_ACL
extern struct posix_acl *nfs3_get_acl(struct inode *inode, int type, bool rcu);
extern int nfs3_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
extern int nfs3_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type);
extern int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,
struct posix_acl *dfacl);

View File

@ -254,7 +254,7 @@ int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,
}
int nfs3_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int nfs3_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
struct posix_acl *orig = acl, *dfacl = NULL, *alloc;

View File

@ -1080,7 +1080,7 @@ static noinline int ntfs_set_acl_ex(const struct mnt_idmap *idmap,
return err;
}
int ntfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int ntfs_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
return ntfs_set_acl_ex(idmap, d_inode(dentry), acl, type, false);

View File

@ -19,7 +19,7 @@ ssize_t ntfs_listxattr(struct dentry *dentry, char *buffer, size_t size);
#ifdef CONFIG_NTFS_FS_POSIX_ACL
struct posix_acl *ntfs_get_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int type);
int ntfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int ntfs_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type);
int ntfs_init_acl(const struct mnt_idmap *idmap, struct inode *inode,
struct inode *dir);

View File

@ -965,7 +965,7 @@ unsigned long ntfs_names_hash(const u16 *name, size_t len, const u16 *upcase,
#ifdef CONFIG_NTFS3_FS_POSIX_ACL
struct posix_acl *ntfs_get_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int type);
int ntfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int ntfs_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type);
int ntfs_init_acl(const struct mnt_idmap *idmap, struct inode *inode,
struct inode *dir);
@ -974,7 +974,7 @@ int ntfs_init_acl(const struct mnt_idmap *idmap, struct inode *inode,
#define ntfs_set_acl NULL
#endif
int ntfs_acl_chmod(struct mnt_idmap *idmap, struct dentry *dentry);
int ntfs_acl_chmod(const struct mnt_idmap *idmap, struct dentry *dentry);
ssize_t ntfs_listxattr(struct dentry *dentry, char *buffer, size_t size);
extern const struct xattr_handler *const ntfs_xattr_handlers[];

View File

@ -677,7 +677,7 @@ static noinline int ntfs_set_acl_ex(const struct mnt_idmap *idmap,
/*
* ntfs_set_acl - inode_operations::set_acl
*/
int ntfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int ntfs_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
return ntfs_set_acl_ex(idmap, d_inode(dentry), acl, type, false);
@ -722,7 +722,7 @@ int ntfs_init_acl(const struct mnt_idmap *idmap, struct inode *inode,
/*
* ntfs_acl_chmod - Helper for ntfs_setattr().
*/
int ntfs_acl_chmod(struct mnt_idmap *idmap, struct dentry *dentry)
int ntfs_acl_chmod(const struct mnt_idmap *idmap, struct dentry *dentry)
{
struct inode *inode = d_inode(dentry);
struct super_block *sb = inode->i_sb;

View File

@ -260,7 +260,7 @@ static int ocfs2_set_acl(handle_t *handle,
return ret;
}
int ocfs2_iop_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int ocfs2_iop_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
struct buffer_head *bh = NULL;

View File

@ -17,7 +17,7 @@ struct ocfs2_acl_entry {
};
struct posix_acl *ocfs2_iop_get_acl(struct inode *inode, int type, bool rcu);
int ocfs2_iop_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int ocfs2_iop_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type);
extern int ocfs2_acl_chmod(struct inode *, struct buffer_head *);
struct ocfs2_acl_state {

View File

@ -112,7 +112,7 @@ int __orangefs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
return error;
}
int orangefs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int orangefs_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
int error;

View File

@ -98,7 +98,7 @@ enum orangefs_vfs_op_states {
extern const struct xattr_handler * const orangefs_xattr_handlers[];
extern struct posix_acl *orangefs_get_acl(struct inode *inode, int type, bool rcu);
extern int orangefs_set_acl(struct mnt_idmap *idmap,
extern int orangefs_set_acl(const struct mnt_idmap *idmap,
struct dentry *dentry, struct posix_acl *acl,
int type);
int __orangefs_set_acl(struct inode *inode, struct posix_acl *acl, int type);

View File

@ -536,7 +536,7 @@ static int ovl_set_or_remove_acl(struct dentry *dentry, struct inode *inode,
return err;
}
int ovl_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int ovl_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
int err;

View File

@ -819,7 +819,7 @@ static inline struct posix_acl *ovl_get_acl(struct mnt_idmap *idmap,
{
return do_ovl_get_acl(idmap, d_inode(dentry), type, false, false);
}
int ovl_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int ovl_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type);
struct posix_acl *ovl_get_acl_path(const struct path *path,
const char *acl_name, bool noperm);

View File

@ -608,7 +608,7 @@ EXPORT_SYMBOL(__posix_acl_chmod);
* performed on the raw inode simply pass @nop_mnt_idmap.
*/
int
posix_acl_chmod(struct mnt_idmap *idmap, struct dentry *dentry,
posix_acl_chmod(const struct mnt_idmap *idmap, struct dentry *dentry,
umode_t mode)
{
struct inode *inode = d_inode(dentry);
@ -937,7 +937,7 @@ static ssize_t vfs_posix_acl_to_xattr(const struct mnt_idmap *idmap,
}
int
set_posix_acl(struct mnt_idmap *idmap, struct dentry *dentry,
set_posix_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
int type, struct posix_acl *acl)
{
struct inode *inode = d_inode(dentry);
@ -1018,7 +1018,7 @@ const struct xattr_handler nop_posix_acl_default = {
};
EXPORT_SYMBOL_GPL(nop_posix_acl_default);
int simple_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int simple_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
int error;
@ -1091,7 +1091,7 @@ static int vfs_set_acl_idmapped_mnt(const struct mnt_idmap *idmap,
*
* Return: On success 0, on error negative errno.
*/
int vfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int vfs_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
const char *acl_name, struct posix_acl *kacl)
{
int acl_type;
@ -1212,7 +1212,7 @@ EXPORT_SYMBOL_GPL(vfs_get_acl);
*
* Return: On success 0, on error negative errno.
*/
int vfs_remove_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int vfs_remove_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
const char *acl_name)
{
int acl_type;
@ -1265,7 +1265,7 @@ int vfs_remove_acl(struct mnt_idmap *idmap, struct dentry *dentry,
}
EXPORT_SYMBOL_GPL(vfs_remove_acl);
int do_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int do_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
const char *acl_name, const void *kvalue, size_t size)
{
int error;

View File

@ -1931,7 +1931,7 @@ struct posix_acl *cifs_get_acl(struct mnt_idmap *idmap,
#endif
}
int cifs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int cifs_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
#if defined(CONFIG_CIFS_ALLOW_INSECURE_LEGACY) && defined(CONFIG_CIFS_POSIX)

View File

@ -214,7 +214,7 @@ struct smb_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb,
u32 *pacllen, u32 info);
struct posix_acl *cifs_get_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int type);
int cifs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int cifs_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type);
int set_cifs_acl(struct smb_ntsd *pnntsd, __u32 acllen, struct inode *inode,
const char *path, int aclflag);

View File

@ -1471,7 +1471,7 @@ struct dentry *ksmbd_vfs_kern_path_create(struct ksmbd_work *work,
return dent;
}
int ksmbd_vfs_remove_acl_xattrs(struct mnt_idmap *idmap,
int ksmbd_vfs_remove_acl_xattrs(const struct mnt_idmap *idmap,
const struct path *path)
{
char *name, *xattr_list = NULL;
@ -2200,7 +2200,7 @@ void ksmbd_vfs_posix_lock_unblock(struct file_lock *flock)
locks_delete_block(flock);
}
int ksmbd_vfs_set_init_posix_acl(struct mnt_idmap *idmap,
int ksmbd_vfs_set_init_posix_acl(const struct mnt_idmap *idmap,
const struct path *path)
{
struct posix_acl_state acl_state;

View File

@ -152,7 +152,7 @@ int ksmbd_vfs_fill_dentry_attrs(struct ksmbd_work *work,
struct ksmbd_kstat *ksmbd_kstat);
void ksmbd_vfs_posix_lock_wait(struct file_lock *flock);
void ksmbd_vfs_posix_lock_unblock(struct file_lock *flock);
int ksmbd_vfs_remove_acl_xattrs(struct mnt_idmap *idmap,
int ksmbd_vfs_remove_acl_xattrs(const struct mnt_idmap *idmap,
const struct path *path);
int ksmbd_vfs_remove_sd_xattrs(const struct mnt_idmap *idmap, const struct path *path);
int ksmbd_vfs_set_sd_xattr(struct ksmbd_conn *conn,
@ -171,7 +171,7 @@ int ksmbd_vfs_set_dos_attrib_xattr(const struct mnt_idmap *idmap,
int ksmbd_vfs_get_dos_attrib_xattr(const struct mnt_idmap *idmap,
struct dentry *dentry,
struct xattr_dos_attrib *da);
int ksmbd_vfs_set_init_posix_acl(struct mnt_idmap *idmap,
int ksmbd_vfs_set_init_posix_acl(const struct mnt_idmap *idmap,
const struct path *path);
int ksmbd_vfs_inherit_posix_acl(const struct mnt_idmap *idmap,
const struct path *path,

View File

@ -652,7 +652,7 @@ int setxattr_copy(const char __user *name, struct kernel_xattr_ctx *ctx)
return error;
}
static int do_setxattr(struct mnt_idmap *idmap, struct dentry *dentry,
static int do_setxattr(const struct mnt_idmap *idmap, struct dentry *dentry,
struct kernel_xattr_ctx *ctx)
{
if (is_posix_acl_xattr(ctx->kname->name))
@ -1029,7 +1029,7 @@ SYSCALL_DEFINE3(flistxattr, int, fd, char __user *, list, size_t, size)
* Extended attribute REMOVE operations
*/
static long
removexattr(struct mnt_idmap *idmap, struct dentry *d, const char *name)
removexattr(const struct mnt_idmap *idmap, struct dentry *d, const char *name)
{
if (is_posix_acl_xattr(name))
return vfs_remove_acl(idmap, d, name);

View File

@ -243,7 +243,7 @@ xfs_acl_set_mode(
}
int
xfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
xfs_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type)
{
umode_t mode;

View File

@ -11,7 +11,7 @@ struct posix_acl;
#ifdef CONFIG_XFS_POSIX_ACL
extern struct posix_acl *xfs_get_acl(struct inode *inode, int type, bool rcu);
extern int xfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
extern int xfs_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type);
extern int __xfs_set_acl(struct inode *inode, struct posix_acl *acl, int type);
void xfs_forget_acl(struct inode *inode, const char *name);

View File

@ -777,7 +777,7 @@ xfs_vn_change_ok(
*/
static int
xfs_setattr_nonsize(
struct mnt_idmap *idmap,
const struct mnt_idmap *idmap,
struct dentry *dentry,
struct xfs_inode *ip,
struct iattr *iattr)
@ -903,7 +903,7 @@ xfs_setattr_nonsize(
*/
int
xfs_vn_setattr_size(
struct mnt_idmap *idmap,
const struct mnt_idmap *idmap,
struct dentry *dentry,
struct iattr *iattr)
{

View File

@ -10,7 +10,7 @@ struct xfs_inode;
extern ssize_t xfs_vn_listxattr(struct dentry *, char *data, size_t size);
int xfs_vn_setattr_size(struct mnt_idmap *idmap,
int xfs_vn_setattr_size(const struct mnt_idmap *idmap,
struct dentry *dentry, struct iattr *vap);
int xfs_inode_init_security(struct inode *inode, struct inode *dir,

View File

@ -2028,7 +2028,7 @@ struct inode_operations {
struct file *, umode_t);
struct posix_acl *(*get_acl)(struct mnt_idmap *, struct dentry *,
int);
int (*set_acl)(struct mnt_idmap *, struct dentry *,
int (*set_acl)(const struct mnt_idmap *, struct dentry *,
struct posix_acl *, int);
int (*fileattr_set)(const struct mnt_idmap *idmap,
struct dentry *dentry, struct file_kattr *fa);

View File

@ -74,20 +74,20 @@ extern int __posix_acl_create(struct posix_acl **, gfp_t, umode_t *);
extern int __posix_acl_chmod(struct posix_acl **, gfp_t, umode_t);
extern struct posix_acl *get_posix_acl(struct inode *, int);
int set_posix_acl(struct mnt_idmap *, struct dentry *, int,
int set_posix_acl(const struct mnt_idmap *, struct dentry *, int,
struct posix_acl *);
struct posix_acl *get_cached_acl_rcu(struct inode *inode, int type);
struct posix_acl *posix_acl_clone(const struct posix_acl *acl, gfp_t flags);
#ifdef CONFIG_FS_POSIX_ACL
int posix_acl_chmod(struct mnt_idmap *, struct dentry *, umode_t);
int posix_acl_chmod(const struct mnt_idmap *, struct dentry *, umode_t);
extern int posix_acl_create(struct inode *, umode_t *, struct posix_acl **,
struct posix_acl **);
int posix_acl_update_mode(const struct mnt_idmap *, struct inode *, umode_t *,
struct posix_acl **);
int simple_set_acl(struct mnt_idmap *, struct dentry *,
int simple_set_acl(const struct mnt_idmap *, struct dentry *,
struct posix_acl *, int);
extern int simple_acl_create(struct inode *, struct inode *);
@ -105,16 +105,16 @@ static inline void cache_no_acl(struct inode *inode)
inode->i_default_acl = NULL;
}
int vfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int vfs_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
const char *acl_name, struct posix_acl *kacl);
struct posix_acl *vfs_get_acl(struct mnt_idmap *idmap,
struct dentry *dentry, const char *acl_name);
int vfs_remove_acl(struct mnt_idmap *idmap, struct dentry *dentry,
int vfs_remove_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
const char *acl_name);
int posix_acl_listxattr(struct inode *inode, char **buffer,
ssize_t *remaining_size);
#else
static inline int posix_acl_chmod(struct mnt_idmap *idmap,
static inline int posix_acl_chmod(const struct mnt_idmap *idmap,
struct dentry *dentry, umode_t mode)
{
return 0;
@ -141,7 +141,7 @@ static inline void forget_all_cached_acls(struct inode *inode)
{
}
static inline int vfs_set_acl(struct mnt_idmap *idmap,
static inline int vfs_set_acl(const struct mnt_idmap *idmap,
struct dentry *dentry, const char *name,
struct posix_acl *acl)
{
@ -155,7 +155,7 @@ static inline struct posix_acl *vfs_get_acl(struct mnt_idmap *idmap,
return ERR_PTR(-EOPNOTSUPP);
}
static inline int vfs_remove_acl(struct mnt_idmap *idmap,
static inline int vfs_remove_acl(const struct mnt_idmap *idmap,
struct dentry *dentry, const char *acl_name)
{
return -EOPNOTSUPP;