| 2519 | } |
| 2520 | |
| 2521 | static void |
| 2522 | lf_printlist(char *tag, struct lockf_entry *lock) |
| 2523 | { |
| 2524 | struct lockf_entry *lf, *blk; |
| 2525 | struct lockf_edge *e; |
| 2526 | |
| 2527 | if (lock->lf_inode == (struct inode *)0) |
| 2528 | return; |
| 2529 | |
| 2530 | printf("%s: Lock list for ino %ju on dev <%s>:\n", |
| 2531 | tag, (uintmax_t)lock->lf_inode->i_number, |
| 2532 | devtoname(ITODEV(lock->lf_inode))); |
| 2533 | LIST_FOREACH(lf, &lock->lf_vnode->v_lockf->ls_active, lf_link) { |
| 2534 | printf("\tlock %p for ",(void *)lf); |
| 2535 | lf_print_owner(lock->lf_owner); |
| 2536 | printf(", %s, start %jd, end %jd", |
| 2537 | lf->lf_type == F_RDLCK ? "shared" : |
| 2538 | lf->lf_type == F_WRLCK ? "exclusive" : |
| 2539 | lf->lf_type == F_UNLCK ? "unlock" : |
| 2540 | "unknown", (intmax_t)lf->lf_start, (intmax_t)lf->lf_end); |
| 2541 | LIST_FOREACH(e, &lf->lf_outedges, le_outlink) { |
| 2542 | blk = e->le_to; |
| 2543 | printf("\n\t\tlock request %p for ", (void *)blk); |
| 2544 | lf_print_owner(blk->lf_owner); |
| 2545 | printf(", %s, start %jd, end %jd", |
| 2546 | blk->lf_type == F_RDLCK ? "shared" : |
| 2547 | blk->lf_type == F_WRLCK ? "exclusive" : |
| 2548 | blk->lf_type == F_UNLCK ? "unlock" : |
| 2549 | "unknown", (intmax_t)blk->lf_start, |
| 2550 | (intmax_t)blk->lf_end); |
| 2551 | if (!LIST_EMPTY(&blk->lf_inedges)) |
| 2552 | panic("lf_printlist: bad list"); |
| 2553 | } |
| 2554 | printf("\n"); |
| 2555 | } |
| 2556 | } |
| 2557 | #endif /* LOCKF_DEBUG */ |
no test coverage detected