summaryrefslogtreecommitdiffstats
path: root/fs/ceph/dir.c
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2015-05-19 12:05:38 +0300
committerIlya Dryomov <idryomov@gmail.com>2015-06-25 11:49:29 +0300
commit5be73034771c8f18b241f1974803865a4de2cad1 (patch)
tree01097353601c036d7dfef4ac15bf3d353e185607 /fs/ceph/dir.c
parent216639dd5091de4f4d7ad19b0b8dde11fad18286 (diff)
downloadop-kernel-dev-5be73034771c8f18b241f1974803865a4de2cad1.zip
op-kernel-dev-5be73034771c8f18b241f1974803865a4de2cad1.tar.gz
ceph: simplify two mount_timeout sites
No need to bifurcate wait now that we've got ceph_timeout_jiffies(). Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Alex Elder <elder@linaro.org> Reviewed-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/dir.c')
-rw-r--r--fs/ceph/dir.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 173dd4b..3dec27e 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -1257,17 +1257,11 @@ static int ceph_dir_fsync(struct file *file, loff_t start, loff_t end,
dout("dir_fsync %p wait on tid %llu (until %llu)\n",
inode, req->r_tid, last_tid);
- if (req->r_timeout) {
- unsigned long time_left = wait_for_completion_timeout(
- &req->r_safe_completion,
+ ret = !wait_for_completion_timeout(&req->r_safe_completion,
ceph_timeout_jiffies(req->r_timeout));
- if (time_left > 0)
- ret = 0;
- else
- ret = -EIO; /* timed out */
- } else {
- wait_for_completion(&req->r_safe_completion);
- }
+ if (ret)
+ ret = -EIO; /* timed out */
+
ceph_mdsc_put_request(req);
spin_lock(&ci->i_unsafe_lock);
OpenPOWER on IntegriCloud