diff options
author | Jeff Layton <jlayton@kernel.org> | 2019-04-02 12:34:38 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2019-05-07 19:22:38 +0200 |
commit | 8340f22ce50c7c2f9b05e0875891dcc44232dce4 (patch) | |
tree | 3f8f9fe0aec544471c5a37fb16ff0789a0057d37 | |
parent | 86bda539fa90184ca404afb38cd015416bf81d15 (diff) | |
download | linux-8340f22ce50c7c2f9b05e0875891dcc44232dce4.tar.gz linux-8340f22ce50c7c2f9b05e0875891dcc44232dce4.tar.bz2 linux-8340f22ce50c7c2f9b05e0875891dcc44232dce4.zip |
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.c | 36 |
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, 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) { @@ -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; } |