Lines Matching refs:buf

47 static int stringify_lockname(const char *lockname, int locklen, char *buf,
100 char buf[DLM_LOCKID_NAME_MAX]; in __dlm_print_one_lock_resource() local
105 buf, sizeof(buf)); in __dlm_print_one_lock_resource()
107 buf, res->owner, res->state); in __dlm_print_one_lock_resource()
251 static int stringify_lockname(const char *lockname, int locklen, char *buf, in stringify_lockname() argument
262 out += snprintf(buf + out, len - out, "%.*s%08x", in stringify_lockname()
266 out += snprintf(buf + out, len - out, "%.*s", in stringify_lockname()
272 char *buf, int len) in stringify_nodemap() argument
278 out += snprintf(buf + out, len - out, "%d ", i); in stringify_nodemap()
283 static int dump_mle(struct dlm_master_list_entry *mle, char *buf, int len) in dump_mle() argument
295 out += stringify_lockname(mle->mname, mle->mnamelen, buf + out, len - out); in dump_mle()
296 out += snprintf(buf + out, len - out, in dump_mle()
303 out += snprintf(buf + out, len - out, "Maybe="); in dump_mle()
305 buf + out, len - out); in dump_mle()
306 out += snprintf(buf + out, len - out, "\n"); in dump_mle()
308 out += snprintf(buf + out, len - out, "Vote="); in dump_mle()
310 buf + out, len - out); in dump_mle()
311 out += snprintf(buf + out, len - out, "\n"); in dump_mle()
313 out += snprintf(buf + out, len - out, "Response="); in dump_mle()
315 buf + out, len - out); in dump_mle()
316 out += snprintf(buf + out, len - out, "\n"); in dump_mle()
318 out += snprintf(buf + out, len - out, "Node="); in dump_mle()
320 buf + out, len - out); in dump_mle()
321 out += snprintf(buf + out, len - out, "\n"); in dump_mle()
323 out += snprintf(buf + out, len - out, "\n"); in dump_mle()
330 char *buf; in dlm_print_one_mle() local
332 buf = (char *) get_zeroed_page(GFP_NOFS); in dlm_print_one_mle()
333 if (buf) { in dlm_print_one_mle()
334 dump_mle(mle, buf, PAGE_SIZE - 1); in dlm_print_one_mle()
335 free_page((unsigned long)buf); in dlm_print_one_mle()
376 static ssize_t debug_read(struct file *file, char __user *buf, in debug_read() argument
379 return simple_read_from_buffer(buf, nbytes, ppos, file->private_data, in debug_read()
385 static int debug_purgelist_print(struct dlm_ctxt *dlm, char *buf, int len) in debug_purgelist_print() argument
391 out += snprintf(buf + out, len - out, in debug_purgelist_print()
402 buf + out, len - out); in debug_purgelist_print()
403 out += snprintf(buf + out, len - out, "\t%ld\n", in debug_purgelist_print()
409 out += snprintf(buf + out, len - out, "Total on list: %lu\n", total); in debug_purgelist_print()
417 char *buf = NULL; in debug_purgelist_open() local
419 buf = (char *) get_zeroed_page(GFP_NOFS); in debug_purgelist_open()
420 if (!buf) in debug_purgelist_open()
423 i_size_write(inode, debug_purgelist_print(dlm, buf, PAGE_SIZE - 1)); in debug_purgelist_open()
425 file->private_data = buf; in debug_purgelist_open()
441 static int debug_mle_print(struct dlm_ctxt *dlm, char *buf, int len) in debug_mle_print() argument
448 out += snprintf(buf + out, len - out, in debug_mle_print()
459 out += dump_mle(mle, buf + out, len - out); in debug_mle_print()
466 out += snprintf(buf + out, len - out, in debug_mle_print()
474 char *buf = NULL; in debug_mle_open() local
476 buf = (char *) get_zeroed_page(GFP_NOFS); in debug_mle_open()
477 if (!buf) in debug_mle_open()
480 i_size_write(inode, debug_mle_print(dlm, buf, PAGE_SIZE - 1)); in debug_mle_open()
482 file->private_data = buf; in debug_mle_open()
499 static int dump_lock(struct dlm_lock *lock, int list_type, char *buf, int len) in dump_lock() argument
505 out = snprintf(buf, len, "LOCK:%d,%d,%d,%d,%d,%d:%lld,%d,%d,%d,%d,%d," in dump_lock()
523 static int dump_lockres(struct dlm_lock_resource *res, char *buf, int len) in dump_lockres() argument
529 out += snprintf(buf + out, len - out, "NAME:"); in dump_lockres()
531 buf + out, len - out); in dump_lockres()
532 out += snprintf(buf + out, len - out, "\n"); in dump_lockres()
535 out += snprintf(buf + out, len - out, in dump_lockres()
547 out += snprintf(buf + out, len - out, "RMAP:"); in dump_lockres()
549 buf + out, len - out); in dump_lockres()
550 out += snprintf(buf + out, len - out, "\n"); in dump_lockres()
553 out += snprintf(buf + out, len - out, "LVBX:"); in dump_lockres()
555 out += snprintf(buf + out, len - out, in dump_lockres()
557 out += snprintf(buf + out, len - out, "\n"); in dump_lockres()
561 out += dump_lock(lock, 0, buf + out, len - out); in dump_lockres()
565 out += dump_lock(lock, 1, buf + out, len - out); in dump_lockres()
569 out += dump_lock(lock, 2, buf + out, len - out); in dump_lockres()
571 out += snprintf(buf + out, len - out, "\n"); in dump_lockres()
651 void *buf; in debug_lockres_open() local
653 buf = kmalloc(PAGE_SIZE, GFP_KERNEL); in debug_lockres_open()
654 if (!buf) in debug_lockres_open()
662 dl->dl_buf = buf; in debug_lockres_open()
670 kfree(buf); in debug_lockres_open()
697 static int debug_state_print(struct dlm_ctxt *dlm, char *buf, int len) in debug_state_print() argument
721 out += snprintf(buf + out, len - out, in debug_state_print()
727 out += snprintf(buf + out, len - out, in debug_state_print()
732 out += snprintf(buf + out, len - out, in debug_state_print()
737 out += snprintf(buf + out, len - out, "Domain Map: "); in debug_state_print()
739 buf + out, len - out); in debug_state_print()
740 out += snprintf(buf + out, len - out, "\n"); in debug_state_print()
743 out += snprintf(buf + out, len - out, "Exit Domain Map: "); in debug_state_print()
745 buf + out, len - out); in debug_state_print()
746 out += snprintf(buf + out, len - out, "\n"); in debug_state_print()
749 out += snprintf(buf + out, len - out, "Live Map: "); in debug_state_print()
751 buf + out, len - out); in debug_state_print()
752 out += snprintf(buf + out, len - out, "\n"); in debug_state_print()
755 out += snprintf(buf + out, len - out, in debug_state_print()
767 out += snprintf(buf + out, len - out, in debug_state_print()
771 out += snprintf(buf + out, len - out, in debug_state_print()
777 out += snprintf(buf + out, len - out, in debug_state_print()
783 out += snprintf(buf + out, len - out, in debug_state_print()
789 out += snprintf(buf + out, len - out, in debug_state_print()
798 out += snprintf(buf + out, len - out, in debug_state_print()
803 out += snprintf(buf + out, len - out, in debug_state_print()
813 out += snprintf(buf + out, len - out, in debug_state_print()
819 out += snprintf(buf + out, len - out, "Recovery Map: "); in debug_state_print()
821 buf + out, len - out); in debug_state_print()
822 out += snprintf(buf + out, len - out, "\n"); in debug_state_print()
825 out += snprintf(buf + out, len - out, "Recovery Node State:\n"); in debug_state_print()
853 out += snprintf(buf + out, len - out, "\t%u - %s\n", in debug_state_print()
865 char *buf = NULL; in debug_state_open() local
867 buf = (char *) get_zeroed_page(GFP_NOFS); in debug_state_open()
868 if (!buf) in debug_state_open()
871 i_size_write(inode, debug_state_print(dlm, buf, PAGE_SIZE - 1)); in debug_state_open()
873 file->private_data = buf; in debug_state_open()