]> granicus.if.org Git - spl/commitdiff
Clean vattr_t and vsecattr_t types
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 11 Jan 2011 19:56:00 +0000 (11:56 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 12 Jan 2011 19:38:04 +0000 (11:38 -0800)
Minor cleanup for the vattr_t and vsecattr_t types.

include/sys/vnode.h
module/spl/spl-vnode.c

index ef5c5920371ab22a2e7f0a0e28a930a581108809..1c4b99ecc9081c3b15678208300cc9818f3d1092 100644 (file)
@@ -121,18 +121,18 @@ typedef struct vattr {
        enum vtype      va_type;        /* vnode type */
        u_int           va_mask;        /* attribute bit-mask */
        u_short         va_mode;        /* acc mode */
-       short           va_uid;         /* owner uid */
-       short           va_gid;         /* owner gid */
+       uid_t           va_uid;         /* owner uid */
+       gid_t           va_gid;         /* owner gid */
        long            va_fsid;        /* fs id */
        long            va_nodeid;      /* node # */
-       short           va_nlink;       /* # links */
-       u_long          va_size;        /* file size */
-       long            va_blocksize;   /* block size */
-       struct timeval va_atime;        /* last acc */
-       struct timeval va_mtime;        /* last mod */
-       struct timeval va_ctime;        /* last chg */
+       uint32_t        va_nlink;       /* # links */
+       uint64_t        va_size;        /* file size */
+       uint32_t        va_blocksize;   /* block size */
+       uint64_t        va_nblocks;     /* space used */
+       struct timespec va_atime;       /* last acc */
+       struct timespec va_mtime;       /* last mod */
+       struct timespec va_ctime;       /* last chg */
        dev_t           va_rdev;        /* dev */
-       long            va_blocks;      /* space used */
 } vattr_t;
 
 typedef struct xoptattr {
@@ -168,6 +168,7 @@ typedef struct vsecattr {
        int             vsa_dfaclcnt;   /* default ACL entry count */
        void            *vsa_dfaclentp; /* pointer to default ACL entries */
        size_t          vsa_aclentsz;   /* ACE size in bytes of vsa_aclentp */
+       uint_t          vsa_aclflags;   /* ACE ACL flags */
 } vsecattr_t;
 
 typedef struct vnode {
index 765dc4e2ee4e43327c46f663c1dc9b2e3ac0f7a0..a7c7a71389f2c9b7035163bef873301a5b05b254 100644 (file)
@@ -454,7 +454,7 @@ int
 vn_getattr(vnode_t *vp, vattr_t *vap, int flags, void *x3, void *x4)
 {
        struct file *fp;
-        struct kstat stat;
+       struct kstat stat;
        int rc;
        SENTRY;
 
@@ -477,16 +477,13 @@ vn_getattr(vnode_t *vp, vattr_t *vap, int flags, void *x3, void *x4)
        vap->va_nlink         = stat.nlink;
         vap->va_size          = stat.size;
        vap->va_blocksize     = stat.blksize;
-       vap->va_atime.tv_sec  = stat.atime.tv_sec;
-       vap->va_atime.tv_usec = stat.atime.tv_nsec / NSEC_PER_USEC;
-       vap->va_mtime.tv_sec  = stat.mtime.tv_sec;
-       vap->va_mtime.tv_usec = stat.mtime.tv_nsec / NSEC_PER_USEC;
-       vap->va_ctime.tv_sec  = stat.ctime.tv_sec;
-       vap->va_ctime.tv_usec = stat.ctime.tv_nsec / NSEC_PER_USEC;
+       vap->va_atime         = stat.atime;
+       vap->va_mtime         = stat.mtime;
+       vap->va_ctime         = stat.ctime;
        vap->va_rdev          = stat.rdev;
-       vap->va_blocks        = stat.blocks;
+       vap->va_nblocks       = stat.blocks;
 
-        SRETURN(0);
+       SRETURN(0);
 }
 EXPORT_SYMBOL(vn_getattr);