Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8340f22c authored by Jeff Layton's avatar Jeff Layton Committed by Ilya Dryomov
Browse files

ceph: move wait for mds request into helper function

parent 86bda539
Loading
Loading
Loading
Loading
+21 −15
Original line number Diff line number Diff line
@@ -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,
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;
}