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

Function lf_getblock

freebsd/kern/kern_lockf.c:1656–1673  ·  view source on GitHub ↗

* Walk the list of locks for an inode and * return the first blocking lock. */

Source from the content-addressed store, hash-verified

1654 * return the first blocking lock.
1655 */
1656static struct lockf_entry *
1657lf_getblock(struct lockf *state, struct lockf_entry *lock)
1658{
1659 struct lockf_entry *overlap;
1660
1661 LIST_FOREACH(overlap, &state->ls_active, lf_link) {
1662 /*
1663 * We may assume that the active list is sorted by
1664 * lf_start.
1665 */
1666 if (overlap->lf_start > lock->lf_end)
1667 break;
1668 if (!lf_blocks(lock, overlap))
1669 continue;
1670 return (overlap);
1671 }
1672 return (NOLOCKF);
1673}
1674
1675/*
1676 * Walk the list of locks for an inode to find an overlapping lock (if

Callers 2

lf_setlockFunction · 0.85
lf_getlockFunction · 0.85

Calls 1

lf_blocksFunction · 0.85

Tested by

no test coverage detected