Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F133412453
D11900.id31666.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D11900.id31666.diff
View Options
Index: sys/compat/linuxkpi/common/include/linux/hrtimer.h
===================================================================
--- sys/compat/linuxkpi/common/include/linux/hrtimer.h
+++ sys/compat/linuxkpi/common/include/linux/hrtimer.h
@@ -48,7 +48,6 @@
enum hrtimer_restart (*function)(struct hrtimer *);
struct mtx mtx;
struct callout callout;
- uint32_t flags;
};
#define hrtimer_active(hrtimer) linux_hrtimer_active(hrtimer)
Index: sys/compat/linuxkpi/common/src/linux_hrtimer.c
===================================================================
--- sys/compat/linuxkpi/common/src/linux_hrtimer.c
+++ sys/compat/linuxkpi/common/src/linux_hrtimer.c
@@ -37,9 +37,6 @@
#include <linux/hrtimer.h>
-/* hrtimer flags */
-#define HRTIMER_ACTIVE 0x01
-
static void
hrtimer_call_handler(void *arg)
{
@@ -49,7 +46,7 @@
hrtimer = arg;
ret = hrtimer->function(hrtimer);
MPASS(ret == HRTIMER_NORESTART);
- hrtimer->flags &= ~HRTIMER_ACTIVE;
+ callout_deactivate(&hrtimer->callout);
}
bool
@@ -58,7 +55,7 @@
bool ret;
mtx_lock(&hrtimer->mtx);
- ret = (hrtimer->flags & HRTIMER_ACTIVE) != 0;
+ ret = callout_active(&hrtimer->callout);
mtx_unlock(&hrtimer->mtx);
return (ret);
}
@@ -67,10 +64,7 @@
linux_hrtimer_cancel(struct hrtimer *hrtimer)
{
- if (!hrtimer_active(hrtimer))
- return (0);
- (void)callout_drain(&hrtimer->callout);
- return (1);
+ return (callout_drain(&hrtimer->callout) > 0);
}
void
@@ -78,7 +72,6 @@
{
hrtimer->function = NULL;
- hrtimer->flags = 0;
mtx_init(&hrtimer->mtx, "hrtimer", NULL, MTX_DEF | MTX_RECURSE);
callout_init_mtx(&hrtimer->callout, &hrtimer->mtx, 0);
}
@@ -103,6 +96,5 @@
mtx_lock(&hrtimer->mtx);
callout_reset_sbt(&hrtimer->callout, nstosbt(time.tv64), nstosbt(nsec),
hrtimer_call_handler, hrtimer, 0);
- hrtimer->flags |= HRTIMER_ACTIVE;
mtx_unlock(&hrtimer->mtx);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 26, 3:04 PM (3 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24235288
Default Alt Text
D11900.id31666.diff (1 KB)
Attached To
Mode
D11900: Fix hrtimer_active() in case of cancelllation.
Attached
Detach File
Event Timeline
Log In to Comment