Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/ntfs No need to load a vnode/fnode pair to lookup att...



details:   https://anonhg.NetBSD.org/src/rev/d64612507cc8
branches:  trunk
changeset: 335421:d64612507cc8
user:      hannken <hannken%NetBSD.org@localhost>
date:      Tue Jan 06 11:04:00 2015 +0000

description:
No need to load a vnode/fnode pair to lookup attributes on a ntnode.
Use ntfs_ntlookup()/ntfs_ntput() instead.

diffstat:

 sys/fs/ntfs/ntfs_subr.c |  17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diffs (58 lines):

diff -r 681849bd3155 -r d64612507cc8 sys/fs/ntfs/ntfs_subr.c
--- a/sys/fs/ntfs/ntfs_subr.c   Tue Jan 06 11:03:09 2015 +0000
+++ b/sys/fs/ntfs/ntfs_subr.c   Tue Jan 06 11:04:00 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntfs_subr.c,v 1.57 2015/01/04 16:19:12 christos Exp $  */
+/*     $NetBSD: ntfs_subr.c,v 1.58 2015/01/06 11:04:00 hannken Exp $   */
 
 /*-
  * Copyright (c) 1998, 1999 Semen Ustimenko (semenu%FreeBSD.org@localhost)
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ntfs_subr.c,v 1.57 2015/01/04 16:19:12 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ntfs_subr.c,v 1.58 2015/01/06 11:04:00 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -150,7 +150,6 @@
 /*
  * Search attribute specified in ntnode (load ntnode if necessary).
  * If not found but ATTR_A_ATTRLIST present, read it in and search through.
- * VOP_VGET node needed, and lookup through its ntnode (load if necessary).
  *
  * ntnode should be locked
  */
@@ -161,7 +160,6 @@
        struct ntvattr *lvap = NULL;
        struct attr_attrlist *aalp;
        struct attr_attrlist *nextaalp;
-       struct vnode *newvp;
        struct ntnode *newip;
        void *alpool;
        size_t namelen, len;
@@ -224,18 +222,17 @@
                dprintf(("%s: attribute in ino: %d\n", __func__,
                                 aalp->al_inumber));
 
-               error = ntfs_vgetex(ntmp->ntm_mountp, aalp->al_inumber,
-                               NTFS_A_DATA, "", LK_EXCLUSIVE, &newvp);
+               error = ntfs_ntlookup(ntmp, aalp->al_inumber, &newip);
                if (error) {
-                       printf("%s: CAN'T VGET INO: %d (error %d)\n", __func__,
-                           aalp->al_inumber, error);
+                       printf("%s: can't lookup ino %d"
+                           " for %" PRId64 " attr %x: error %d\n", __func__,
+                           aalp->al_inumber, ip->i_number, type, error);
                        goto out;
                }
-               newip = VTONT(newvp);
                /* XXX have to lock ntnode */
                error = ntfs_findvattr(ntmp, newip, &lvap, vapp,
                                type, name, namelen, vcn);
-               vput(newvp);
+               ntfs_ntput(newip);
                if (error == 0)
                        goto out;
                printf("%s: ATTRLIST ERROR.\n", __func__);



Home | Main Index | Thread Index | Old Index