Lines Matching refs:buf
30 static int stringify_lockname(const char *lockname, int locklen, char *buf,
83 char buf[DLM_LOCKID_NAME_MAX]; in __dlm_print_one_lock_resource() local
88 buf, sizeof(buf)); in __dlm_print_one_lock_resource()
90 buf, res->owner, res->state); in __dlm_print_one_lock_resource()
234 static int stringify_lockname(const char *lockname, int locklen, char *buf, in stringify_lockname() argument
245 out += scnprintf(buf + out, len - out, "%.*s%08x", in stringify_lockname()
249 out += scnprintf(buf + out, len - out, "%.*s", in stringify_lockname()
255 char *buf, int len) in stringify_nodemap() argument
261 out += scnprintf(buf + out, len - out, "%d ", i); in stringify_nodemap()
266 static int dump_mle(struct dlm_master_list_entry *mle, char *buf, int len) in dump_mle() argument
278 out += stringify_lockname(mle->mname, mle->mnamelen, buf + out, len - out); in dump_mle()
279 out += scnprintf(buf + out, len - out, in dump_mle()
286 out += scnprintf(buf + out, len - out, "Maybe="); in dump_mle()
288 buf + out, len - out); in dump_mle()
289 out += scnprintf(buf + out, len - out, "\n"); in dump_mle()
291 out += scnprintf(buf + out, len - out, "Vote="); in dump_mle()
293 buf + out, len - out); in dump_mle()
294 out += scnprintf(buf + out, len - out, "\n"); in dump_mle()
296 out += scnprintf(buf + out, len - out, "Response="); in dump_mle()
298 buf + out, len - out); in dump_mle()
299 out += scnprintf(buf + out, len - out, "\n"); in dump_mle()
301 out += scnprintf(buf + out, len - out, "Node="); in dump_mle()
303 buf + out, len - out); in dump_mle()
304 out += scnprintf(buf + out, len - out, "\n"); in dump_mle()
306 out += scnprintf(buf + out, len - out, "\n"); in dump_mle()
313 char *buf; in dlm_print_one_mle() local
315 buf = (char *) get_zeroed_page(GFP_ATOMIC); in dlm_print_one_mle()
316 if (buf) { in dlm_print_one_mle()
317 dump_mle(mle, buf, PAGE_SIZE - 1); in dlm_print_one_mle()
318 free_page((unsigned long)buf); in dlm_print_one_mle()
339 static ssize_t debug_read(struct file *file, char __user *buf, in debug_read() argument
342 return simple_read_from_buffer(buf, nbytes, ppos, file->private_data, in debug_read()
348 static int debug_purgelist_print(struct dlm_ctxt *dlm, char *buf, int len) in debug_purgelist_print() argument
354 out += scnprintf(buf + out, len - out, in debug_purgelist_print()
365 buf + out, len - out); in debug_purgelist_print()
366 out += scnprintf(buf + out, len - out, "\t%ld\n", in debug_purgelist_print()
372 out += scnprintf(buf + out, len - out, "Total on list: %lu\n", total); in debug_purgelist_print()
380 char *buf = NULL; in debug_purgelist_open() local
382 buf = (char *) get_zeroed_page(GFP_NOFS); in debug_purgelist_open()
383 if (!buf) in debug_purgelist_open()
386 i_size_write(inode, debug_purgelist_print(dlm, buf, PAGE_SIZE - 1)); in debug_purgelist_open()
388 file->private_data = buf; in debug_purgelist_open()
404 static int debug_mle_print(struct dlm_ctxt *dlm, char *buf, int len) in debug_mle_print() argument
411 out += scnprintf(buf + out, len - out, in debug_mle_print()
422 out += dump_mle(mle, buf + out, len - out); in debug_mle_print()
429 out += scnprintf(buf + out, len - out, in debug_mle_print()
437 char *buf = NULL; in debug_mle_open() local
439 buf = (char *) get_zeroed_page(GFP_NOFS); in debug_mle_open()
440 if (!buf) in debug_mle_open()
443 i_size_write(inode, debug_mle_print(dlm, buf, PAGE_SIZE - 1)); in debug_mle_open()
445 file->private_data = buf; in debug_mle_open()
462 static int dump_lock(struct dlm_lock *lock, int list_type, char *buf, int len) in dump_lock() argument
468 out = scnprintf(buf, len, "LOCK:%d,%d,%d,%d,%d,%d:%lld,%d,%d,%d,%d,%d," in dump_lock()
486 static int dump_lockres(struct dlm_lock_resource *res, char *buf, int len) in dump_lockres() argument
492 out += scnprintf(buf + out, len - out, "NAME:"); in dump_lockres()
494 buf + out, len - out); in dump_lockres()
495 out += scnprintf(buf + out, len - out, "\n"); in dump_lockres()
498 out += scnprintf(buf + out, len - out, in dump_lockres()
510 out += scnprintf(buf + out, len - out, "RMAP:"); in dump_lockres()
512 buf + out, len - out); in dump_lockres()
513 out += scnprintf(buf + out, len - out, "\n"); in dump_lockres()
516 out += scnprintf(buf + out, len - out, "LVBX:"); in dump_lockres()
518 out += scnprintf(buf + out, len - out, in dump_lockres()
520 out += scnprintf(buf + out, len - out, "\n"); in dump_lockres()
524 out += dump_lock(lock, 0, buf + out, len - out); in dump_lockres()
528 out += dump_lock(lock, 1, buf + out, len - out); in dump_lockres()
532 out += dump_lock(lock, 2, buf + out, len - out); in dump_lockres()
534 out += scnprintf(buf + out, len - out, "\n"); in dump_lockres()
614 void *buf; in debug_lockres_open() local
616 buf = kmalloc(PAGE_SIZE, GFP_KERNEL); in debug_lockres_open()
617 if (!buf) in debug_lockres_open()
625 dl->dl_buf = buf; in debug_lockres_open()
633 kfree(buf); in debug_lockres_open()
660 static int debug_state_print(struct dlm_ctxt *dlm, char *buf, int len) in debug_state_print() argument
684 out += scnprintf(buf + out, len - out, in debug_state_print()
690 out += scnprintf(buf + out, len - out, in debug_state_print()
695 out += scnprintf(buf + out, len - out, in debug_state_print()
700 out += scnprintf(buf + out, len - out, "Domain Map: "); in debug_state_print()
702 buf + out, len - out); in debug_state_print()
703 out += scnprintf(buf + out, len - out, "\n"); in debug_state_print()
706 out += scnprintf(buf + out, len - out, "Exit Domain Map: "); in debug_state_print()
708 buf + out, len - out); in debug_state_print()
709 out += scnprintf(buf + out, len - out, "\n"); in debug_state_print()
712 out += scnprintf(buf + out, len - out, "Live Map: "); in debug_state_print()
714 buf + out, len - out); in debug_state_print()
715 out += scnprintf(buf + out, len - out, "\n"); in debug_state_print()
718 out += scnprintf(buf + out, len - out, in debug_state_print()
730 out += scnprintf(buf + out, len - out, in debug_state_print()
734 out += scnprintf(buf + out, len - out, in debug_state_print()
740 out += scnprintf(buf + out, len - out, in debug_state_print()
746 out += scnprintf(buf + out, len - out, in debug_state_print()
752 out += scnprintf(buf + out, len - out, in debug_state_print()
761 out += scnprintf(buf + out, len - out, in debug_state_print()
766 out += scnprintf(buf + out, len - out, in debug_state_print()
776 out += scnprintf(buf + out, len - out, in debug_state_print()
782 out += scnprintf(buf + out, len - out, "Recovery Map: "); in debug_state_print()
784 buf + out, len - out); in debug_state_print()
785 out += scnprintf(buf + out, len - out, "\n"); in debug_state_print()
788 out += scnprintf(buf + out, len - out, "Recovery Node State:\n"); in debug_state_print()
816 out += scnprintf(buf + out, len - out, "\t%u - %s\n", in debug_state_print()
828 char *buf = NULL; in debug_state_open() local
830 buf = (char *) get_zeroed_page(GFP_NOFS); in debug_state_open()
831 if (!buf) in debug_state_open()
834 i_size_write(inode, debug_state_print(dlm, buf, PAGE_SIZE - 1)); in debug_state_open()
836 file->private_data = buf; in debug_state_open()