AC_DEFUN([LB_LINUX_COMPILE_IFELSE],
[m4_ifvaln([$1], [AC_LANG_CONFTEST([AC_LANG_SOURCE([$1])])])dnl
rm -f build/conftest.o build/conftest.mod.c build/conftest.ko
-SUBARCH=$(echo $target_cpu | sed -e 's/powerpc.*/powerpc/' -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/' -e 's/k1om/x86/' -e 's/aarch64.*/arm64/')
+SUBARCH=$(echo $target_cpu | sed -e 's/powerpc.*/powerpc/' -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/' -e 's/k1om/x86/' -e 's/aarch64.*/arm64/' -e 's/armv7.*/arm/')
AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] LDFLAGS= ${LD:+LD="$LD"} CC="$CC" -f $PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="$EXTRA_CHECK_INCLUDE -I$LINUX/arch/$SUBARCH/include -Iinclude -Iarch/$SUBARCH/include/generated -I$LINUX/include -Iinclude2 -I$LINUX/include/uapi -Iinclude/generated -I$LINUX/arch/$SUBARCH/include/uapi -Iarch/$SUBARCH/include/generated/uapi -I$LINUX/include/uapi -Iinclude/generated/uapi ${SPL_OBJ:+-include $SPL_OBJ/spl_config.h} ${ZFS_OBJ:+-include $ZFS_OBJ/zfs_config.h} ${SPL:+-I$SPL -I$SPL/include } ${ZFS:+-I$ZFS -I$ZFS/include} -include $CONFIG_INCLUDE" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])],
[$4],
[_AC_MSG_LOG_CONFTEST
if (nd->nd_state != LST_NODE_ACTIVE)
continue;
- intv = ktime_ms_delta(ktime_get(), nd->nd_stamp) / MSEC_PER_SEC;
+ intv = div_u64(ktime_ms_delta(ktime_get(), nd->nd_stamp),
+ MSEC_PER_SEC);
if (intv < nd->nd_timeout / 2)
continue;
LNetGetId(1, &id);
sid->ses_nid = id.nid;
- sid->ses_stamp = ktime_get_ns() / NSEC_PER_MSEC;
+ sid->ses_stamp = div_u64(ktime_get_ns(), NSEC_PER_MSEC);
}
int
slv = ldlm_pool_get_slv(pl);
lvf = ldlm_pool_get_lvf(pl);
- la = ktime_to_ns(ktime_sub(cur, lock->l_last_used)) / NSEC_PER_SEC;
+ la = div_u64(ktime_to_ns(ktime_sub(cur, lock->l_last_used)),
+ NSEC_PER_SEC);
lv = lvf * la * unused;
/* Inform pool about current CLV to see it via debugfs. */
}
/* the multiplier limits how large the value can be */
- wrap_indicator /= mult;
+ wrap_indicator = div64_u64(wrap_indicator, mult);
if (strwhole) {
rc = kstrtoull(strwhole, base, &whole);
* out. Use obd_timeout if calculated value is smaller
* than it.
*/
- if (!OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_REPL_UNLINK)) {
- timeout = ptlrpc_inflight_timeout(imp);
- timeout += timeout / 3;
+ if (!OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_REPL_UNLINK)) {
+ timeout = ptlrpc_inflight_timeout(imp);
+ timeout += div_u64(timeout, 3);
- if (timeout == 0)
- timeout = obd_timeout;
- } else {
- /* decrease the interval to increase race condition */
- timeout = 1;
- }
+ if (timeout == 0)
+ timeout = obd_timeout;
+ } else {
+ /* decrease the interval to increase race condition */
+ timeout = 1;
+ }
CDEBUG(D_RPCTRACE, "Sleeping %llds for inflight to error out\n",
timeout);
if (unlikely(ptlrpc_check_req(request)))
goto put_conn;
ptlrpc_update_export_timer(request->rq_export,
- timediff_usecs / (USEC_PER_SEC / 2));
+ div_u64(timediff_usecs,
+ USEC_PER_SEC / 2));
}
/* Discard requests queued for longer than the deadline.
DEBUG_REQ(D_ADAPTTO, request,
"sent %d early replies before finishing in %llds",
request->rq_early_count,
- arrived_usecs / USEC_PER_SEC);
+ div_u64(arrived_usecs, USEC_PER_SEC));
}
ptlrpc_server_finish_active_request(svcpt, request);