Source-Changes-HG archive

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

[src/trunk]: src/sys/miscfs/specfs specfs: Omit needless vdead_check in spec_...



details:   https://anonhg.NetBSD.org/src/rev/ccc17d26c25e
branches:  trunk
changeset: 364509:ccc17d26c25e
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Mar 28 12:36:18 2022 +0000

description:
specfs: Omit needless vdead_check in spec_fdiscard.

The vnode lock is held, so the vnode cannot be revoked without also
changing v_op so subsequent uses under the vnode lock will go to
deadfs's VOP_FDISCARD instead (which is genfs_eopnotsupp).

diffstat:

 sys/miscfs/specfs/spec_vnops.c |  16 +++-------------
 1 files changed, 3 insertions(+), 13 deletions(-)

diffs (37 lines):

diff -r 3631141f65f0 -r ccc17d26c25e sys/miscfs/specfs/spec_vnops.c
--- a/sys/miscfs/specfs/spec_vnops.c    Mon Mar 28 12:36:09 2022 +0000
+++ b/sys/miscfs/specfs/spec_vnops.c    Mon Mar 28 12:36:18 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spec_vnops.c,v 1.198 2022/03/28 12:36:09 riastradh Exp $       */
+/*     $NetBSD: spec_vnops.c,v 1.199 2022/03/28 12:36:18 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.198 2022/03/28 12:36:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.199 2022/03/28 12:36:18 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -945,17 +945,7 @@
        dev_t dev;
 
        vp = ap->a_vp;
-       dev = NODEV;
-
-       mutex_enter(vp->v_interlock);
-       if (vdead_check(vp, VDEAD_NOWAIT) == 0 && vp->v_specnode != NULL) {
-               dev = vp->v_rdev;
-       }
-       mutex_exit(vp->v_interlock);
-
-       if (dev == NODEV) {
-               return ENXIO;
-       }
+       dev = vp->v_rdev;
 
        switch (vp->v_type) {
            case VCHR:



Home | Main Index | Thread Index | Old Index