Lines Matching refs:op
64 static void send_op(struct plock_op *op) in send_op() argument
66 set_version(&op->info); in send_op()
67 INIT_LIST_HEAD(&op->list); in send_op()
69 list_add_tail(&op->list, &send_list); in send_op()
83 struct plock_op *op; in do_unlock_close() local
85 op = kzalloc(sizeof(*op), GFP_NOFS); in do_unlock_close()
86 if (!op) in do_unlock_close()
89 op->info.optype = DLM_PLOCK_OP_UNLOCK; in do_unlock_close()
90 op->info.pid = fl->fl_pid; in do_unlock_close()
91 op->info.fsid = ls->ls_global_id; in do_unlock_close()
92 op->info.number = number; in do_unlock_close()
93 op->info.start = 0; in do_unlock_close()
94 op->info.end = OFFSET_MAX; in do_unlock_close()
96 op->info.owner = (__u64) fl->fl_pid; in do_unlock_close()
98 op->info.owner = (__u64)(long) fl->fl_owner; in do_unlock_close()
100 op->info.flags |= DLM_PLOCK_FL_CLOSE; in do_unlock_close()
101 send_op(op); in do_unlock_close()
108 struct plock_op *op; in dlm_posix_lock() local
122 op = &xop->xop; in dlm_posix_lock()
123 op->info.optype = DLM_PLOCK_OP_LOCK; in dlm_posix_lock()
124 op->info.pid = fl->fl_pid; in dlm_posix_lock()
125 op->info.ex = (fl->fl_type == F_WRLCK); in dlm_posix_lock()
126 op->info.wait = IS_SETLKW(cmd); in dlm_posix_lock()
127 op->info.fsid = ls->ls_global_id; in dlm_posix_lock()
128 op->info.number = number; in dlm_posix_lock()
129 op->info.start = fl->fl_start; in dlm_posix_lock()
130 op->info.end = fl->fl_end; in dlm_posix_lock()
134 op->info.owner = (__u64) fl->fl_pid; in dlm_posix_lock()
141 op->info.owner = (__u64)(long) fl->fl_owner; in dlm_posix_lock()
145 send_op(op); in dlm_posix_lock()
148 rv = wait_event_interruptible(recv_wq, (op->done != 0)); in dlm_posix_lock()
153 list_del(&op->list); in dlm_posix_lock()
165 if (!list_empty(&op->list)) { in dlm_posix_lock()
168 list_del(&op->list); in dlm_posix_lock()
172 rv = op->info.rv; in dlm_posix_lock()
188 static int dlm_plock_callback(struct plock_op *op) in dlm_plock_callback() argument
194 struct plock_xop *xop = (struct plock_xop *)op; in dlm_plock_callback()
198 if (!list_empty(&op->list)) { in dlm_plock_callback()
200 (unsigned long long)op->info.number); in dlm_plock_callback()
201 list_del(&op->list); in dlm_plock_callback()
211 if (op->info.rv) { in dlm_plock_callback()
212 notify(fl, op->info.rv); in dlm_plock_callback()
228 (unsigned long long)op->info.number, file, fl); in dlm_plock_callback()
248 struct plock_op *op; in dlm_posix_unlock() local
256 op = kzalloc(sizeof(*op), GFP_NOFS); in dlm_posix_unlock()
257 if (!op) { in dlm_posix_unlock()
275 op->info.optype = DLM_PLOCK_OP_UNLOCK; in dlm_posix_unlock()
276 op->info.pid = fl->fl_pid; in dlm_posix_unlock()
277 op->info.fsid = ls->ls_global_id; in dlm_posix_unlock()
278 op->info.number = number; in dlm_posix_unlock()
279 op->info.start = fl->fl_start; in dlm_posix_unlock()
280 op->info.end = fl->fl_end; in dlm_posix_unlock()
282 op->info.owner = (__u64) fl->fl_pid; in dlm_posix_unlock()
284 op->info.owner = (__u64)(long) fl->fl_owner; in dlm_posix_unlock()
287 op->info.flags |= DLM_PLOCK_FL_CLOSE; in dlm_posix_unlock()
288 send_op(op); in dlm_posix_unlock()
293 send_op(op); in dlm_posix_unlock()
294 wait_event(recv_wq, (op->done != 0)); in dlm_posix_unlock()
297 if (!list_empty(&op->list)) { in dlm_posix_unlock()
300 list_del(&op->list); in dlm_posix_unlock()
304 rv = op->info.rv; in dlm_posix_unlock()
310 kfree(op); in dlm_posix_unlock()
322 struct plock_op *op; in dlm_posix_get() local
329 op = kzalloc(sizeof(*op), GFP_NOFS); in dlm_posix_get()
330 if (!op) { in dlm_posix_get()
335 op->info.optype = DLM_PLOCK_OP_GET; in dlm_posix_get()
336 op->info.pid = fl->fl_pid; in dlm_posix_get()
337 op->info.ex = (fl->fl_type == F_WRLCK); in dlm_posix_get()
338 op->info.fsid = ls->ls_global_id; in dlm_posix_get()
339 op->info.number = number; in dlm_posix_get()
340 op->info.start = fl->fl_start; in dlm_posix_get()
341 op->info.end = fl->fl_end; in dlm_posix_get()
343 op->info.owner = (__u64) fl->fl_pid; in dlm_posix_get()
345 op->info.owner = (__u64)(long) fl->fl_owner; in dlm_posix_get()
347 send_op(op); in dlm_posix_get()
348 wait_event(recv_wq, (op->done != 0)); in dlm_posix_get()
351 if (!list_empty(&op->list)) { in dlm_posix_get()
354 list_del(&op->list); in dlm_posix_get()
361 rv = op->info.rv; in dlm_posix_get()
368 fl->fl_type = (op->info.ex) ? F_WRLCK : F_RDLCK; in dlm_posix_get()
370 fl->fl_pid = -op->info.pid; in dlm_posix_get()
371 fl->fl_start = op->info.start; in dlm_posix_get()
372 fl->fl_end = op->info.end; in dlm_posix_get()
376 kfree(op); in dlm_posix_get()
388 struct plock_op *op = NULL; in dev_read() local
395 op = list_entry(send_list.next, struct plock_op, list); in dev_read()
396 if (op->info.flags & DLM_PLOCK_FL_CLOSE) in dev_read()
397 list_del(&op->list); in dev_read()
399 list_move(&op->list, &recv_list); in dev_read()
400 memcpy(&info, &op->info, sizeof(info)); in dev_read()
404 if (!op) in dev_read()
411 if (op->info.flags & DLM_PLOCK_FL_CLOSE) in dev_read()
412 kfree(op); in dev_read()
425 struct plock_op *op; in dev_write() local
438 list_for_each_entry(op, &recv_list, list) { in dev_write()
439 if (op->info.fsid == info.fsid && in dev_write()
440 op->info.number == info.number && in dev_write()
441 op->info.owner == info.owner) { in dev_write()
442 struct plock_xop *xop = (struct plock_xop *)op; in dev_write()
443 list_del_init(&op->list); in dev_write()
444 memcpy(&op->info, &info, sizeof(info)); in dev_write()
448 op->done = 1; in dev_write()
457 dlm_plock_callback(op); in dev_write()