Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Jul 2020 00:13:40 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r363722 - head/sys/kern
Message-ID:  <202007310013.06V0Dei9021408@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Fri Jul 31 00:13:40 2020
New Revision: 363722
URL: https://svnweb.freebsd.org/changeset/base/363722

Log:
  getblk: Remove a non-sensical LK_NOWAIT | LK_SLEEPFAIL
  
  No functional change.
  
  LK_SLEEPFAIL implies a behavior that is only possible if the lock operation can
  sleep.  LK_NOWAIT prevents the lock operation from sleeping.
  
  Discussed with:	kib

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==============================================================================
--- head/sys/kern/vfs_bio.c	Fri Jul 31 00:07:01 2020	(r363721)
+++ head/sys/kern/vfs_bio.c	Fri Jul 31 00:13:40 2020	(r363722)
@@ -3887,10 +3887,8 @@ loop:
 		 * Buffer is in-core.  If the buffer is not busy nor managed,
 		 * it must be on a queue.
 		 */
-		lockflags = LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK;
-
-		if ((flags & GB_LOCK_NOWAIT) != 0)
-			lockflags |= LK_NOWAIT;
+		lockflags = LK_EXCLUSIVE | LK_INTERLOCK |
+		    ((flags & GB_LOCK_NOWAIT) ? LK_NOWAIT : LK_SLEEPFAIL);
 
 		error = BUF_TIMELOCK(bp, lockflags,
 		    BO_LOCKPTR(bo), "getblk", slpflag, slptimeo);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202007310013.06V0Dei9021408>