Source-Changes-HG archive

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

[src/trunk]: src/sys/ntfs lock the device vnode before calling VOP_CLOSE() on...



details:   https://anonhg.NetBSD.org/src/rev/6d99135e28a0
branches:  trunk
changeset: 477237:6d99135e28a0
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Oct 17 10:18:15 1999 +0000

description:
lock the device vnode before calling VOP_CLOSE() only under NetBSD
some minor cleanup in ntfs_unmount()

diffstat:

 sys/ntfs/ntfs_vfsops.c |  26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)

diffs (59 lines):

diff -r c6ab643af1d8 -r 6d99135e28a0 sys/ntfs/ntfs_vfsops.c
--- a/sys/ntfs/ntfs_vfsops.c    Sun Oct 17 09:44:48 1999 +0000
+++ b/sys/ntfs/ntfs_vfsops.c    Sun Oct 17 10:18:15 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntfs_vfsops.c,v 1.17 1999/10/16 23:53:28 wrstuden Exp $        */
+/*     $NetBSD: ntfs_vfsops.c,v 1.18 1999/10/17 10:18:15 jdolecek Exp $        */
 
 /*-
  * Copyright (c) 1998, 1999 Semen Ustimenko
@@ -606,9 +606,16 @@
 #endif
        if (bp)
                brelse(bp);
+
+#if defined __NetBSD__
+       /* lock the device vnode before calling VOP_CLOSE() */
        vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
        (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, p);
        VOP_UNLOCK(devvp, 0);
+#else
+       (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, p);
+#endif
+       
        return (error);
 }
 
@@ -660,21 +667,26 @@
 
 #if defined(__FreeBSD__)
        ntmp->ntm_devvp->v_specmountpoint = NULL;
+
+       VOP_LOCK(ntmp->ntm_devvp);
+       vnode_pager_uncache(ntmp->ntm_devvp);
+       VOP_UNLOCK(ntmp->ntm_devvp);
 #else
        ntmp->ntm_devvp->v_specflags &= ~SI_MOUNTEDON;
 #endif
 
-#ifndef __NetBSD__
-       VOP_LOCK(ntmp->ntm_devvp);
-       vnode_pager_uncache(ntmp->ntm_devvp);
-       VOP_UNLOCK(ntmp->ntm_devvp);
-#endif
+       vinvalbuf(ntmp->ntm_devvp, V_SAVE, NOCRED, p, 0, 0);
 
-       vinvalbuf(ntmp->ntm_devvp, V_SAVE, NOCRED, p, 0, 0);
+#if defined(__NetBSD__)
+       /* lock the device vnode before calling VOP_CLOSE() */
        VOP_LOCK(ntmp->ntm_devvp, LK_EXCLUSIVE | LK_RETRY);
        error = VOP_CLOSE(ntmp->ntm_devvp, ronly ? FREAD : FREAD|FWRITE,
                NOCRED, p);
        VOP_UNLOCK(ntmp->ntm_devvp, 0);
+#else
+       error = VOP_CLOSE(ntmp->ntm_devvp, ronly ? FREAD : FREAD|FWRITE,
+               NOCRED, p);
+#endif
 
        vrele(ntmp->ntm_devvp);
 



Home | Main Index | Thread Index | Old Index