1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00

config: remove HAVE_IO_SCHEDULE_TIMEOUT

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #16479
This commit is contained in:
Rob Norris 2024-08-03 13:31:43 +10:00 committed by Brian Behlendorf
parent 714d7666e5
commit d4bbe2ff38
2 changed files with 1 additions and 70 deletions

View File

@ -44,39 +44,12 @@ AC_DEFUN([ZFS_AC_KERNEL_SCHED_SIGNAL_HEADER], [
])
])
dnl #
dnl # 3.19 API change
dnl # The io_schedule_timeout() function is present in all 2.6.32 kernels
dnl # but it was not exported until Linux 3.19. The RHEL 7.x kernels which
dnl # are based on a 3.10 kernel do export this symbol.
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_IO_SCHEDULE_TIMEOUT], [
ZFS_LINUX_TEST_SRC([io_schedule_timeout], [
#include <linux/sched.h>
], [
(void) io_schedule_timeout(1);
])
])
AC_DEFUN([ZFS_AC_KERNEL_IO_SCHEDULE_TIMEOUT], [
AC_MSG_CHECKING([whether io_schedule_timeout() is available])
ZFS_LINUX_TEST_RESULT_SYMBOL([io_schedule_timeout],
[io_schedule_timeout], [], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_IO_SCHEDULE_TIMEOUT, 1, [yes])
],[
AC_MSG_RESULT(no)
])
])
AC_DEFUN([ZFS_AC_KERNEL_SRC_SCHED], [
ZFS_AC_KERNEL_SRC_SCHED_RT_HEADER
ZFS_AC_KERNEL_SRC_SCHED_SIGNAL_HEADER
ZFS_AC_KERNEL_SRC_IO_SCHEDULE_TIMEOUT
])
AC_DEFUN([ZFS_AC_KERNEL_SCHED], [
ZFS_AC_KERNEL_SCHED_RT_HEADER
ZFS_AC_KERNEL_SCHED_SIGNAL_HEADER
ZFS_AC_KERNEL_IO_SCHEDULE_TIMEOUT
])

View File

@ -209,48 +209,6 @@ __cv_wait_idle(kcondvar_t *cvp, kmutex_t *mp)
}
EXPORT_SYMBOL(__cv_wait_idle);
#if defined(HAVE_IO_SCHEDULE_TIMEOUT)
#define spl_io_schedule_timeout(t) io_schedule_timeout(t)
#else
struct spl_task_timer {
struct timer_list timer;
struct task_struct *task;
};
static void
__cv_wakeup(spl_timer_list_t t)
{
struct timer_list *tmr = (struct timer_list *)t;
struct spl_task_timer *task_timer = from_timer(task_timer, tmr, timer);
wake_up_process(task_timer->task);
}
static long
spl_io_schedule_timeout(long time_left)
{
long expire_time = jiffies + time_left;
struct spl_task_timer task_timer;
struct timer_list *timer = &task_timer.timer;
task_timer.task = current;
timer_setup(timer, __cv_wakeup, 0);
timer->expires = expire_time;
add_timer(timer);
io_schedule();
del_timer_sync(timer);
time_left = expire_time - jiffies;
return (time_left < 0 ? 0 : time_left);
}
#endif
/*
* 'expire_time' argument is an absolute wall clock time in jiffies.
* Return value is time left (expire_time - now) or -1 if timeout occurred.
@ -290,7 +248,7 @@ __cv_timedwait_common(kcondvar_t *cvp, kmutex_t *mp, clock_t expire_time,
*/
mutex_exit(mp);
if (io)
time_left = spl_io_schedule_timeout(time_left);
time_left = io_schedule_timeout(time_left);
else
time_left = schedule_timeout(time_left);