Source-Changes-HG archive

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

[src/trunk]: src/sys/ntfs Store also attribute identifier in the filehandle s...



details:   https://anonhg.NetBSD.org/src/rev/e87879f4ddf0
branches:  trunk
changeset: 481883:e87879f4ddf0
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Tue Feb 08 16:17:58 2000 +0000

description:
Store also attribute identifier in the filehandle structure, so that
proper file attribute (a.k.a. "resource fork") is picked up when
the filehandle is mapped back to filesystem object.

This should make attributes working on NFS-exported NTFS filesystems
or other layered filesystems using filehandles.

diffstat:

 sys/ntfs/ntfs_inode.h  |  13 ++++++++-----
 sys/ntfs/ntfs_vfsops.c |  18 ++++++++++++------
 2 files changed, 20 insertions(+), 11 deletions(-)

diffs (90 lines):

diff -r 0e9f4491c849 -r e87879f4ddf0 sys/ntfs/ntfs_inode.h
--- a/sys/ntfs/ntfs_inode.h     Tue Feb 08 16:17:28 2000 +0000
+++ b/sys/ntfs/ntfs_inode.h     Tue Feb 08 16:17:58 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntfs_inode.h,v 1.8 1999/10/31 19:45:26 jdolecek Exp $  */
+/*     $NetBSD: ntfs_inode.h,v 1.9 2000/02/08 16:17:58 jdolecek Exp $  */
 
 /*-
  * Copyright (c) 1998, 1999 Semen Ustimenko
@@ -113,8 +113,11 @@
 
 /* This overlays the fid structure (see <sys/mount.h>) */
 struct ntfid {
-        u_int16_t ntfid_len;     /* Length of structure. */
-        u_int16_t ntfid_pad;     /* Force 32-bit alignment. */
-        ino_t     ntfid_ino;     /* File number (ino). */
-        int32_t   ntfid_gen;     /* Generation number. */
+       u_int16_t ntfid_len;    /* Length of structure. */
+       u_int16_t ntfid_pad;    /* Force 32-bit alignment. */
+       ino_t     ntfid_ino;    /* File number (ino). */
+       u_int8_t  ntfid_attr;   /* Attribute identifier */
+#ifdef notyet
+       int32_t   ntfid_gen;    /* Generation number. */
+#endif
 };
diff -r 0e9f4491c849 -r e87879f4ddf0 sys/ntfs/ntfs_vfsops.c
--- a/sys/ntfs/ntfs_vfsops.c    Tue Feb 08 16:17:28 2000 +0000
+++ b/sys/ntfs/ntfs_vfsops.c    Tue Feb 08 16:17:58 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntfs_vfsops.c,v 1.23 1999/11/15 19:38:14 jdolecek Exp $        */
+/*     $NetBSD: ntfs_vfsops.c,v 1.24 2000/02/08 16:17:59 jdolecek Exp $        */
 
 /*-
  * Copyright (c) 1998, 1999 Semen Ustimenko
@@ -830,20 +830,21 @@
        struct ucred **credanonp)
 #endif
 {
-       struct vnode *nvp;
        struct ntfid *ntfhp = (struct ntfid *)fhp;
        int error;
 
        ddprintf(("ntfs_fhtovp(): %s: %d\n", mp->mnt_stat->f_mntonname,
                ntfhp->ntfid_ino));
 
-       if ((error = VFS_VGET(mp, ntfhp->ntfid_ino, &nvp)) != 0) {
+       error = ntfs_vgetex(mp, ntfhp->ntfid_ino, ntfhp->ntfid_attr, NULL,
+                       LK_EXCLUSIVE | LK_RETRY, 0, curproc, vpp); /* XXX */
+       if (error != 0) {
                *vpp = NULLVP;
                return (error);
        }
+
        /* XXX as unlink/rmdir/mkdir/creat are not currently possible
         * with NTFS, we don't need to check anything else for now */
-       *vpp = nvp;
        return (0);
 }
 
@@ -854,15 +855,20 @@
 {
        register struct ntnode *ntp;
        register struct ntfid *ntfhp;
+       struct fnode *fn;
 
        ddprintf(("ntfs_fhtovp(): %s: %p\n", vp->v_mount->mnt_stat->f_mntonname,
                vp));
 
+       fn = VTOF(vp);
        ntp = VTONT(vp);
        ntfhp = (struct ntfid *)fhp;
        ntfhp->ntfid_len = sizeof(struct ntfid);
        ntfhp->ntfid_ino = ntp->i_number;
-       /* ntfhp->ntfid_gen = ntp->i_gen; */
+       ntfhp->ntfid_attr = fn->f_attrtype;
+#ifdef notyet
+       ntfhp->ntfid_gen = ntp->i_gen;
+#endif
        return (0);
 }
 
@@ -985,7 +991,7 @@
        struct vnode **vpp) 
 {
        return ntfs_vgetex(mp, ino, NTFS_A_DATA, NULL,
-                       LK_EXCLUSIVE | LK_RETRY, 0, curproc, vpp);
+                       LK_EXCLUSIVE | LK_RETRY, 0, curproc, vpp); /* XXX */
 }
 
 #if defined(__FreeBSD__)



Home | Main Index | Thread Index | Old Index