2007-03-04 08:59:00 +03:00
|
|
|
/* $NetBSD: ntfs_inode.h,v 1.4 2007/03/04 06:03:00 christos Exp $ */
|
1999-05-06 19:43:17 +04:00
|
|
|
|
1999-05-06 19:36:39 +04:00
|
|
|
/*-
|
|
|
|
* Copyright (c) 1998, 1999 Semen Ustimenko
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
1999-07-26 18:02:30 +04:00
|
|
|
* Id: ntfs_inode.h,v 1.4 1999/05/12 09:43:00 semenu Exp
|
1999-05-06 19:36:39 +04:00
|
|
|
*/
|
|
|
|
|
2005-12-03 20:34:43 +03:00
|
|
|
#ifndef _NTFS_NTFS_INODE_H_
|
|
|
|
#define _NTFS_NTFS_INODE_H_
|
2001-12-18 10:51:16 +03:00
|
|
|
#include <miscfs/genfs/genfs_node.h>
|
|
|
|
|
1999-05-06 19:36:39 +04:00
|
|
|
/* These flags are kept in i_flag. */
|
1999-07-26 18:02:30 +04:00
|
|
|
#if defined(__FreeBSD__)
|
1999-05-06 19:36:39 +04:00
|
|
|
#define IN_ACCESS 0x0001 /* Access time update request. */
|
|
|
|
#define IN_CHANGE 0x0002 /* Inode change time update request. */
|
|
|
|
#define IN_UPDATE 0x0004 /* Modification time update request. */
|
|
|
|
#define IN_MODIFIED 0x0008 /* Inode has been modified. */
|
|
|
|
#define IN_RENAME 0x0010 /* Inode is being renamed. */
|
|
|
|
#define IN_SHLOCK 0x0020 /* File has shared lock. */
|
|
|
|
#define IN_EXLOCK 0x0040 /* File has exclusive lock. */
|
1999-05-06 19:43:17 +04:00
|
|
|
#define IN_LAZYMOD 0x0080 /* Modified, but don't write yet. */
|
1999-07-26 18:02:30 +04:00
|
|
|
#else /* defined(__NetBSD__) */
|
1999-05-06 19:36:39 +04:00
|
|
|
#define IN_ACCESS 0x0001 /* Access time update request. */
|
|
|
|
#define IN_CHANGE 0x0002 /* Inode change time update request. */
|
|
|
|
#define IN_EXLOCK 0x0004 /* File has exclusive lock. */
|
|
|
|
#define IN_LOCKED 0x0008 /* Inode lock. */
|
|
|
|
#define IN_LWAIT 0x0010 /* Process waiting on file lock. */
|
|
|
|
#define IN_MODIFIED 0x0020 /* Inode has been modified. */
|
|
|
|
#define IN_RENAME 0x0040 /* Inode is being renamed. */
|
|
|
|
#define IN_SHLOCK 0x0080 /* File has shared lock. */
|
|
|
|
#define IN_UPDATE 0x0100 /* Modification time update request. */
|
|
|
|
#define IN_WANTED 0x0200 /* Inode is wanted by a process. */
|
|
|
|
#define IN_RECURSE 0x0400 /* Recursion expected */
|
|
|
|
#endif
|
|
|
|
|
1999-05-06 19:43:17 +04:00
|
|
|
#define IN_HASHED 0x0800 /* Inode is on hash list */
|
1999-05-06 19:36:39 +04:00
|
|
|
#define IN_LOADED 0x8000 /* ntvattrs loaded */
|
|
|
|
#define IN_PRELOADED 0x4000 /* loaded from directory entry */
|
|
|
|
|
|
|
|
struct ntnode {
|
1999-10-09 18:27:42 +04:00
|
|
|
struct vnode *i_devvp; /* vnode of blk dev we live on */
|
|
|
|
dev_t i_dev; /* Device associated with the inode. */
|
|
|
|
|
1999-05-06 19:36:39 +04:00
|
|
|
LIST_ENTRY(ntnode) i_hash;
|
|
|
|
struct ntnode *i_next;
|
|
|
|
struct ntnode **i_prev;
|
|
|
|
struct ntfsmount *i_mp;
|
|
|
|
ino_t i_number;
|
|
|
|
u_int32_t i_flag;
|
1999-10-09 18:27:42 +04:00
|
|
|
|
|
|
|
/* locking */
|
|
|
|
struct lock i_lock;
|
|
|
|
struct simplelock i_interlock;
|
1999-05-06 19:36:39 +04:00
|
|
|
int i_usecount;
|
1999-10-09 18:27:42 +04:00
|
|
|
|
1999-05-06 19:36:39 +04:00
|
|
|
LIST_HEAD(,fnode) i_fnlist;
|
|
|
|
LIST_HEAD(,ntvattr) i_valist;
|
|
|
|
|
|
|
|
long i_nlink; /* MFR */
|
|
|
|
ino_t i_mainrec; /* MFR */
|
|
|
|
u_int32_t i_frflag; /* MFR */
|
|
|
|
};
|
|
|
|
|
|
|
|
#define FN_PRELOADED 0x0001
|
|
|
|
#define FN_VALID 0x0002
|
|
|
|
#define FN_AATTRNAME 0x0004 /* space allocated for f_attrname */
|
|
|
|
struct fnode {
|
1999-09-29 19:58:28 +04:00
|
|
|
#ifdef __FreeBSD__
|
|
|
|
struct lock f_lock; /* fnode lock >Keep this first< */
|
|
|
|
#endif
|
2001-12-18 10:51:16 +03:00
|
|
|
struct genfs_node f_gnode;
|
2005-02-27 01:58:54 +03:00
|
|
|
|
1999-05-06 19:36:39 +04:00
|
|
|
LIST_ENTRY(fnode) f_fnlist;
|
|
|
|
struct vnode *f_vp; /* Associatied vnode */
|
1999-09-29 19:58:28 +04:00
|
|
|
struct ntnode *f_ip; /* Associated ntnode */
|
1999-05-06 19:36:39 +04:00
|
|
|
u_long f_flag;
|
|
|
|
|
|
|
|
ntfs_times_t f_times; /* $NAME/dirinfo */
|
|
|
|
ino_t f_pnumber; /* $NAME/dirinfo */
|
|
|
|
u_int32_t f_fflag; /* $NAME/dirinfo */
|
|
|
|
u_int64_t f_size; /* defattr/dirinfo: */
|
|
|
|
u_int64_t f_allocated; /* defattr/dirinfo */
|
|
|
|
|
|
|
|
u_int32_t f_attrtype;
|
|
|
|
char *f_attrname;
|
|
|
|
|
|
|
|
/* for ntreaddir */
|
|
|
|
u_int32_t f_lastdattr;
|
|
|
|
u_int32_t f_lastdblnum;
|
|
|
|
u_int32_t f_lastdoff;
|
|
|
|
u_int32_t f_lastdnum;
|
2007-03-04 08:59:00 +03:00
|
|
|
void * f_dirblbuf;
|
1999-05-06 19:36:39 +04:00
|
|
|
u_int32_t f_dirblsz;
|
|
|
|
};
|
1999-09-10 20:14:02 +04:00
|
|
|
|
|
|
|
/* This overlays the fid structure (see <sys/mount.h>) */
|
|
|
|
struct ntfid {
|
2000-02-08 19:17:58 +03:00
|
|
|
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
|
1999-09-10 20:14:02 +04:00
|
|
|
};
|
2005-12-03 20:34:43 +03:00
|
|
|
#endif /* _NTFS_NTFS_INODE_H_ */
|