Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs/ntfs print some potentially useful stuff in ntfs_print()
details: https://anonhg.NetBSD.org/src/rev/a0d6419a73ac
branches: trunk
changeset: 545472:a0d6419a73ac
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Wed Apr 09 16:12:18 2003 +0000
description:
print some potentially useful stuff in ntfs_print()
replace the VOP__UNLOCK() macros with VOP_UNLOCK() directly - it just
obfuscates the code
similarily for VN_LOCK()->vn_lock()
unlock dvp before ntvattrget call in ntfs_lookup() in '..' case, not after
fix problem in ntfs_lookup() where PDIRUNLOCK was not set in one code path
after unlocking parent directory vnode
diffstat:
sys/fs/ntfs/ntfs_vnops.c | 29 +++++++++++++++++++----------
1 files changed, 19 insertions(+), 10 deletions(-)
diffs (86 lines):
diff -r ef2e4007aa2e -r a0d6419a73ac sys/fs/ntfs/ntfs_vnops.c
--- a/sys/fs/ntfs/ntfs_vnops.c Wed Apr 09 16:02:18 2003 +0000
+++ b/sys/fs/ntfs/ntfs_vnops.c Wed Apr 09 16:12:18 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntfs_vnops.c,v 1.2 2003/04/09 16:02:18 jdolecek Exp $ */
+/* $NetBSD: ntfs_vnops.c,v 1.3 2003/04/09 16:12:18 jdolecek Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ntfs_vnops.c,v 1.2 2003/04/09 16:02:18 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ntfs_vnops.c,v 1.3 2003/04/09 16:12:18 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -259,7 +259,7 @@
if (ntfs_prtactive && vp->v_usecount != 0)
vprint("ntfs_inactive: pushing active", vp);
- VOP__UNLOCK(vp, 0, ap->a_p);
+ VOP_UNLOCK(vp, 0);
/* XXX since we don't support any filesystem changes
* right now, nothing more needs to be done
@@ -309,6 +309,13 @@
struct vnode *a_vp;
} */ *ap;
{
+ struct ntnode *ip = VTONT(ap->a_vp);
+
+ printf("tag VT_NTFS, ino %u, flag %#x, usecount %d, nlink %ld\n",
+ ip->i_number, ip->i_flag, ip->i_usecount, ip->i_nlink);
+ printf(" ");
+ lockmgr_printinfo(ap->a_vp->v_vnlock);
+ printf("\n");
return (0);
}
@@ -795,26 +802,26 @@
dprintf(("ntfs_lookup: faking .. directory in %d\n",
dip->i_number));
+ VOP_UNLOCK(dvp, 0);
+ cnp->cn_flags |= PDIRUNLOCK;
+
error = ntfs_ntvattrget(ntmp, dip, NTFS_A_NAME, NULL, 0, &vap);
if(error)
return (error);
- VOP__UNLOCK(dvp,0,cnp->cn_proc);
- cnp->cn_flags |= PDIRUNLOCK;
-
dprintf(("ntfs_lookup: parentdir: %d\n",
vap->va_a_name->n_pnumber));
error = VFS_VGET(ntmp->ntm_mountp,
vap->va_a_name->n_pnumber,ap->a_vpp);
ntfs_ntvattrrele(vap);
if (error) {
- if (VN_LOCK(dvp,LK_EXCLUSIVE|LK_RETRY,cnp->cn_proc)==0)
+ if (vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY) == 0)
cnp->cn_flags &= ~PDIRUNLOCK;
return (error);
}
if (lockparent && (cnp->cn_flags & ISLASTCN)) {
- error = VN_LOCK(dvp, LK_EXCLUSIVE, cnp->cn_proc);
+ error = vn_lock(dvp, LK_EXCLUSIVE);
if (error) {
vput( *(ap->a_vpp) );
return (error);
@@ -831,8 +838,10 @@
dprintf(("ntfs_lookup: found ino: %d\n",
VTONT(*ap->a_vpp)->i_number));
- if(!lockparent || !(cnp->cn_flags & ISLASTCN))
- VOP__UNLOCK(dvp, 0, cnp->cn_proc);
+ if(!lockparent || (cnp->cn_flags & ISLASTCN) == 0) {
+ VOP_UNLOCK(dvp, 0);
+ cnp->cn_flags |= PDIRUNLOCK;
+ }
}
if (cnp->cn_flags & MAKEENTRY)
Home |
Main Index |
Thread Index |
Old Index