Date: Tue, 18 Aug 2009 13:55:48 +0000 (UTC) From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r196358 - in head: share/man/man9 sys/kern sys/sys Message-ID: <200908181355.n7IDtmqT019165@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pjd Date: Tue Aug 18 13:55:48 2009 New Revision: 196358 URL: http://svn.freebsd.org/changeset/base/196358 Log: Remove unused taskqueue_find() function. Reviewed by: dfr Approved by: re (kib) Modified: head/share/man/man9/taskqueue.9 head/sys/kern/subr_taskqueue.c head/sys/sys/taskqueue.h Modified: head/share/man/man9/taskqueue.9 ============================================================================== --- head/share/man/man9/taskqueue.9 Tue Aug 18 13:51:51 2009 (r196357) +++ head/share/man/man9/taskqueue.9 Tue Aug 18 13:55:48 2009 (r196358) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 17, 2009 +.Dd August 18, 2009 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -59,8 +59,6 @@ struct task { .Fn taskqueue_create_fast "const char *name" "int mflags" "taskqueue_enqueue_fn enqueue" "void *context" .Ft void .Fn taskqueue_free "struct taskqueue *queue" -.Ft struct taskqueue * -.Fn taskqueue_find "const char *name" .Ft int .Fn taskqueue_enqueue "struct taskqueue *queue" "struct task *task" .Ft int @@ -115,16 +113,10 @@ should be used in place of .Pp The function .Fn taskqueue_free -should be used to remove the queue from the global list of queues -and free the memory used by the queue. +should be used to free the memory used by the queue. Any tasks that are on the queue will be executed at this time after which the thread servicing the queue will be signaled that it should exit. .Pp -The system maintains a list of all queues which can be searched using -.Fn taskqueue_find . -The first queue whose name matches is returned, otherwise -.Dv NULL . -.Pp To add a task to the list of tasks queued on a taskqueue, call .Fn taskqueue_enqueue with pointers to the queue and task. Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Tue Aug 18 13:51:51 2009 (r196357) +++ head/sys/kern/subr_taskqueue.c Tue Aug 18 13:55:48 2009 (r196358) @@ -45,11 +45,8 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_TASKQUEUE, "taskqueue", "Task Queues"); static void *taskqueue_giant_ih; static void *taskqueue_ih; -static STAILQ_HEAD(taskqueue_list, taskqueue) taskqueue_queues; -static struct mtx taskqueue_queues_mutex; struct taskqueue { - STAILQ_ENTRY(taskqueue) tq_link; STAILQ_HEAD(, task) tq_queue; const char *tq_name; taskqueue_enqueue_fn tq_enqueue; @@ -84,8 +81,6 @@ TQ_UNLOCK(struct taskqueue *tq) mtx_unlock(&tq->tq_mutex); } -static void init_taskqueue_list(void *data); - static __inline int TQ_SLEEP(struct taskqueue *tq, void *p, struct mtx *m, int pri, const char *wm, int t) @@ -95,16 +90,6 @@ TQ_SLEEP(struct taskqueue *tq, void *p, return (msleep(p, m, pri, wm, t)); } -static void -init_taskqueue_list(void *data __unused) -{ - - mtx_init(&taskqueue_queues_mutex, "taskqueue list", NULL, MTX_DEF); - STAILQ_INIT(&taskqueue_queues); -} -SYSINIT(taskqueue_list, SI_SUB_INTRINSIC, SI_ORDER_ANY, init_taskqueue_list, - NULL); - static struct taskqueue * _taskqueue_create(const char *name, int mflags, taskqueue_enqueue_fn enqueue, void *context, @@ -124,10 +109,6 @@ _taskqueue_create(const char *name, int queue->tq_flags |= TQ_FLAGS_ACTIVE; mtx_init(&queue->tq_mutex, mtxname, NULL, mtxflags); - mtx_lock(&taskqueue_queues_mutex); - STAILQ_INSERT_TAIL(&taskqueue_queues, queue, tq_link); - mtx_unlock(&taskqueue_queues_mutex); - return queue; } @@ -156,10 +137,6 @@ void taskqueue_free(struct taskqueue *queue) { - mtx_lock(&taskqueue_queues_mutex); - STAILQ_REMOVE(&taskqueue_queues, queue, taskqueue, tq_link); - mtx_unlock(&taskqueue_queues_mutex); - TQ_LOCK(queue); queue->tq_flags &= ~TQ_FLAGS_ACTIVE; taskqueue_run(queue); @@ -169,26 +146,6 @@ taskqueue_free(struct taskqueue *queue) free(queue, M_TASKQUEUE); } -/* - * Returns with the taskqueue locked. - */ -struct taskqueue * -taskqueue_find(const char *name) -{ - struct taskqueue *queue; - - mtx_lock(&taskqueue_queues_mutex); - STAILQ_FOREACH(queue, &taskqueue_queues, tq_link) { - if (strcmp(queue->tq_name, name) == 0) { - TQ_LOCK(queue); - mtx_unlock(&taskqueue_queues_mutex); - return queue; - } - } - mtx_unlock(&taskqueue_queues_mutex); - return NULL; -} - int taskqueue_enqueue(struct taskqueue *queue, struct task *task) { Modified: head/sys/sys/taskqueue.h ============================================================================== --- head/sys/sys/taskqueue.h Tue Aug 18 13:51:51 2009 (r196357) +++ head/sys/sys/taskqueue.h Tue Aug 18 13:55:48 2009 (r196358) @@ -48,7 +48,6 @@ struct thread; */ typedef void (*taskqueue_enqueue_fn)(void *context); -struct proc; struct taskqueue *taskqueue_create(const char *name, int mflags, taskqueue_enqueue_fn enqueue, void *context); @@ -56,7 +55,6 @@ int taskqueue_start_threads(struct taskq const char *name, ...) __printflike(4, 5); int taskqueue_enqueue(struct taskqueue *queue, struct task *task); void taskqueue_drain(struct taskqueue *queue, struct task *task); -struct taskqueue *taskqueue_find(const char *name); void taskqueue_free(struct taskqueue *queue); void taskqueue_run(struct taskqueue *queue); void taskqueue_block(struct taskqueue *queue);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908181355.n7IDtmqT019165>