Lines Matching refs:info

35 	struct dlm_plock_info info;  member
40 static inline void set_version(struct dlm_plock_info *info) in set_version() argument
42 info->version[0] = DLM_PLOCK_VERSION_MAJOR; in set_version()
43 info->version[1] = DLM_PLOCK_VERSION_MINOR; in set_version()
44 info->version[2] = DLM_PLOCK_VERSION_PATCH; in set_version()
47 static int check_version(struct dlm_plock_info *info) in check_version() argument
49 if ((DLM_PLOCK_VERSION_MAJOR != info->version[0]) || in check_version()
50 (DLM_PLOCK_VERSION_MINOR < info->version[1])) { in check_version()
56 info->version[0], in check_version()
57 info->version[1], in check_version()
58 info->version[2]); in check_version()
72 set_version(&op->info); in send_op()
86 static void do_unlock_close(const struct dlm_plock_info *info) in do_unlock_close() argument
94 op->info.optype = DLM_PLOCK_OP_UNLOCK; in do_unlock_close()
95 op->info.pid = info->pid; in do_unlock_close()
96 op->info.fsid = info->fsid; in do_unlock_close()
97 op->info.number = info->number; in do_unlock_close()
98 op->info.start = 0; in do_unlock_close()
99 op->info.end = OFFSET_MAX; in do_unlock_close()
100 op->info.owner = info->owner; in do_unlock_close()
102 op->info.flags |= DLM_PLOCK_FL_CLOSE; in do_unlock_close()
124 op->info.optype = DLM_PLOCK_OP_LOCK; in dlm_posix_lock()
125 op->info.pid = fl->fl_pid; in dlm_posix_lock()
126 op->info.ex = (fl->fl_type == F_WRLCK); in dlm_posix_lock()
127 op->info.wait = IS_SETLKW(cmd); in dlm_posix_lock()
128 op->info.fsid = ls->ls_global_id; in dlm_posix_lock()
129 op->info.number = number; in dlm_posix_lock()
130 op->info.start = fl->fl_start; in dlm_posix_lock()
131 op->info.end = fl->fl_end; in dlm_posix_lock()
143 op->info.owner = (__u64) fl->fl_pid; in dlm_posix_lock()
156 op->info.owner = (__u64)(long) fl->fl_owner; in dlm_posix_lock()
168 (unsigned long long)number, op->info.pid); in dlm_posix_lock()
170 do_unlock_close(&op->info); in dlm_posix_lock()
182 rv = op->info.rv; in dlm_posix_lock()
210 (unsigned long long)op->info.number); in dlm_plock_callback()
221 if (op->info.rv) { in dlm_plock_callback()
222 notify(fl, op->info.rv); in dlm_plock_callback()
238 (unsigned long long)op->info.number, file, fl); in dlm_plock_callback()
285 op->info.optype = DLM_PLOCK_OP_UNLOCK; in dlm_posix_unlock()
286 op->info.pid = fl->fl_pid; in dlm_posix_unlock()
287 op->info.fsid = ls->ls_global_id; in dlm_posix_unlock()
288 op->info.number = number; in dlm_posix_unlock()
289 op->info.start = fl->fl_start; in dlm_posix_unlock()
290 op->info.end = fl->fl_end; in dlm_posix_unlock()
292 op->info.owner = (__u64) fl->fl_pid; in dlm_posix_unlock()
294 op->info.owner = (__u64)(long) fl->fl_owner; in dlm_posix_unlock()
297 op->info.flags |= DLM_PLOCK_FL_CLOSE; in dlm_posix_unlock()
314 rv = op->info.rv; in dlm_posix_unlock()
345 op->info.optype = DLM_PLOCK_OP_GET; in dlm_posix_get()
346 op->info.pid = fl->fl_pid; in dlm_posix_get()
347 op->info.ex = (fl->fl_type == F_WRLCK); in dlm_posix_get()
348 op->info.fsid = ls->ls_global_id; in dlm_posix_get()
349 op->info.number = number; in dlm_posix_get()
350 op->info.start = fl->fl_start; in dlm_posix_get()
351 op->info.end = fl->fl_end; in dlm_posix_get()
353 op->info.owner = (__u64) fl->fl_pid; in dlm_posix_get()
355 op->info.owner = (__u64)(long) fl->fl_owner; in dlm_posix_get()
371 rv = op->info.rv; in dlm_posix_get()
378 fl->fl_type = (op->info.ex) ? F_WRLCK : F_RDLCK; in dlm_posix_get()
380 fl->fl_pid = op->info.pid; in dlm_posix_get()
381 if (op->info.nodeid != dlm_our_nodeid()) in dlm_posix_get()
383 fl->fl_start = op->info.start; in dlm_posix_get()
384 fl->fl_end = op->info.end; in dlm_posix_get()
399 struct dlm_plock_info info; in dev_read() local
402 if (count < sizeof(info)) in dev_read()
408 if (op->info.flags & DLM_PLOCK_FL_CLOSE) in dev_read()
412 memcpy(&info, &op->info, sizeof(info)); in dev_read()
423 if (op->info.flags & DLM_PLOCK_FL_CLOSE) in dev_read()
426 if (copy_to_user(u, &info, sizeof(info))) in dev_read()
428 return sizeof(info); in dev_read()
437 struct dlm_plock_info info; in dev_write() local
440 if (count != sizeof(info)) in dev_write()
443 if (copy_from_user(&info, u, sizeof(info))) in dev_write()
446 if (check_version(&info)) in dev_write()
456 if (info.wait) { in dev_write()
458 if (iter->info.fsid == info.fsid && in dev_write()
459 iter->info.number == info.number && in dev_write()
460 iter->info.owner == info.owner && in dev_write()
461 iter->info.pid == info.pid && in dev_write()
462 iter->info.start == info.start && in dev_write()
463 iter->info.end == info.end && in dev_write()
464 iter->info.ex == info.ex && in dev_write()
465 iter->info.wait) { in dev_write()
472 if (!iter->info.wait && in dev_write()
473 iter->info.fsid == info.fsid) { in dev_write()
482 if (info.wait) in dev_write()
483 WARN_ON(op->info.optype != DLM_PLOCK_OP_LOCK); in dev_write()
485 WARN_ON(op->info.number != info.number || in dev_write()
486 op->info.owner != info.owner || in dev_write()
487 op->info.optype != info.optype); in dev_write()
490 memcpy(&op->info, &info, sizeof(info)); in dev_write()
505 info.fsid, (unsigned long long)info.number); in dev_write()