ntfs_inode.h revision 44142
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_usecount;
66
67	LIST_HEAD(,fnode) i_fnlist;
68	struct ntvattr *i_vattrp;	/* ntvattrs list */
69
70	long		i_nlink;	/* MFR */
71	ino_t		i_mainrec;	/* MFR */
72	u_int32_t	i_frflag;	/* MFR */
73
74	uid_t           i_uid;
75	gid_t           i_gid;
76	mode_t          i_mode;
77};
78
79#define	FN_PRELOADED	0x0001
80#define	FN_DEFAULT	0x0002
81#define	FN_AATTRNAME	0x0004	/* space allocated for f_attrname */
82struct fnode {
83	struct lock	f_lock;		/* Must be first */
84
85	LIST_ENTRY(fnode) f_fnlist;
86	struct vnode   *f_vp;		/* Associatied vnode */
87	struct ntnode  *f_ip;
88	u_long		f_flag;
89	struct vnode   *f_devvp;
90	struct ntfsmount *f_mp;
91	dev_t           f_dev;
92	enum vtype      f_type;
93
94	ntfs_times_t	f_times;	/* $NAME/dirinfo */
95	ino_t		f_pnumber;	/* $NAME/dirinfo */
96	u_int32_t       f_fflag;	/* $NAME/dirinfo */
97	u_int64_t	f_size;		/* defattr/dirinfo: */
98	u_int64_t	f_allocated;	/* defattr/dirinfo */
99
100	u_int32_t	f_attrtype;
101	char	       *f_attrname;
102
103	/* for ntreaddir */
104	u_int32_t       f_lastdattr;
105	u_int32_t       f_lastdblnum;
106	u_int32_t       f_lastdoff;
107	u_int32_t       f_lastdnum;
108	caddr_t         f_dirblbuf;
109	u_int32_t       f_dirblsz;
110};
111