summaryrefslogtreecommitdiff
path: root/fs/ceph/locks.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2022-02-03 09:04:24 -0500
committerIlya Dryomov <idryomov@gmail.com>2022-03-01 18:26:36 +0100
commit9eaa7b79979f2cb1ac0508d413dc7f7664feb430 (patch)
tree26b0cc1650236673dc3986a7e5457eab5626932c /fs/ceph/locks.c
parent083db6fd3e73fc4f9ee74d2da1012a94216d6a60 (diff)
ceph: eliminate req->r_wait_for_completion from ceph_mds_request
...and instead just pass the wait function on the stack. Make ceph_mdsc_wait_request non-static, and add an argument for wait for completion. Then have ceph_lock_message call ceph_mdsc_submit_request, and ceph_mdsc_wait_request and pass in the pointer to ceph_lock_wait_for_completion. While we're in there, rearrange some fields in ceph_mds_request, so we save a total of 24 bytes per. Signed-off-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Xiubo Li <xiubli@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/locks.c')
-rw-r--r--fs/ceph/locks.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c
index d1f154aec249..3e2843e86e27 100644
--- a/fs/ceph/locks.c
+++ b/fs/ceph/locks.c
@@ -111,10 +111,10 @@ static int ceph_lock_message(u8 lock_type, u16 operation, struct inode *inode,
req->r_args.filelock_change.length = cpu_to_le64(length);
req->r_args.filelock_change.wait = wait;
- if (wait)
- req->r_wait_for_completion = ceph_lock_wait_for_completion;
-
- err = ceph_mdsc_do_request(mdsc, inode, req);
+ err = ceph_mdsc_submit_request(mdsc, inode, req);
+ if (!err)
+ err = ceph_mdsc_wait_request(mdsc, req, wait ?
+ ceph_lock_wait_for_completion : NULL);
if (!err && operation == CEPH_MDS_OP_GETFILELOCK) {
fl->fl_pid = -le64_to_cpu(req->r_reply_info.filelock_reply->pid);
if (CEPH_LOCK_SHARED == req->r_reply_info.filelock_reply->type)