[v5,13/14] ceph: pass idmap to ceph_open/ioctl_set_layout
Commit Message
Pass an idmapping to:
- ceph_open
- ceph_ioctl_set_layout
Cc: Xiubo Li <xiubli@redhat.com>
Cc: Jeff Layton <jlayton@kernel.org>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: brauner@kernel.org
Cc: ceph-devel@vger.kernel.org
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
---
fs/ceph/file.c | 2 ++
fs/ceph/ioctl.c | 3 +++
2 files changed, 5 insertions(+)
@@ -356,6 +356,7 @@ int ceph_open(struct inode *inode, struct file *file)
struct ceph_mds_client *mdsc = fsc->mdsc;
struct ceph_mds_request *req;
struct ceph_file_info *fi = file->private_data;
+ struct mnt_idmap *idmap = file_mnt_idmap(file);
int err;
int flags, fmode, wanted;
@@ -426,6 +427,7 @@ int ceph_open(struct inode *inode, struct file *file)
ihold(inode);
req->r_num_caps = 1;
+ req->r_mnt_idmap = mnt_idmap_get(idmap);
err = ceph_mdsc_do_request(mdsc, NULL, req);
if (!err)
err = ceph_init_file(inode, file, req->r_fmode);
@@ -113,6 +113,7 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg)
req->r_inode = inode;
ihold(inode);
req->r_num_caps = 1;
+ req->r_mnt_idmap = mnt_idmap_get(idmap);
req->r_inode_drop = CEPH_CAP_FILE_SHARED | CEPH_CAP_FILE_EXCL;
@@ -138,6 +139,7 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg)
static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg)
{
struct inode *inode = file_inode(file);
+ struct mnt_idmap *idmap = file_mnt_idmap(file);
struct ceph_mds_request *req;
struct ceph_ioctl_layout l;
int err;
@@ -159,6 +161,7 @@ static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg)
req->r_inode = inode;
ihold(inode);
req->r_num_caps = 1;
+ req->r_mnt_idmap = mnt_idmap_get(idmap);
req->r_args.setlayout.layout.fl_stripe_unit =
cpu_to_le32(l.stripe_unit);