Switch open_exec() and sys_uselib() to do_open_filp()
[safe/jmp/linux-2.6] / fs / btrfs / async-thread.h
index 43e44d1..1b511c1 100644 (file)
@@ -37,10 +37,16 @@ struct btrfs_worker_thread;
  */
 struct btrfs_work {
        /*
-        * only func should be set to the function you want called
+        * func should be set to the function you want called
         * your work struct is passed as the only arg
+        *
+        * ordered_func must be set for work sent to an ordered work queue,
+        * and it is called to complete a given work item in the same
+        * order they were sent to the queue.
         */
        void (*func)(struct btrfs_work *work);
+       void (*ordered_func)(struct btrfs_work *work);
+       void (*ordered_free)(struct btrfs_work *work);
 
        /*
         * flags should be set to zero.  It is used to make sure the
@@ -51,6 +57,7 @@ struct btrfs_work {
        /* don't touch these */
        struct btrfs_worker_thread *worker;
        struct list_head list;
+       struct list_head order_list;
 };
 
 struct btrfs_workers {
@@ -63,14 +70,27 @@ struct btrfs_workers {
        /* once a worker has this many requests or fewer, it is idle */
        int idle_thresh;
 
-       /* list with all the work threads */
+       /* force completions in the order they were queued */
+       int ordered;
+
+       /* list with all the work threads.  The workers on the idle thread
+        * may be actively servicing jobs, but they haven't yet hit the
+        * idle thresh limit above.
+        */
        struct list_head worker_list;
        struct list_head idle_list;
 
+       /*
+        * when operating in ordered mode, this maintains the list
+        * of work items waiting for completion
+        */
+       struct list_head order_list;
+       struct list_head prio_order_list;
+
        /* lock for finding the next worker thread to queue on */
        spinlock_t lock;
 
-       /* extra name for this worker */
+       /* extra name for this worker, used for current->name */
        char *name;
 };
 
@@ -79,4 +99,5 @@ int btrfs_start_workers(struct btrfs_workers *workers, int num_workers);
 int btrfs_stop_workers(struct btrfs_workers *workers);
 void btrfs_init_workers(struct btrfs_workers *workers, char *name, int max);
 int btrfs_requeue_work(struct btrfs_work *work);
+void btrfs_set_work_high_prio(struct btrfs_work *work);
 #endif