Lines Matching refs:op
63 static void dlm_release_plock_op(struct plock_op *op) in dlm_release_plock_op() argument
65 kfree(op->data); in dlm_release_plock_op()
66 kfree(op); in dlm_release_plock_op()
69 static void send_op(struct plock_op *op) in send_op() argument
71 set_version(&op->info); in send_op()
73 list_add_tail(&op->list, &send_list); in send_op()
86 struct plock_op *op; in do_unlock_close() local
88 op = kzalloc(sizeof(*op), GFP_NOFS); in do_unlock_close()
89 if (!op) in do_unlock_close()
92 op->info.optype = DLM_PLOCK_OP_UNLOCK; in do_unlock_close()
93 op->info.pid = info->pid; in do_unlock_close()
94 op->info.fsid = info->fsid; in do_unlock_close()
95 op->info.number = info->number; in do_unlock_close()
96 op->info.start = 0; in do_unlock_close()
97 op->info.end = OFFSET_MAX; in do_unlock_close()
98 op->info.owner = info->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()
109 struct plock_op *op; in dlm_posix_lock() local
116 op = kzalloc(sizeof(*op), GFP_NOFS); in dlm_posix_lock()
117 if (!op) { in dlm_posix_lock()
122 op->info.optype = DLM_PLOCK_OP_LOCK; in dlm_posix_lock()
123 op->info.pid = fl->fl_pid; in dlm_posix_lock()
124 op->info.ex = (fl->fl_type == F_WRLCK); in dlm_posix_lock()
125 op->info.wait = IS_SETLKW(cmd); in dlm_posix_lock()
126 op->info.fsid = ls->ls_global_id; in dlm_posix_lock()
127 op->info.number = number; in dlm_posix_lock()
128 op->info.start = fl->fl_start; in dlm_posix_lock()
129 op->info.end = fl->fl_end; in dlm_posix_lock()
134 dlm_release_plock_op(op); in dlm_posix_lock()
141 op->info.owner = (__u64) fl->fl_pid; in dlm_posix_lock()
148 op->data = op_data; in dlm_posix_lock()
150 send_op(op); in dlm_posix_lock()
154 op->info.owner = (__u64)(long) fl->fl_owner; in dlm_posix_lock()
157 send_op(op); in dlm_posix_lock()
159 rv = wait_event_interruptible(recv_wq, (op->done != 0)); in dlm_posix_lock()
165 if (op->done != 0) { in dlm_posix_lock()
170 op->sigint = true; in dlm_posix_lock()
174 (unsigned long long)number, op->info.pid); in dlm_posix_lock()
180 WARN_ON(!list_empty(&op->list)); in dlm_posix_lock()
182 rv = op->info.rv; in dlm_posix_lock()
190 dlm_release_plock_op(op); in dlm_posix_lock()
198 static int dlm_plock_callback(struct plock_op *op) in dlm_plock_callback() argument
200 struct plock_async_data *op_data = op->data; in dlm_plock_callback()
207 WARN_ON(!list_empty(&op->list)); in dlm_plock_callback()
215 if (op->info.rv) { in dlm_plock_callback()
216 notify(fl, op->info.rv); in dlm_plock_callback()
232 (unsigned long long)op->info.number, file, fl); in dlm_plock_callback()
244 dlm_release_plock_op(op); in dlm_plock_callback()
252 struct plock_op *op; in dlm_posix_unlock() local
260 op = kzalloc(sizeof(*op), GFP_NOFS); in dlm_posix_unlock()
261 if (!op) { in dlm_posix_unlock()
279 op->info.optype = DLM_PLOCK_OP_UNLOCK; in dlm_posix_unlock()
280 op->info.pid = fl->fl_pid; in dlm_posix_unlock()
281 op->info.fsid = ls->ls_global_id; in dlm_posix_unlock()
282 op->info.number = number; in dlm_posix_unlock()
283 op->info.start = fl->fl_start; in dlm_posix_unlock()
284 op->info.end = fl->fl_end; in dlm_posix_unlock()
286 op->info.owner = (__u64) fl->fl_pid; in dlm_posix_unlock()
288 op->info.owner = (__u64)(long) fl->fl_owner; in dlm_posix_unlock()
291 op->info.flags |= DLM_PLOCK_FL_CLOSE; in dlm_posix_unlock()
292 send_op(op); in dlm_posix_unlock()
297 send_op(op); in dlm_posix_unlock()
298 wait_event(recv_wq, (op->done != 0)); in dlm_posix_unlock()
300 WARN_ON(!list_empty(&op->list)); in dlm_posix_unlock()
302 rv = op->info.rv; in dlm_posix_unlock()
308 dlm_release_plock_op(op); in dlm_posix_unlock()
320 struct plock_op *op; in dlm_posix_get() local
327 op = kzalloc(sizeof(*op), GFP_NOFS); in dlm_posix_get()
328 if (!op) { in dlm_posix_get()
333 op->info.optype = DLM_PLOCK_OP_GET; in dlm_posix_get()
334 op->info.pid = fl->fl_pid; in dlm_posix_get()
335 op->info.ex = (fl->fl_type == F_WRLCK); in dlm_posix_get()
336 op->info.fsid = ls->ls_global_id; in dlm_posix_get()
337 op->info.number = number; in dlm_posix_get()
338 op->info.start = fl->fl_start; in dlm_posix_get()
339 op->info.end = fl->fl_end; in dlm_posix_get()
341 op->info.owner = (__u64) fl->fl_pid; in dlm_posix_get()
343 op->info.owner = (__u64)(long) fl->fl_owner; in dlm_posix_get()
345 send_op(op); in dlm_posix_get()
346 wait_event(recv_wq, (op->done != 0)); in dlm_posix_get()
348 WARN_ON(!list_empty(&op->list)); in dlm_posix_get()
353 rv = op->info.rv; in dlm_posix_get()
360 fl->fl_type = (op->info.ex) ? F_WRLCK : F_RDLCK; in dlm_posix_get()
362 fl->fl_pid = -op->info.pid; in dlm_posix_get()
363 fl->fl_start = op->info.start; in dlm_posix_get()
364 fl->fl_end = op->info.end; in dlm_posix_get()
368 dlm_release_plock_op(op); in dlm_posix_get()
380 struct plock_op *op = NULL; in dev_read() local
387 op = list_first_entry(&send_list, struct plock_op, list); in dev_read()
388 if (op->info.flags & DLM_PLOCK_FL_CLOSE) in dev_read()
389 list_del(&op->list); in dev_read()
391 list_move(&op->list, &recv_list); in dev_read()
392 memcpy(&info, &op->info, sizeof(info)); in dev_read()
396 if (!op) in dev_read()
403 if (op->info.flags & DLM_PLOCK_FL_CLOSE) in dev_read()
404 dlm_release_plock_op(op); in dev_read()
416 struct plock_op *op = NULL, *iter; in dev_write() local
453 op = iter; in dev_write()
459 if (op) { in dev_write()
461 dlm_plock_callback(op); in dev_write()