Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Simplify getiobuf. buf_init already does bp->b_obj...



details:   https://anonhg.NetBSD.org/src/rev/8eef85f46e4f
branches:  trunk
changeset: 350762:8eef85f46e4f
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Jan 20 08:16:31 2017 +0000

description:
Simplify getiobuf.  buf_init already does bp->b_objlock == &buffer_lock

diffstat:

 sys/kern/vfs_bio.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (32 lines):

diff -r a509a8115061 -r 8eef85f46e4f sys/kern/vfs_bio.c
--- a/sys/kern/vfs_bio.c        Fri Jan 20 03:16:40 2017 +0000
+++ b/sys/kern/vfs_bio.c        Fri Jan 20 08:16:31 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_bio.c,v 1.267 2016/12/28 06:25:40 pgoyette Exp $   */
+/*     $NetBSD: vfs_bio.c,v 1.268 2017/01/20 08:16:31 skrll Exp $      */
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -123,7 +123,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.267 2016/12/28 06:25:40 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.268 2017/01/20 08:16:31 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bufcache.h"
@@ -1968,10 +1968,10 @@
 
        buf_init(bp);
 
-       if ((bp->b_vp = vp) == NULL)
-               bp->b_objlock = &buffer_lock;
+       if ((bp->b_vp = vp) != NULL) {
+               bp->b_objlock = vp->v_interlock;
        else
-               bp->b_objlock = vp->v_interlock;
+               KASSERT(bp->b_objlock == &buffer_lock);
        
        return bp;
 }



Home | Main Index | Thread Index | Old Index