X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fosc%2Fosc_object.c;h=4f4e8acbf2eae70ed47501ec74694cb0ab020071;hp=025e68a6d9661350e251d19a421391e17847016e;hb=db2d74e8091a7b816d831babe428fa189e002544;hpb=80515fa15ee76fb0174fd3be80c4a113a8d3c875 diff --git a/lustre/osc/osc_object.c b/lustre/osc/osc_object.c index 025e68a..4f4e8ac 100644 --- a/lustre/osc/osc_object.c +++ b/lustre/osc/osc_object.c @@ -308,9 +308,10 @@ drop_lock: int osc_object_is_contended(struct osc_object *obj) { - struct osc_device *dev = lu2osc_dev(obj->oo_cl.co_lu.lo_dev); - time64_t osc_contention_time = dev->od_contention_time; - time64_t retry_time; + struct osc_device *dev = lu2osc_dev(obj->oo_cl.co_lu.lo_dev); + int osc_contention_time = dev->od_contention_time; + cfs_time_t cur_time = cfs_time_current(); + cfs_time_t retry_time; if (OBD_FAIL_CHECK(OBD_FAIL_OSC_OBJECT_CONTENTION)) return 1; @@ -318,16 +319,17 @@ int osc_object_is_contended(struct osc_object *obj) if (!obj->oo_contended) return 0; - /* - * I like copy-paste. the code is copied from - * ll_file_is_contended. - */ - retry_time = obj->oo_contention_time + osc_contention_time; - if (ktime_get_seconds() > retry_time) { - osc_object_clear_contended(obj); - return 0; - } - return 1; + /* + * I like copy-paste. the code is copied from + * ll_file_is_contended. + */ + retry_time = cfs_time_add(obj->oo_contention_time, + cfs_time_seconds(osc_contention_time)); + if (cfs_time_after(cur_time, retry_time)) { + osc_object_clear_contended(obj); + return 0; + } + return 1; } EXPORT_SYMBOL(osc_object_is_contended);