pbuf_ctor(): Stop using LK_NOWAIT, use LK_NOWITNESS

The LK_NOWAIT was added to suppress a witness warning, but LK_NOWITNESS
is more what we mean.  This makes pbuf_ctor() more consistent with
buf_alloc(), although, unlike buf_alloc(), for pbuf there should not be
any danger of a wild locker relying on the type stability of the buf to
attempt a lock.  That is, this is essentially cosmetic.

Relevant history:
 - 531f8cfea0 Use dedicated lock name for pbufs
 - 5875b94c74 buf_alloc(): lock the buffer with LK_NOWAIT
 - c9e023541a pbuf_ctor(): lock the buffer with LK_NOWAIT
 - 1fb00c8f10 buf_alloc(): Stop using LK_NOWAIT, use LK_NOWITNESS

Reviewed by:	rew, kib
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D45360
This commit is contained in:
Ryan Libby 2024-05-26 10:20:52 -07:00
parent 6bd3f23a2a
commit 9c975a0d90

View File

@ -470,7 +470,7 @@ pbuf_ctor(void *mem, int size, void *arg, int flags)
bp->b_ioflags = 0;
bp->b_iodone = NULL;
bp->b_error = 0;
BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL);
BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWITNESS, NULL);
return (0);
}