ntfs_inode.h revision 50477
11556Srgrimes/* $NetBSD: ntfs_inode.h,v 1.2 1999/05/06 15:43:19 christos Exp $ */ 250471Speter 31556Srgrimes/*- 41556Srgrimes * Copyright (c) 1998, 1999 Semen Ustimenko 53197Scsgr * All rights reserved. 63197Scsgr * 738149Smarkm * Redistribution and use in source and binary forms, with or without 829914Smarkm * modification, are permitted provided that the following conditions 940101Smarkm * are met: 1029914Smarkm * 1. Redistributions of source code must retain the above copyright 1129914Smarkm * notice, this list of conditions and the following disclaimer. 1229914Smarkm * 2. Redistributions in binary form must reproduce the above copyright 1329914Smarkm * notice, this list of conditions and the following disclaimer in the 1429914Smarkm * documentation and/or other materials provided with the distribution. 1540101Smarkm * 164714Swollman * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1729914Smarkm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 183197Scsgr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 193197Scsgr * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 2034899Smarkm * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2134899Smarkm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2234899Smarkm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 233197Scsgr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 241556Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * $FreeBSD: head/sys/fs/ntfs/ntfs_inode.h 50477 1999-08-28 01:08:13Z peter $ 29 */ 30 31/* These flags are kept in i_flag. */ 32#if defined(__FreeBSD__) 33#define IN_ACCESS 0x0001 /* Access time update request. */ 34#define IN_CHANGE 0x0002 /* Inode change time update request. */ 35#define IN_UPDATE 0x0004 /* Modification time update request. */ 36#define IN_MODIFIED 0x0008 /* Inode has been modified. */ 37#define IN_RENAME 0x0010 /* Inode is being renamed. */ 38#define IN_SHLOCK 0x0020 /* File has shared lock. */ 39#define IN_EXLOCK 0x0040 /* File has exclusive lock. */ 40#define IN_LAZYMOD 0x0080 /* Modified, but don't write yet. */ 41#else /* defined(__NetBSD__) */ 42#define IN_ACCESS 0x0001 /* Access time update request. */ 43#define IN_CHANGE 0x0002 /* Inode change time update request. */ 44#define IN_EXLOCK 0x0004 /* File has exclusive lock. */ 45#define IN_LOCKED 0x0008 /* Inode lock. */ 46#define IN_LWAIT 0x0010 /* Process waiting on file lock. */ 47#define IN_MODIFIED 0x0020 /* Inode has been modified. */ 48#define IN_RENAME 0x0040 /* Inode is being renamed. */ 49#define IN_SHLOCK 0x0080 /* File has shared lock. */ 50#define IN_UPDATE 0x0100 /* Modification time update request. */ 51#define IN_WANTED 0x0200 /* Inode is wanted by a process. */ 52#define IN_RECURSE 0x0400 /* Recursion expected */ 53#endif 54 55#define IN_HASHED 0x0800 /* Inode is on hash list */ 56#define IN_LOADED 0x8000 /* ntvattrs loaded */ 57#define IN_PRELOADED 0x4000 /* loaded from directory entry */ 58 59struct ntnode { 60 LIST_ENTRY(ntnode) i_hash; 61 struct ntnode *i_next; 62 struct ntnode **i_prev; 63 struct ntfsmount *i_mp; 64 ino_t i_number; 65 dev_t i_dev; 66 u_int32_t i_flag; 67 int i_lock; 68 int i_usecount; 69#if defined(__NetBSD__) 70 pid_t i_lockholder; 71 pid_t i_lockwaiter; 72 int i_lockcount; 73#endif 74 LIST_HEAD(,fnode) i_fnlist; 75 LIST_HEAD(,ntvattr) i_valist; 76 77 long i_nlink; /* MFR */ 78 ino_t i_mainrec; /* MFR */ 79 u_int32_t i_frflag; /* MFR */ 80 81 uid_t i_uid; 82 gid_t i_gid; 83 mode_t i_mode; 84}; 85 86#define FN_PRELOADED 0x0001 87#define FN_VALID 0x0002 88#define FN_AATTRNAME 0x0004 /* space allocated for f_attrname */ 89struct fnode { 90 struct lock f_lock; /* Must be first */ 91 92 LIST_ENTRY(fnode) f_fnlist; 93 struct vnode *f_vp; /* Associatied vnode */ 94 struct ntnode *f_ip; 95 u_long f_flag; 96 struct vnode *f_devvp; 97 struct ntfsmount *f_mp; 98 dev_t f_dev; 99 enum vtype f_type; 100 101 ntfs_times_t f_times; /* $NAME/dirinfo */ 102 ino_t f_pnumber; /* $NAME/dirinfo */ 103 u_int32_t f_fflag; /* $NAME/dirinfo */ 104 u_int64_t f_size; /* defattr/dirinfo: */ 105 u_int64_t f_allocated; /* defattr/dirinfo */ 106 107 u_int32_t f_attrtype; 108 char *f_attrname; 109 110 /* for ntreaddir */ 111 u_int32_t f_lastdattr; 112 u_int32_t f_lastdblnum; 113 u_int32_t f_lastdoff; 114 u_int32_t f_lastdnum; 115 caddr_t f_dirblbuf; 116 u_int32_t f_dirblsz; 117}; 118