mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
FreeBSD: Use a hash table for taskqid lookups
Previously a tqent could be recycled prematurely, update the code to use a hash table for lookups to resolve this. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@ixsystems.com> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #10529
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include <sys/proc.h>
|
||||
#include <sys/taskqueue.h>
|
||||
#include <sys/thread.h>
|
||||
#include <sys/ck.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -37,26 +38,26 @@ extern "C" {
|
||||
|
||||
#define TASKQ_NAMELEN 31
|
||||
|
||||
struct taskqueue;
|
||||
struct taskq {
|
||||
typedef struct taskq {
|
||||
struct taskqueue *tq_queue;
|
||||
};
|
||||
} taskq_t;
|
||||
|
||||
typedef struct taskq taskq_t;
|
||||
typedef uintptr_t taskqid_t;
|
||||
typedef void (task_func_t)(void *);
|
||||
|
||||
typedef struct taskq_ent {
|
||||
struct task tqent_task;
|
||||
struct timeout_task tqent_timeout_task;
|
||||
task_func_t *tqent_func;
|
||||
void *tqent_arg;
|
||||
struct timeout_task tqent_timeout_task;
|
||||
int tqent_type;
|
||||
int tqent_gen;
|
||||
taskqid_t tqent_id;
|
||||
CK_LIST_ENTRY(taskq_ent) tqent_hash;
|
||||
uint8_t tqent_type;
|
||||
uint8_t tqent_registered;
|
||||
uint8_t tqent_cancelled;
|
||||
volatile uint32_t tqent_rc;
|
||||
} taskq_ent_t;
|
||||
|
||||
struct proc;
|
||||
|
||||
/*
|
||||
* Public flags for taskq_create(): bit range 0-15
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user