HomeFreeBSD

lockf: Avoid spinning when operating on an fd

Description

lockf: Avoid spinning when operating on an fd

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.

Approved by: re (cperciva)
PR: 294832
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D56722

(cherry picked from commit d90513ea85693da0ca5955173609f4e81e38ae16)
(cherry picked from commit 651b82e64ef4f753d8f4c1793f359de39744526c)

Details

Provenance
Christian Ullrich <chris@chrullrich.net>Authored on Sun, May 3, 3:35 PM
cpercivaCommitted on Wed, May 6, 4:30 PM
Reviewer
markj
Differential Revision
D56722: lockf: Avoid spinning when operating on an fd
Parents
rGc4be32aabf91: tail(1): Fix -r (reverse) to work on pseudo filesystems
Branches
Unknown
Tags
Unknown