Lines Matching refs:op
61 static void send_op(struct plock_op *op) in send_op() argument
63 set_version(&op->info); in send_op()
64 INIT_LIST_HEAD(&op->list); in send_op()
66 list_add_tail(&op->list, &send_list); in send_op()
80 struct plock_op *op; in do_unlock_close() local
82 op = kzalloc(sizeof(*op), GFP_NOFS); in do_unlock_close()
83 if (!op) in do_unlock_close()
86 op->info.optype = DLM_PLOCK_OP_UNLOCK; in do_unlock_close()
87 op->info.pid = fl->fl_pid; in do_unlock_close()
88 op->info.fsid = ls->ls_global_id; in do_unlock_close()
89 op->info.number = number; in do_unlock_close()
90 op->info.start = 0; in do_unlock_close()
91 op->info.end = OFFSET_MAX; in do_unlock_close()
93 op->info.owner = (__u64) fl->fl_pid; in do_unlock_close()
95 op->info.owner = (__u64)(long) fl->fl_owner; in do_unlock_close()
97 op->info.flags |= DLM_PLOCK_FL_CLOSE; in do_unlock_close()
98 send_op(op); in do_unlock_close()
105 struct plock_op *op; in dlm_posix_lock() local
119 op = &xop->xop; in dlm_posix_lock()
120 op->info.optype = DLM_PLOCK_OP_LOCK; in dlm_posix_lock()
121 op->info.pid = fl->fl_pid; in dlm_posix_lock()
122 op->info.ex = (fl->fl_type == F_WRLCK); in dlm_posix_lock()
123 op->info.wait = IS_SETLKW(cmd); in dlm_posix_lock()
124 op->info.fsid = ls->ls_global_id; in dlm_posix_lock()
125 op->info.number = number; in dlm_posix_lock()
126 op->info.start = fl->fl_start; in dlm_posix_lock()
127 op->info.end = fl->fl_end; in dlm_posix_lock()
131 op->info.owner = (__u64) fl->fl_pid; in dlm_posix_lock()
138 op->info.owner = (__u64)(long) fl->fl_owner; in dlm_posix_lock()
142 send_op(op); in dlm_posix_lock()
145 rv = wait_event_interruptible(recv_wq, (op->done != 0)); in dlm_posix_lock()
150 list_del(&op->list); in dlm_posix_lock()
162 if (!list_empty(&op->list)) { in dlm_posix_lock()
165 list_del(&op->list); in dlm_posix_lock()
169 rv = op->info.rv; in dlm_posix_lock()
185 static int dlm_plock_callback(struct plock_op *op) in dlm_plock_callback() argument
191 struct plock_xop *xop = (struct plock_xop *)op; in dlm_plock_callback()
195 if (!list_empty(&op->list)) { in dlm_plock_callback()
197 (unsigned long long)op->info.number); in dlm_plock_callback()
198 list_del(&op->list); in dlm_plock_callback()
208 if (op->info.rv) { in dlm_plock_callback()
209 notify(fl, op->info.rv); in dlm_plock_callback()
225 (unsigned long long)op->info.number, file, fl); in dlm_plock_callback()
245 struct plock_op *op; in dlm_posix_unlock() local
253 op = kzalloc(sizeof(*op), GFP_NOFS); in dlm_posix_unlock()
254 if (!op) { in dlm_posix_unlock()
272 op->info.optype = DLM_PLOCK_OP_UNLOCK; in dlm_posix_unlock()
273 op->info.pid = fl->fl_pid; in dlm_posix_unlock()
274 op->info.fsid = ls->ls_global_id; in dlm_posix_unlock()
275 op->info.number = number; in dlm_posix_unlock()
276 op->info.start = fl->fl_start; in dlm_posix_unlock()
277 op->info.end = fl->fl_end; in dlm_posix_unlock()
279 op->info.owner = (__u64) fl->fl_pid; in dlm_posix_unlock()
281 op->info.owner = (__u64)(long) fl->fl_owner; in dlm_posix_unlock()
284 op->info.flags |= DLM_PLOCK_FL_CLOSE; in dlm_posix_unlock()
285 send_op(op); in dlm_posix_unlock()
290 send_op(op); in dlm_posix_unlock()
291 wait_event(recv_wq, (op->done != 0)); in dlm_posix_unlock()
294 if (!list_empty(&op->list)) { in dlm_posix_unlock()
297 list_del(&op->list); in dlm_posix_unlock()
301 rv = op->info.rv; in dlm_posix_unlock()
307 kfree(op); in dlm_posix_unlock()
319 struct plock_op *op; in dlm_posix_get() local
326 op = kzalloc(sizeof(*op), GFP_NOFS); in dlm_posix_get()
327 if (!op) { in dlm_posix_get()
332 op->info.optype = DLM_PLOCK_OP_GET; in dlm_posix_get()
333 op->info.pid = fl->fl_pid; in dlm_posix_get()
334 op->info.ex = (fl->fl_type == F_WRLCK); in dlm_posix_get()
335 op->info.fsid = ls->ls_global_id; in dlm_posix_get()
336 op->info.number = number; in dlm_posix_get()
337 op->info.start = fl->fl_start; in dlm_posix_get()
338 op->info.end = fl->fl_end; in dlm_posix_get()
340 op->info.owner = (__u64) fl->fl_pid; in dlm_posix_get()
342 op->info.owner = (__u64)(long) fl->fl_owner; in dlm_posix_get()
344 send_op(op); in dlm_posix_get()
345 wait_event(recv_wq, (op->done != 0)); in dlm_posix_get()
348 if (!list_empty(&op->list)) { in dlm_posix_get()
351 list_del(&op->list); in dlm_posix_get()
358 rv = op->info.rv; in dlm_posix_get()
365 fl->fl_type = (op->info.ex) ? F_WRLCK : F_RDLCK; in dlm_posix_get()
367 fl->fl_pid = -op->info.pid; in dlm_posix_get()
368 fl->fl_start = op->info.start; in dlm_posix_get()
369 fl->fl_end = op->info.end; in dlm_posix_get()
373 kfree(op); in dlm_posix_get()
385 struct plock_op *op = NULL; in dev_read() local
392 op = list_entry(send_list.next, struct plock_op, list); in dev_read()
393 if (op->info.flags & DLM_PLOCK_FL_CLOSE) in dev_read()
394 list_del(&op->list); in dev_read()
396 list_move(&op->list, &recv_list); in dev_read()
397 memcpy(&info, &op->info, sizeof(info)); in dev_read()
401 if (!op) in dev_read()
408 if (op->info.flags & DLM_PLOCK_FL_CLOSE) in dev_read()
409 kfree(op); in dev_read()
422 struct plock_op *op; in dev_write() local
435 list_for_each_entry(op, &recv_list, list) { in dev_write()
436 if (op->info.fsid == info.fsid && in dev_write()
437 op->info.number == info.number && in dev_write()
438 op->info.owner == info.owner) { in dev_write()
439 struct plock_xop *xop = (struct plock_xop *)op; in dev_write()
440 list_del_init(&op->list); in dev_write()
441 memcpy(&op->info, &info, sizeof(info)); in dev_write()
445 op->done = 1; in dev_write()
454 dlm_plock_callback(op); in dev_write()