patch-2.2.19 linux/include/linux/tqueue.h

Next file: linux/include/linux/usb.h
Previous file: linux/include/linux/sysctl.h
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.18/include/linux/tqueue.h linux/include/linux/tqueue.h
@@ -50,6 +50,7 @@
 typedef struct tq_struct * task_queue;
 
 #define DECLARE_TASK_QUEUE(q)  task_queue q = NULL
+#define TQ_ACTIVE(q)           ((q) != NULL)
 
 extern task_queue tq_timer, tq_immediate, tq_scheduler, tq_disk;
 
@@ -78,19 +79,24 @@
 extern spinlock_t tqueue_lock;
 
 /*
- * queue_task
+ * Queue a task on a tq.  Return non-zero if it was successfully
+ * added.
  */
-extern __inline__ void queue_task(struct tq_struct *bh_pointer,
+extern __inline__ int queue_task(struct tq_struct *bh_pointer,
 			   task_queue *bh_list)
 {
+	int ret = 0;
 	if (!test_and_set_bit(0,&bh_pointer->sync)) {
 		unsigned long flags;
 		spin_lock_irqsave(&tqueue_lock, flags);
 		bh_pointer->next = *bh_list;
 		*bh_list = bh_pointer;
 		spin_unlock_irqrestore(&tqueue_lock, flags);
+		ret = 1;
 	}
+	return ret;
 }
+
 
 /*
  * Call all "bottom halfs" on a given list.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)