Whamcloud - gitweb
LU-6245 libcfs: replace IS_PO2 with is_power_of_2 in server code
[fs/lustre-release.git] / lustre / ofd / ofd_dev.c
index b5d8e74..137a05d 100644 (file)
@@ -23,7 +23,7 @@
  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, 2015, Intel Corporation.
+ * Copyright (c) 2012, 2016, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -2356,11 +2356,14 @@ static int ofd_quotactl(struct tgt_session_info *tsi)
 static inline int prolong_timeout(struct ptlrpc_request *req)
 {
        struct ptlrpc_service_part *svcpt = req->rq_rqbd->rqbd_svcpt;
+       time_t req_timeout;
 
        if (AT_OFF)
                return obd_timeout / 2;
 
-       return at_est2timeout(at_get(&svcpt->scp_at_estimate));
+       req_timeout = req->rq_deadline - req->rq_arrival_time.tv_sec;
+       return max_t(time_t, at_est2timeout(at_get(&svcpt->scp_at_estimate)),
+                    req_timeout);
 }
 
 /**
@@ -2981,7 +2984,7 @@ static int ofd_init0(const struct lu_env *env, struct ofd_device *m,
                CERROR("%s: can't get statfs data, rc %d\n", obd->obd_name, rc);
                GOTO(err_fini_stack, rc);
        }
-       if (!IS_PO2(osfs->os_bsize)) {
+       if (!is_power_of_2(osfs->os_bsize)) {
                CERROR("%s: blocksize (%d) is not a power of 2\n",
                                obd->obd_name, osfs->os_bsize);
                GOTO(err_fini_stack, rc = -EPROTO);