* Print out a lock. */
| 2493 | * Print out a lock. |
| 2494 | */ |
| 2495 | static void |
| 2496 | lf_print(char *tag, struct lockf_entry *lock) |
| 2497 | { |
| 2498 | |
| 2499 | printf("%s: lock %p for ", tag, (void *)lock); |
| 2500 | lf_print_owner(lock->lf_owner); |
| 2501 | if (lock->lf_inode != (struct inode *)0) |
| 2502 | printf(" in ino %ju on dev <%s>,", |
| 2503 | (uintmax_t)lock->lf_inode->i_number, |
| 2504 | devtoname(ITODEV(lock->lf_inode))); |
| 2505 | printf(" %s, start %jd, end ", |
| 2506 | lock->lf_type == F_RDLCK ? "shared" : |
| 2507 | lock->lf_type == F_WRLCK ? "exclusive" : |
| 2508 | lock->lf_type == F_UNLCK ? "unlock" : "unknown", |
| 2509 | (intmax_t)lock->lf_start); |
| 2510 | if (lock->lf_end == OFF_MAX) |
| 2511 | printf("EOF"); |
| 2512 | else |
| 2513 | printf("%jd", (intmax_t)lock->lf_end); |
| 2514 | if (!LIST_EMPTY(&lock->lf_outedges)) |
| 2515 | printf(" block %p\n", |
| 2516 | (void *)LIST_FIRST(&lock->lf_outedges)->le_to); |
| 2517 | else |
| 2518 | printf("\n"); |
| 2519 | } |
| 2520 | |
| 2521 | static void |
| 2522 | lf_printlist(char *tag, struct lockf_entry *lock) |
no test coverage detected