aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2019-04-02 12:34:38 -0400
committerIlya Dryomov <idryomov@gmail.com>2019-05-07 13:22:38 -0400
commit8340f22ce50c7c2f9b05e0875891dcc44232dce4 (patch)
tree3f8f9fe0aec544471c5a37fb16ff0789a0057d37
parent86bda539fa90184ca404afb38cd015416bf81d15 (diff)
ceph: move wait for mds request into helper function
Signed-off-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
-rw-r--r--fs/ceph/mds_client.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index ffbb98fdc478..0026ca094e22 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -2649,23 +2649,11 @@ int ceph_mdsc_submit_request(struct ceph_mds_client *mdsc, struct inode *dir,
2649 return err; 2649 return err;
2650} 2650}
2651 2651
2652/* 2652static int ceph_mdsc_wait_request(struct ceph_mds_client *mdsc,
2653 * Synchrously perform an mds request. Take care of all of the 2653 struct ceph_mds_request *req)
2654 * session setup, forwarding, retry details.
2655 */
2656int ceph_mdsc_do_request(struct ceph_mds_client *mdsc,
2657 struct inode *dir,
2658 struct ceph_mds_request *req)
2659{ 2654{
2660 int err; 2655 int err;
2661 2656
2662 dout("do_request on %p\n", req);
2663
2664 /* issue */
2665 err = ceph_mdsc_submit_request(mdsc, dir, req);
2666 if (err)
2667 goto out;
2668
2669 /* wait */ 2657 /* wait */
2670 dout("do_request waiting\n"); 2658 dout("do_request waiting\n");
2671 if (!req->r_timeout && req->r_wait_for_completion) { 2659 if (!req->r_timeout && req->r_wait_for_completion) {
@@ -2708,7 +2696,25 @@ int ceph_mdsc_do_request(struct ceph_mds_client *mdsc,
2708 } 2696 }
2709 2697
2710 mutex_unlock(&mdsc->mutex); 2698 mutex_unlock(&mdsc->mutex);
2711out: 2699 return err;
2700}
2701
2702/*
2703 * Synchrously perform an mds request. Take care of all of the
2704 * session setup, forwarding, retry details.
2705 */
2706int ceph_mdsc_do_request(struct ceph_mds_client *mdsc,
2707 struct inode *dir,
2708 struct ceph_mds_request *req)
2709{
2710 int err;
2711
2712 dout("do_request on %p\n", req);
2713
2714 /* issue */
2715 err = ceph_mdsc_submit_request(mdsc, dir, req);
2716 if (!err)
2717 err = ceph_mdsc_wait_request(mdsc, req);
2712 dout("do_request %p done, result %d\n", req, err); 2718 dout("do_request %p done, result %d\n", req, err);
2713 return err; 2719 return err;
2714} 2720}