Skip to content

Commit 79c66a0

Browse files
mihalicynidryomov
authored andcommitted
ceph: pass idmap to __ceph_setattr
Just pass down the mount's idmapping to __ceph_setattr, because we will need it later. Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com> Acked-by: Christian Brauner <brauner@kernel.org> Reviewed-by: Xiubo Li <xiubli@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
1 parent 8995375 commit 79c66a0

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

fs/ceph/acl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ int ceph_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
142142
newattrs.ia_ctime = current_time(inode);
143143
newattrs.ia_mode = new_mode;
144144
newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
145-
ret = __ceph_setattr(inode, &newattrs, NULL);
145+
ret = __ceph_setattr(idmap, inode, &newattrs, NULL);
146146
if (ret)
147147
goto out_free;
148148
}
@@ -153,7 +153,7 @@ int ceph_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
153153
newattrs.ia_ctime = old_ctime;
154154
newattrs.ia_mode = old_mode;
155155
newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
156-
__ceph_setattr(inode, &newattrs, NULL);
156+
__ceph_setattr(idmap, inode, &newattrs, NULL);
157157
}
158158
goto out_free;
159159
}

fs/ceph/crypto.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static int ceph_crypt_set_context(struct inode *inode, const void *ctx,
113113

114114
cia.fscrypt_auth = cfa;
115115

116-
ret = __ceph_setattr(inode, &attr, &cia);
116+
ret = __ceph_setattr(&nop_mnt_idmap, inode, &attr, &cia);
117117
if (ret == 0)
118118
inode_set_flags(inode, S_ENCRYPTED, S_ENCRYPTED);
119119
kfree(cia.fscrypt_auth);

fs/ceph/inode.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2457,8 +2457,8 @@ static int fill_fscrypt_truncate(struct inode *inode,
24572457
return ret;
24582458
}
24592459

2460-
int __ceph_setattr(struct inode *inode, struct iattr *attr,
2461-
struct ceph_iattr *cia)
2460+
int __ceph_setattr(struct mnt_idmap *idmap, struct inode *inode,
2461+
struct iattr *attr, struct ceph_iattr *cia)
24622462
{
24632463
struct ceph_inode_info *ci = ceph_inode(inode);
24642464
unsigned int ia_valid = attr->ia_valid;
@@ -2811,7 +2811,7 @@ int ceph_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
28112811
ceph_quota_is_max_bytes_exceeded(inode, attr->ia_size))
28122812
return -EDQUOT;
28132813

2814-
err = __ceph_setattr(inode, attr, NULL);
2814+
err = __ceph_setattr(idmap, inode, attr, NULL);
28152815

28162816
if (err >= 0 && (attr->ia_valid & ATTR_MODE))
28172817
err = posix_acl_chmod(&nop_mnt_idmap, dentry, attr->ia_mode);

fs/ceph/super.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,8 +1100,8 @@ struct ceph_iattr {
11001100
struct ceph_fscrypt_auth *fscrypt_auth;
11011101
};
11021102

1103-
extern int __ceph_setattr(struct inode *inode, struct iattr *attr,
1104-
struct ceph_iattr *cia);
1103+
extern int __ceph_setattr(struct mnt_idmap *idmap, struct inode *inode,
1104+
struct iattr *attr, struct ceph_iattr *cia);
11051105
extern int ceph_setattr(struct mnt_idmap *idmap,
11061106
struct dentry *dentry, struct iattr *attr);
11071107
extern int ceph_getattr(struct mnt_idmap *idmap,

0 commit comments

Comments
 (0)