Skip to content

Commit fc916da

Browse files
Al Virohubcapsc
authored andcommitted
orangefs: get rid of <censored> macros
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
1 parent 90e54e3 commit fc916da

2 files changed

Lines changed: 44 additions & 41 deletions

File tree

‎fs/orangefs/orangefs-kernel.h‎

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -619,47 +619,6 @@ extern wait_queue_head_t orangefs_bufmap_init_waitq;
619619
/*
620620
* misc convenience macros
621621
*/
622-
#define add_op_to_request_list(op) \
623-
do { \
624-
spin_lock(&orangefs_request_list_lock); \
625-
spin_lock(&op->lock); \
626-
set_op_state_waiting(op); \
627-
list_add_tail(&op->list, &orangefs_request_list); \
628-
spin_unlock(&orangefs_request_list_lock); \
629-
spin_unlock(&op->lock); \
630-
wake_up_interruptible(&orangefs_request_list_waitq); \
631-
} while (0)
632-
633-
#define add_priority_op_to_request_list(op) \
634-
do { \
635-
spin_lock(&orangefs_request_list_lock); \
636-
spin_lock(&op->lock); \
637-
set_op_state_waiting(op); \
638-
\
639-
list_add(&op->list, &orangefs_request_list); \
640-
spin_unlock(&orangefs_request_list_lock); \
641-
spin_unlock(&op->lock); \
642-
wake_up_interruptible(&orangefs_request_list_waitq); \
643-
} while (0)
644-
645-
#define remove_op_from_request_list(op) \
646-
do { \
647-
struct list_head *tmp = NULL; \
648-
struct list_head *tmp_safe = NULL; \
649-
struct orangefs_kernel_op_s *tmp_op = NULL; \
650-
\
651-
spin_lock(&orangefs_request_list_lock); \
652-
list_for_each_safe(tmp, tmp_safe, &orangefs_request_list) { \
653-
tmp_op = list_entry(tmp, \
654-
struct orangefs_kernel_op_s, \
655-
list); \
656-
if (tmp_op && (tmp_op == op)) { \
657-
list_del(&tmp_op->list); \
658-
break; \
659-
} \
660-
} \
661-
spin_unlock(&orangefs_request_list_lock); \
662-
} while (0)
663622

664623
#define ORANGEFS_OP_INTERRUPTIBLE 1 /* service_operation() is interruptible */
665624
#define ORANGEFS_OP_PRIORITY 2 /* service_operation() is high priority */

‎fs/orangefs/waitqueue.c‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,31 @@ void purge_waiting_ops(void)
4141
spin_unlock(&orangefs_request_list_lock);
4242
}
4343

44+
static inline void
45+
add_op_to_request_list(struct orangefs_kernel_op_s *op)
46+
{
47+
spin_lock(&orangefs_request_list_lock);
48+
spin_lock(&op->lock);
49+
set_op_state_waiting(op);
50+
list_add_tail(&op->list, &orangefs_request_list);
51+
spin_unlock(&orangefs_request_list_lock);
52+
spin_unlock(&op->lock);
53+
wake_up_interruptible(&orangefs_request_list_waitq);
54+
}
55+
56+
static inline
57+
void add_priority_op_to_request_list(struct orangefs_kernel_op_s *op)
58+
{
59+
spin_lock(&orangefs_request_list_lock);
60+
spin_lock(&op->lock);
61+
set_op_state_waiting(op);
62+
63+
list_add(&op->list, &orangefs_request_list);
64+
spin_unlock(&orangefs_request_list_lock);
65+
spin_unlock(&op->lock);
66+
wake_up_interruptible(&orangefs_request_list_waitq);
67+
}
68+
4469
/*
4570
* submits a ORANGEFS operation and waits for it to complete
4671
*
@@ -252,6 +277,25 @@ int service_operation(struct orangefs_kernel_op_s *op,
252277
return ret;
253278
}
254279

280+
static inline void remove_op_from_request_list(struct orangefs_kernel_op_s *op)
281+
{
282+
struct list_head *tmp = NULL;
283+
struct list_head *tmp_safe = NULL;
284+
struct orangefs_kernel_op_s *tmp_op = NULL;
285+
286+
spin_lock(&orangefs_request_list_lock);
287+
list_for_each_safe(tmp, tmp_safe, &orangefs_request_list) {
288+
tmp_op = list_entry(tmp,
289+
struct orangefs_kernel_op_s,
290+
list);
291+
if (tmp_op && (tmp_op == op)) {
292+
list_del(&tmp_op->list);
293+
break;
294+
}
295+
}
296+
spin_unlock(&orangefs_request_list_lock);
297+
}
298+
255299
void orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s *op)
256300
{
257301
/*

0 commit comments

Comments
 (0)