MCPcopy Create free account
hub / github.com/F-Stack/f-stack / lf_clearlock

Function lf_clearlock

freebsd/kern/kern_lockf.c:1549–1568  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

1547 * and remove it (or shrink it), then wakeup anyone we can.
1548 */
1549static int
1550lf_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

Callers 1

lf_advlockasyncFunction · 0.85

Calls 3

lf_printFunction · 0.85
lf_activate_lockFunction · 0.85
panicFunction · 0.70

Tested by

no test coverage detected