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

Function lf_alloc_lock

freebsd/kern/kern_lockf.c:336–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334}
335
336static struct lockf_entry *
337lf_alloc_lock(struct lock_owner *lo)
338{
339 struct lockf_entry *lf;
340
341 lf = malloc(sizeof(struct lockf_entry), M_LOCKF, M_WAITOK|M_ZERO);
342
343#ifdef LOCKF_DEBUG
344 if (lockf_debug & 4)
345 printf("Allocated lock %p\n", lf);
346#endif
347 if (lo) {
348 sx_xlock(&lf_lock_owners[lo->lo_hash].lock);
349 lo->lo_refs++;
350 sx_xunlock(&lf_lock_owners[lo->lo_hash].lock);
351 lf->lf_owner = lo;
352 }
353
354 return (lf);
355}
356
357static int
358lf_free_lock(struct lockf_entry *lock)

Callers 2

lf_advlockasyncFunction · 0.85
lf_splitFunction · 0.85

Calls 2

mallocFunction · 0.85
printfFunction · 0.70

Tested by

no test coverage detected