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