[PATCH] ceph: return result directly from wait_for_completion_killable()

From: Qianqiang Liu
Date: Mon Oct 14 2024 - 07:12:06 EST


Simplify the code by returning the result of
wait_for_completion_killable() directly, instead of calling it
separately and then returning 0.

No functional changes are introduced, this is a simple refactor
to streamline the code.

Signed-off-by: Qianqiang Liu <qianqiang.liu@xxxxxxx>
---
fs/ceph/locks.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c
index ebf4ac0055dd..0d48a85f5397 100644
--- a/fs/ceph/locks.c
+++ b/fs/ceph/locks.c
@@ -221,8 +221,7 @@ static int ceph_lock_wait_for_completion(struct ceph_mds_client *mdsc,
if (err && err != -ERESTARTSYS)
return err;

- wait_for_completion_killable(&req->r_safe_completion);
- return 0;
+ return wait_for_completion_killable(&req->r_safe_completion);
}

static int try_unlock_file(struct file *file, struct file_lock *fl)
--
2.39.2 (Apple Git-143)