Lines Matching refs:op

64 static void dlm_release_plock_op(struct plock_op *op)  in dlm_release_plock_op()  argument
66 kfree(op->data); in dlm_release_plock_op()
67 kfree(op); in dlm_release_plock_op()
70 static void send_op(struct plock_op *op) in send_op() argument
72 set_version(&op->info); in send_op()
74 list_add_tail(&op->list, &send_list); in send_op()
87 struct plock_op *op; in do_unlock_close() local
89 op = kzalloc(sizeof(*op), GFP_NOFS); in do_unlock_close()
90 if (!op) in do_unlock_close()
93 op->info.optype = DLM_PLOCK_OP_UNLOCK; in do_unlock_close()
94 op->info.pid = info->pid; in do_unlock_close()
95 op->info.fsid = info->fsid; in do_unlock_close()
96 op->info.number = info->number; in do_unlock_close()
97 op->info.start = 0; in do_unlock_close()
98 op->info.end = OFFSET_MAX; in do_unlock_close()
99 op->info.owner = info->owner; in do_unlock_close()
101 op->info.flags |= DLM_PLOCK_FL_CLOSE; in do_unlock_close()
102 send_op(op); in do_unlock_close()
110 struct plock_op *op; in dlm_posix_lock() local
117 op = kzalloc(sizeof(*op), GFP_NOFS); in dlm_posix_lock()
118 if (!op) { 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()
135 dlm_release_plock_op(op); in dlm_posix_lock()
142 op->info.owner = (__u64) fl->fl_pid; in dlm_posix_lock()
149 op->data = op_data; in dlm_posix_lock()
151 send_op(op); in dlm_posix_lock()
155 op->info.owner = (__u64)(long) fl->fl_owner; in dlm_posix_lock()
158 send_op(op); in dlm_posix_lock()
160 rv = wait_event_interruptible(recv_wq, (op->done != 0)); in dlm_posix_lock()
166 if (op->done != 0) { in dlm_posix_lock()
171 op->sigint = true; in dlm_posix_lock()
175 (unsigned long long)number, op->info.pid); in dlm_posix_lock()
181 WARN_ON(!list_empty(&op->list)); in dlm_posix_lock()
183 rv = op->info.rv; in dlm_posix_lock()
191 dlm_release_plock_op(op); in dlm_posix_lock()
199 static int dlm_plock_callback(struct plock_op *op) in dlm_plock_callback() argument
201 struct plock_async_data *op_data = op->data; in dlm_plock_callback()
208 WARN_ON(!list_empty(&op->list)); in dlm_plock_callback()
216 if (op->info.rv) { in dlm_plock_callback()
217 notify(fl, op->info.rv); in dlm_plock_callback()
233 (unsigned long long)op->info.number, file, fl); in dlm_plock_callback()
245 dlm_release_plock_op(op); in dlm_plock_callback()
253 struct plock_op *op; in dlm_posix_unlock() local
261 op = kzalloc(sizeof(*op), GFP_NOFS); in dlm_posix_unlock()
262 if (!op) { in dlm_posix_unlock()
280 op->info.optype = DLM_PLOCK_OP_UNLOCK; in dlm_posix_unlock()
281 op->info.pid = fl->fl_pid; in dlm_posix_unlock()
282 op->info.fsid = ls->ls_global_id; in dlm_posix_unlock()
283 op->info.number = number; in dlm_posix_unlock()
284 op->info.start = fl->fl_start; in dlm_posix_unlock()
285 op->info.end = fl->fl_end; in dlm_posix_unlock()
287 op->info.owner = (__u64) fl->fl_pid; in dlm_posix_unlock()
289 op->info.owner = (__u64)(long) fl->fl_owner; in dlm_posix_unlock()
292 op->info.flags |= DLM_PLOCK_FL_CLOSE; in dlm_posix_unlock()
293 send_op(op); in dlm_posix_unlock()
298 send_op(op); in dlm_posix_unlock()
299 wait_event(recv_wq, (op->done != 0)); in dlm_posix_unlock()
301 WARN_ON(!list_empty(&op->list)); in dlm_posix_unlock()
303 rv = op->info.rv; in dlm_posix_unlock()
309 dlm_release_plock_op(op); in dlm_posix_unlock()
321 struct plock_op *op; in dlm_posix_get() local
328 op = kzalloc(sizeof(*op), GFP_NOFS); in dlm_posix_get()
329 if (!op) { in dlm_posix_get()
334 op->info.optype = DLM_PLOCK_OP_GET; in dlm_posix_get()
335 op->info.pid = fl->fl_pid; in dlm_posix_get()
336 op->info.ex = (fl->fl_type == F_WRLCK); in dlm_posix_get()
337 op->info.fsid = ls->ls_global_id; in dlm_posix_get()
338 op->info.number = number; in dlm_posix_get()
339 op->info.start = fl->fl_start; in dlm_posix_get()
340 op->info.end = fl->fl_end; in dlm_posix_get()
342 op->info.owner = (__u64) fl->fl_pid; in dlm_posix_get()
344 op->info.owner = (__u64)(long) fl->fl_owner; in dlm_posix_get()
346 send_op(op); in dlm_posix_get()
347 wait_event(recv_wq, (op->done != 0)); in dlm_posix_get()
349 WARN_ON(!list_empty(&op->list)); in dlm_posix_get()
354 rv = op->info.rv; in dlm_posix_get()
361 fl->fl_type = (op->info.ex) ? F_WRLCK : F_RDLCK; in dlm_posix_get()
363 fl->fl_pid = -op->info.pid; in dlm_posix_get()
364 fl->fl_start = op->info.start; in dlm_posix_get()
365 fl->fl_end = op->info.end; in dlm_posix_get()
369 dlm_release_plock_op(op); in dlm_posix_get()
381 struct plock_op *op = NULL; in dev_read() local
388 op = list_first_entry(&send_list, struct plock_op, list); in dev_read()
389 if (op->info.flags & DLM_PLOCK_FL_CLOSE) in dev_read()
390 list_del(&op->list); in dev_read()
392 list_move(&op->list, &recv_list); in dev_read()
393 memcpy(&info, &op->info, sizeof(info)); in dev_read()
397 if (!op) in dev_read()
404 if (op->info.flags & DLM_PLOCK_FL_CLOSE) in dev_read()
405 dlm_release_plock_op(op); in dev_read()
417 struct plock_op *op = NULL, *iter; in dev_write() local
454 op = iter; in dev_write()
460 if (op) { in dev_write()
462 dlm_plock_callback(op); in dev_write()