Page MenuHomeFreeBSD

lockf: Avoid spinning when operating on an fd
ClosedPublic

Authored by des on Wed, Apr 29, 10:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 14, 2:50 PM
Unknown Object (File)
Thu, May 14, 1:29 PM
Unknown Object (File)
Wed, May 13, 9:24 PM
Unknown Object (File)
Wed, May 13, 9:24 PM
Unknown Object (File)
Wed, May 13, 1:49 PM
Unknown Object (File)
Tue, May 12, 11:37 AM
Unknown Object (File)
Tue, May 12, 11:37 AM
Unknown Object (File)
Mon, May 11, 1:48 PM
Subscribers

Details

Summary

When operating on a file descriptor, acquire_lock() would ignore the
flags argument and always operate in non-blocking mode, resulting in
unnecessary busy-looping.

PR: 294832
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Wed, Apr 29, 10:50 PM
markj added a subscriber: markj.
markj added inline comments.
usr.bin/lockf/lockf.c
322–324

Better would be to declare lflags in this block, it's only used there.

This revision is now accepted and ready to land.Sat, May 2, 5:28 PM
This revision now requires review to proceed.Sat, May 2, 6:52 PM
This revision is now accepted and ready to land.Sun, May 3, 3:25 PM