Lines Matching defs:op
64 static void send_op(struct plock_op *op)
66 set_version(&op->info);
67 INIT_LIST_HEAD(&op->list);
69 list_add_tail(&op->list, &send_list);
78 struct plock_op *op;
92 op = &xop->xop;
93 op->info.optype = DLM_PLOCK_OP_LOCK;
94 op->info.pid = fl->fl_pid;
95 op->info.ex = (fl->fl_type == F_WRLCK);
96 op->info.wait = IS_SETLKW(cmd);
97 op->info.fsid = ls->ls_global_id;
98 op->info.number = number;
99 op->info.start = fl->fl_start;
100 op->info.end = fl->fl_end;
104 op->info.owner = (__u64) fl->fl_pid;
111 op->info.owner = (__u64)(long) fl->fl_owner;
115 send_op(op);
118 wait_event(recv_wq, (op->done != 0));
125 if (!list_empty(&op->list)) {
126 log_error(ls, "dlm_posix_lock: op on list %llx",
128 list_del(&op->list);
132 rv = op->info.rv;
148 static int dlm_plock_callback(struct plock_op *op)
154 struct plock_xop *xop = (struct plock_xop *)op;
158 if (!list_empty(&op->list)) {
159 log_print("dlm_plock_callback: op on list %llx",
160 (unsigned long long)op->info.number);
161 list_del(&op->list);
171 if (op->info.rv) {
172 notify(fl, NULL, op->info.rv);
188 (unsigned long long)op->info.number, file, fl);
207 struct plock_op *op;
214 op = kzalloc(sizeof(*op), GFP_NOFS);
215 if (!op) {
224 op->info.optype = DLM_PLOCK_OP_UNLOCK;
225 op->info.pid = fl->fl_pid;
226 op->info.fsid = ls->ls_global_id;
227 op->info.number = number;
228 op->info.start = fl->fl_start;
229 op->info.end = fl->fl_end;
231 op->info.owner = (__u64) fl->fl_pid;
233 op->info.owner = (__u64)(long) fl->fl_owner;
235 send_op(op);
236 wait_event(recv_wq, (op->done != 0));
239 if (!list_empty(&op->list)) {
240 log_error(ls, "dlm_posix_unlock: op on list %llx",
242 list_del(&op->list);
246 rv = op->info.rv;
251 kfree(op);
262 struct plock_op *op;
269 op = kzalloc(sizeof(*op), GFP_NOFS);
270 if (!op) {
275 op->info.optype = DLM_PLOCK_OP_GET;
276 op->info.pid = fl->fl_pid;
277 op->info.ex = (fl->fl_type == F_WRLCK);
278 op->info.fsid = ls->ls_global_id;
279 op->info.number = number;
280 op->info.start = fl->fl_start;
281 op->info.end = fl->fl_end;
283 op->info.owner = (__u64) fl->fl_pid;
285 op->info.owner = (__u64)(long) fl->fl_owner;
287 send_op(op);
288 wait_event(recv_wq, (op->done != 0));
291 if (!list_empty(&op->list)) {
292 log_error(ls, "dlm_posix_get: op on list %llx",
294 list_del(&op->list);
301 rv = op->info.rv;
308 fl->fl_type = (op->info.ex) ? F_WRLCK : F_RDLCK;
310 fl->fl_pid = op->info.pid;
311 fl->fl_start = op->info.start;
312 fl->fl_end = op->info.end;
316 kfree(op);
328 struct plock_op *op = NULL;
335 op = list_entry(send_list.next, struct plock_op, list);
336 list_move(&op->list, &recv_list);
337 memcpy(&info, &op->info, sizeof(info));
341 if (!op)
355 struct plock_op *op;
368 list_for_each_entry(op, &recv_list, list) {
369 if (op->info.fsid == info.fsid &&
370 op->info.number == info.number &&
371 op->info.owner == info.owner) {
372 struct plock_xop *xop = (struct plock_xop *)op;
373 list_del_init(&op->list);
374 memcpy(&op->info, &info, sizeof(info));
378 op->done = 1;
387 dlm_plock_callback(op);
391 log_print("dev_write no op %x %llx", info.fsid,