Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs/msdosfs Stop using v_mount of an unreferenced vnode -...
details: https://anonhg.NetBSD.org/src/rev/16594dc5125e
branches: trunk
changeset: 791057:16594dc5125e
user: hannken <hannken%NetBSD.org@localhost>
date: Sat Nov 02 10:30:18 2013 +0000
description:
Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.
diffstat:
sys/fs/msdosfs/msdosfs_vnops.c | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diffs (97 lines):
diff -r e2f3173a8151 -r 16594dc5125e sys/fs/msdosfs/msdosfs_vnops.c
--- a/sys/fs/msdosfs/msdosfs_vnops.c Sat Nov 02 01:55:16 2013 +0000
+++ b/sys/fs/msdosfs/msdosfs_vnops.c Sat Nov 02 10:30:18 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_vnops.c,v 1.86 2013/03/18 19:35:37 plunky Exp $ */
+/* $NetBSD: msdosfs_vnops.c,v 1.87 2013/11/02 10:30:18 hannken Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.86 2013/03/18 19:35:37 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.87 2013/11/02 10:30:18 hannken Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -829,6 +829,7 @@
struct vnode *tdvp = ap->a_tdvp;
struct vnode *fvp = ap->a_fvp;
struct vnode *fdvp = ap->a_fdvp;
+ struct mount *mp = fdvp->v_mount;
struct componentname *tcnp = ap->a_tcnp;
struct componentname *fcnp = ap->a_fcnp;
struct denode *ip, *xp, *dp, *zp;
@@ -906,7 +907,7 @@
}
VN_KNOTE(fdvp, NOTE_WRITE); /* XXXLUKEM/XXX: right place? */
- fstrans_start(fdvp->v_mount, FSTRANS_SHARED);
+ fstrans_start(mp, FSTRANS_SHARED);
/*
* When the target exists, both the directory
* and target vnodes are returned locked.
@@ -993,7 +994,7 @@
* file/directory.
*/
if ((error = uniqdosname(VTODE(tdvp), tcnp, toname)) != 0) {
- fstrans_done(fdvp->v_mount);
+ fstrans_done(mp);
goto abortit;
}
@@ -1009,7 +1010,7 @@
VOP_UNLOCK(fdvp);
vrele(ap->a_fvp);
vrele(tdvp);
- fstrans_done(fdvp->v_mount);
+ fstrans_done(mp);
return (error);
}
if (fvp == NULL) {
@@ -1021,7 +1022,7 @@
vput(fdvp);
vrele(ap->a_fvp);
vrele(tdvp);
- fstrans_done(fdvp->v_mount);
+ fstrans_done(mp);
return 0;
}
VOP_UNLOCK(fdvp);
@@ -1129,7 +1130,7 @@
ip->de_flag &= ~DE_RENAME;
vrele(fdvp);
vrele(fvp);
- fstrans_done(fdvp->v_mount);
+ fstrans_done(mp);
return (error);
/* XXX: uuuh */
@@ -1291,6 +1292,7 @@
} */ *ap = v;
struct vnode *vp = ap->a_vp;
struct vnode *dvp = ap->a_dvp;
+ struct mount *mp = dvp->v_mount;
struct componentname *cnp = ap->a_cnp;
struct denode *ip, *dp;
int error;
@@ -1305,7 +1307,7 @@
vput(vp);
return (EINVAL);
}
- fstrans_start(ap->a_dvp->v_mount, FSTRANS_SHARED);
+ fstrans_start(mp, FSTRANS_SHARED);
/*
* Verify the directory is empty (and valid).
* (Rmdir ".." won't be valid since
@@ -1347,7 +1349,7 @@
if (dvp)
vput(dvp);
vput(vp);
- fstrans_done(ap->a_dvp->v_mount);
+ fstrans_done(mp);
return (error);
}
Home |
Main Index |
Thread Index |
Old Index