diff options
Diffstat (limited to 'fs/dlm/requestqueue.c')
-rw-r--r-- | fs/dlm/requestqueue.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/fs/dlm/requestqueue.c b/fs/dlm/requestqueue.c index 36afe99e4f93..7b2b089634a2 100644 --- a/fs/dlm/requestqueue.c +++ b/fs/dlm/requestqueue.c | |||
@@ -47,9 +47,9 @@ void dlm_add_requestqueue(struct dlm_ls *ls, int nodeid, struct dlm_header *hd) | |||
47 | e->nodeid = nodeid; | 47 | e->nodeid = nodeid; |
48 | memcpy(e->request, hd, length); | 48 | memcpy(e->request, hd, length); |
49 | 49 | ||
50 | down(&ls->ls_requestqueue_lock); | 50 | mutex_lock(&ls->ls_requestqueue_mutex); |
51 | list_add_tail(&e->list, &ls->ls_requestqueue); | 51 | list_add_tail(&e->list, &ls->ls_requestqueue); |
52 | up(&ls->ls_requestqueue_lock); | 52 | mutex_unlock(&ls->ls_requestqueue_mutex); |
53 | } | 53 | } |
54 | 54 | ||
55 | int dlm_process_requestqueue(struct dlm_ls *ls) | 55 | int dlm_process_requestqueue(struct dlm_ls *ls) |
@@ -58,19 +58,19 @@ int dlm_process_requestqueue(struct dlm_ls *ls) | |||
58 | struct dlm_header *hd; | 58 | struct dlm_header *hd; |
59 | int error = 0; | 59 | int error = 0; |
60 | 60 | ||
61 | down(&ls->ls_requestqueue_lock); | 61 | mutex_lock(&ls->ls_requestqueue_mutex); |
62 | 62 | ||
63 | for (;;) { | 63 | for (;;) { |
64 | if (list_empty(&ls->ls_requestqueue)) { | 64 | if (list_empty(&ls->ls_requestqueue)) { |
65 | up(&ls->ls_requestqueue_lock); | 65 | mutex_unlock(&ls->ls_requestqueue_mutex); |
66 | error = 0; | 66 | error = 0; |
67 | break; | 67 | break; |
68 | } | 68 | } |
69 | e = list_entry(ls->ls_requestqueue.next, struct rq_entry, list); | 69 | e = list_entry(ls->ls_requestqueue.next, struct rq_entry, list); |
70 | up(&ls->ls_requestqueue_lock); | 70 | mutex_unlock(&ls->ls_requestqueue_mutex); |
71 | 71 | ||
72 | hd = (struct dlm_header *) e->request; | 72 | hd = (struct dlm_header *) e->request; |
73 | error = dlm_receive_message(hd, e->nodeid, TRUE); | 73 | error = dlm_receive_message(hd, e->nodeid, 1); |
74 | 74 | ||
75 | if (error == -EINTR) { | 75 | if (error == -EINTR) { |
76 | /* entry is left on requestqueue */ | 76 | /* entry is left on requestqueue */ |
@@ -78,13 +78,13 @@ int dlm_process_requestqueue(struct dlm_ls *ls) | |||
78 | break; | 78 | break; |
79 | } | 79 | } |
80 | 80 | ||
81 | down(&ls->ls_requestqueue_lock); | 81 | mutex_lock(&ls->ls_requestqueue_mutex); |
82 | list_del(&e->list); | 82 | list_del(&e->list); |
83 | kfree(e); | 83 | kfree(e); |
84 | 84 | ||
85 | if (dlm_locking_stopped(ls)) { | 85 | if (dlm_locking_stopped(ls)) { |
86 | log_debug(ls, "process_requestqueue abort running"); | 86 | log_debug(ls, "process_requestqueue abort running"); |
87 | up(&ls->ls_requestqueue_lock); | 87 | mutex_unlock(&ls->ls_requestqueue_mutex); |
88 | error = -EINTR; | 88 | error = -EINTR; |
89 | break; | 89 | break; |
90 | } | 90 | } |
@@ -105,15 +105,15 @@ int dlm_process_requestqueue(struct dlm_ls *ls) | |||
105 | void dlm_wait_requestqueue(struct dlm_ls *ls) | 105 | void dlm_wait_requestqueue(struct dlm_ls *ls) |
106 | { | 106 | { |
107 | for (;;) { | 107 | for (;;) { |
108 | down(&ls->ls_requestqueue_lock); | 108 | mutex_lock(&ls->ls_requestqueue_mutex); |
109 | if (list_empty(&ls->ls_requestqueue)) | 109 | if (list_empty(&ls->ls_requestqueue)) |
110 | break; | 110 | break; |
111 | if (dlm_locking_stopped(ls)) | 111 | if (dlm_locking_stopped(ls)) |
112 | break; | 112 | break; |
113 | up(&ls->ls_requestqueue_lock); | 113 | mutex_unlock(&ls->ls_requestqueue_mutex); |
114 | schedule(); | 114 | schedule(); |
115 | } | 115 | } |
116 | up(&ls->ls_requestqueue_lock); | 116 | mutex_unlock(&ls->ls_requestqueue_mutex); |
117 | } | 117 | } |
118 | 118 | ||
119 | static int purge_request(struct dlm_ls *ls, struct dlm_message *ms, int nodeid) | 119 | static int purge_request(struct dlm_ls *ls, struct dlm_message *ms, int nodeid) |
@@ -170,7 +170,7 @@ void dlm_purge_requestqueue(struct dlm_ls *ls) | |||
170 | struct dlm_message *ms; | 170 | struct dlm_message *ms; |
171 | struct rq_entry *e, *safe; | 171 | struct rq_entry *e, *safe; |
172 | 172 | ||
173 | down(&ls->ls_requestqueue_lock); | 173 | mutex_lock(&ls->ls_requestqueue_mutex); |
174 | list_for_each_entry_safe(e, safe, &ls->ls_requestqueue, list) { | 174 | list_for_each_entry_safe(e, safe, &ls->ls_requestqueue, list) { |
175 | ms = (struct dlm_message *) e->request; | 175 | ms = (struct dlm_message *) e->request; |
176 | 176 | ||
@@ -179,6 +179,6 @@ void dlm_purge_requestqueue(struct dlm_ls *ls) | |||
179 | kfree(e); | 179 | kfree(e); |
180 | } | 180 | } |
181 | } | 181 | } |
182 | up(&ls->ls_requestqueue_lock); | 182 | mutex_unlock(&ls->ls_requestqueue_mutex); |
183 | } | 183 | } |
184 | 184 | ||