Skip to content

Commit

Permalink
ceph: move wait for mds request into helper function
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
  • Loading branch information
Jeff Layton authored and Ilya Dryomov committed May 7, 2019
1 parent 86bda53 commit 8340f22
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions fs/ceph/mds_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -2649,23 +2649,11 @@ int ceph_mdsc_submit_request(struct ceph_mds_client *mdsc, struct inode *dir,
return err;
}

/*
* Synchrously perform an mds request. Take care of all of the
* session setup, forwarding, retry details.
*/
int ceph_mdsc_do_request(struct ceph_mds_client *mdsc,
struct inode *dir,
struct ceph_mds_request *req)
static int ceph_mdsc_wait_request(struct ceph_mds_client *mdsc,
struct ceph_mds_request *req)
{
int err;

dout("do_request on %p\n", req);

/* issue */
err = ceph_mdsc_submit_request(mdsc, dir, req);
if (err)
goto out;

/* wait */
dout("do_request waiting\n");
if (!req->r_timeout && req->r_wait_for_completion) {
Expand Down Expand Up @@ -2708,7 +2696,25 @@ int ceph_mdsc_do_request(struct ceph_mds_client *mdsc,
}

mutex_unlock(&mdsc->mutex);
out:
return err;
}

/*
* Synchrously perform an mds request. Take care of all of the
* session setup, forwarding, retry details.
*/
int ceph_mdsc_do_request(struct ceph_mds_client *mdsc,
struct inode *dir,
struct ceph_mds_request *req)
{
int err;

dout("do_request on %p\n", req);

/* issue */
err = ceph_mdsc_submit_request(mdsc, dir, req);
if (!err)
err = ceph_mdsc_wait_request(mdsc, req);
dout("do_request %p done, result %d\n", req, err);
return err;
}
Expand Down

0 comments on commit 8340f22

Please sign in to comment.