* Remove a byte-range lock on an inode. * * Generally, find the lock (or an overlap to that lock) * and remove it (or shrink it), then wakeup anyone we can. */
| 1547 | * and remove it (or shrink it), then wakeup anyone we can. |
| 1548 | */ |
| 1549 | static int |
| 1550 | lf_clearlock(struct lockf *state, struct lockf_entry *unlock) |
| 1551 | { |
| 1552 | struct lockf_entry *overlap; |
| 1553 | |
| 1554 | overlap = LIST_FIRST(&state->ls_active); |
| 1555 | |
| 1556 | if (overlap == NOLOCKF) |
| 1557 | return (0); |
| 1558 | #ifdef LOCKF_DEBUG |
| 1559 | if (unlock->lf_type != F_UNLCK) |
| 1560 | panic("lf_clearlock: bad type"); |
| 1561 | if (lockf_debug & 1) |
| 1562 | lf_print("lf_clearlock", unlock); |
| 1563 | #endif /* LOCKF_DEBUG */ |
| 1564 | |
| 1565 | lf_activate_lock(state, unlock); |
| 1566 | |
| 1567 | return (0); |
| 1568 | } |
| 1569 | |
| 1570 | /* |
| 1571 | * Check whether there is a blocking lock, and if so return its |
no test coverage detected