3232#define NO_THRESHOLD (-1)
3333#define DFT_THRESHOLD (32)
3434
35- struct __btrfs_workqueue_struct {
35+ struct __btrfs_workqueue {
3636 struct workqueue_struct * normal_wq ;
3737 /* List head pointing to ordered work list */
3838 struct list_head ordered_list ;
@@ -49,15 +49,15 @@ struct __btrfs_workqueue_struct {
4949 spinlock_t thres_lock ;
5050};
5151
52- struct btrfs_workqueue_struct {
53- struct __btrfs_workqueue_struct * normal ;
54- struct __btrfs_workqueue_struct * high ;
52+ struct btrfs_workqueue {
53+ struct __btrfs_workqueue * normal ;
54+ struct __btrfs_workqueue * high ;
5555};
5656
57- static inline struct __btrfs_workqueue_struct
57+ static inline struct __btrfs_workqueue
5858* __btrfs_alloc_workqueue (char * name , int flags , int max_active , int thresh )
5959{
60- struct __btrfs_workqueue_struct * ret = kzalloc (sizeof (* ret ), GFP_NOFS );
60+ struct __btrfs_workqueue * ret = kzalloc (sizeof (* ret ), GFP_NOFS );
6161
6262 if (unlikely (!ret ))
6363 return NULL ;
@@ -95,14 +95,14 @@ static inline struct __btrfs_workqueue_struct
9595}
9696
9797static inline void
98- __btrfs_destroy_workqueue (struct __btrfs_workqueue_struct * wq );
98+ __btrfs_destroy_workqueue (struct __btrfs_workqueue * wq );
9999
100- struct btrfs_workqueue_struct * btrfs_alloc_workqueue (char * name ,
101- int flags ,
102- int max_active ,
103- int thresh )
100+ struct btrfs_workqueue * btrfs_alloc_workqueue (char * name ,
101+ int flags ,
102+ int max_active ,
103+ int thresh )
104104{
105- struct btrfs_workqueue_struct * ret = kzalloc (sizeof (* ret ), GFP_NOFS );
105+ struct btrfs_workqueue * ret = kzalloc (sizeof (* ret ), GFP_NOFS );
106106
107107 if (unlikely (!ret ))
108108 return NULL ;
@@ -131,7 +131,7 @@ struct btrfs_workqueue_struct *btrfs_alloc_workqueue(char *name,
131131 * This hook WILL be called in IRQ handler context,
132132 * so workqueue_set_max_active MUST NOT be called in this hook
133133 */
134- static inline void thresh_queue_hook (struct __btrfs_workqueue_struct * wq )
134+ static inline void thresh_queue_hook (struct __btrfs_workqueue * wq )
135135{
136136 if (wq -> thresh == NO_THRESHOLD )
137137 return ;
@@ -143,7 +143,7 @@ static inline void thresh_queue_hook(struct __btrfs_workqueue_struct *wq)
143143 * This hook is called in kthread content.
144144 * So workqueue_set_max_active is called here.
145145 */
146- static inline void thresh_exec_hook (struct __btrfs_workqueue_struct * wq )
146+ static inline void thresh_exec_hook (struct __btrfs_workqueue * wq )
147147{
148148 int new_max_active ;
149149 long pending ;
@@ -186,18 +186,18 @@ static inline void thresh_exec_hook(struct __btrfs_workqueue_struct *wq)
186186 }
187187}
188188
189- static void run_ordered_work (struct __btrfs_workqueue_struct * wq )
189+ static void run_ordered_work (struct __btrfs_workqueue * wq )
190190{
191191 struct list_head * list = & wq -> ordered_list ;
192- struct btrfs_work_struct * work ;
192+ struct btrfs_work * work ;
193193 spinlock_t * lock = & wq -> list_lock ;
194194 unsigned long flags ;
195195
196196 while (1 ) {
197197 spin_lock_irqsave (lock , flags );
198198 if (list_empty (list ))
199199 break ;
200- work = list_entry (list -> next , struct btrfs_work_struct ,
200+ work = list_entry (list -> next , struct btrfs_work ,
201201 ordered_list );
202202 if (!test_bit (WORK_DONE_BIT , & work -> flags ))
203203 break ;
@@ -229,11 +229,11 @@ static void run_ordered_work(struct __btrfs_workqueue_struct *wq)
229229
230230static void normal_work_helper (struct work_struct * arg )
231231{
232- struct btrfs_work_struct * work ;
233- struct __btrfs_workqueue_struct * wq ;
232+ struct btrfs_work * work ;
233+ struct __btrfs_workqueue * wq ;
234234 int need_order = 0 ;
235235
236- work = container_of (arg , struct btrfs_work_struct , normal_work );
236+ work = container_of (arg , struct btrfs_work , normal_work );
237237 /*
238238 * We should not touch things inside work in the following cases:
239239 * 1) after work->func() if it has no ordered_free
@@ -254,10 +254,10 @@ static void normal_work_helper(struct work_struct *arg)
254254 }
255255}
256256
257- void btrfs_init_work (struct btrfs_work_struct * work ,
258- void (* func )(struct btrfs_work_struct * ),
259- void (* ordered_func )(struct btrfs_work_struct * ),
260- void (* ordered_free )(struct btrfs_work_struct * ))
257+ void btrfs_init_work (struct btrfs_work * work ,
258+ void (* func )(struct btrfs_work * ),
259+ void (* ordered_func )(struct btrfs_work * ),
260+ void (* ordered_free )(struct btrfs_work * ))
261261{
262262 work -> func = func ;
263263 work -> ordered_func = ordered_func ;
@@ -267,8 +267,8 @@ void btrfs_init_work(struct btrfs_work_struct *work,
267267 work -> flags = 0 ;
268268}
269269
270- static inline void __btrfs_queue_work (struct __btrfs_workqueue_struct * wq ,
271- struct btrfs_work_struct * work )
270+ static inline void __btrfs_queue_work (struct __btrfs_workqueue * wq ,
271+ struct btrfs_work * work )
272272{
273273 unsigned long flags ;
274274
@@ -282,10 +282,10 @@ static inline void __btrfs_queue_work(struct __btrfs_workqueue_struct *wq,
282282 queue_work (wq -> normal_wq , & work -> normal_work );
283283}
284284
285- void btrfs_queue_work (struct btrfs_workqueue_struct * wq ,
286- struct btrfs_work_struct * work )
285+ void btrfs_queue_work (struct btrfs_workqueue * wq ,
286+ struct btrfs_work * work )
287287{
288- struct __btrfs_workqueue_struct * dest_wq ;
288+ struct __btrfs_workqueue * dest_wq ;
289289
290290 if (test_bit (WORK_HIGH_PRIO_BIT , & work -> flags ) && wq -> high )
291291 dest_wq = wq -> high ;
@@ -295,13 +295,13 @@ void btrfs_queue_work(struct btrfs_workqueue_struct *wq,
295295}
296296
297297static inline void
298- __btrfs_destroy_workqueue (struct __btrfs_workqueue_struct * wq )
298+ __btrfs_destroy_workqueue (struct __btrfs_workqueue * wq )
299299{
300300 destroy_workqueue (wq -> normal_wq );
301301 kfree (wq );
302302}
303303
304- void btrfs_destroy_workqueue (struct btrfs_workqueue_struct * wq )
304+ void btrfs_destroy_workqueue (struct btrfs_workqueue * wq )
305305{
306306 if (!wq )
307307 return ;
@@ -310,14 +310,14 @@ void btrfs_destroy_workqueue(struct btrfs_workqueue_struct *wq)
310310 __btrfs_destroy_workqueue (wq -> normal );
311311}
312312
313- void btrfs_workqueue_set_max (struct btrfs_workqueue_struct * wq , int max )
313+ void btrfs_workqueue_set_max (struct btrfs_workqueue * wq , int max )
314314{
315315 wq -> normal -> max_active = max ;
316316 if (wq -> high )
317317 wq -> high -> max_active = max ;
318318}
319319
320- void btrfs_set_work_high_priority (struct btrfs_work_struct * work )
320+ void btrfs_set_work_high_priority (struct btrfs_work * work )
321321{
322322 set_bit (WORK_HIGH_PRIO_BIT , & work -> flags );
323323}
0 commit comments