ntfs_inode.h revision 130585
120253Sjoerg/*	$NetBSD: ntfs_inode.h,v 1.8 1999/10/31 19:45:26 jdolecek Exp $	*/
220302Sjoerg
320302Sjoerg/*-
420253Sjoerg * Copyright (c) 1998, 1999 Semen Ustimenko
520253Sjoerg * All rights reserved.
620253Sjoerg *
720253Sjoerg * Redistribution and use in source and binary forms, with or without
820253Sjoerg * modification, are permitted provided that the following conditions
920302Sjoerg * are met:
1020253Sjoerg * 1. Redistributions of source code must retain the above copyright
1120253Sjoerg *    notice, this list of conditions and the following disclaimer.
1220253Sjoerg * 2. Redistributions in binary form must reproduce the above copyright
1320253Sjoerg *    notice, this list of conditions and the following disclaimer in the
1420302Sjoerg *    documentation and/or other materials provided with the distribution.
1520253Sjoerg *
1620253Sjoerg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1720302Sjoerg * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1820253Sjoerg * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1920253Sjoerg * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2020253Sjoerg * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2120253Sjoerg * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2220253Sjoerg * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2320253Sjoerg * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2420253Sjoerg * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2544229Sdavidn * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2620253Sjoerg * SUCH DAMAGE.
2720253Sjoerg *
2830259Scharnier * $FreeBSD: head/sys/fs/ntfs/ntfs_inode.h 130585 2004-06-16 09:47:26Z phk $
2930259Scharnier */
3050479Speter
3130259Scharnier/* These flags are kept in i_flag. */
3230259Scharnier#define	IN_ACCESS	0x0001	/* Access time update request. */
3330259Scharnier#define	IN_CHANGE	0x0002	/* Inode change time update request. */
3430259Scharnier#define	IN_UPDATE	0x0004	/* Modification time update request. */
3520253Sjoerg#define	IN_MODIFIED	0x0008	/* Inode has been modified. */
3620253Sjoerg#define	IN_RENAME	0x0010	/* Inode is being renamed. */
3720253Sjoerg#define	IN_SHLOCK	0x0020	/* File has shared lock. */
3830259Scharnier#define	IN_EXLOCK	0x0040	/* File has exclusive lock. */
3920253Sjoerg#define	IN_LAZYMOD	0x0080	/* Modified, but don't write yet. */
4020555Sdavidn#define	IN_HASHED	0x0800	/* Inode is on hash list */
4120555Sdavidn#define	IN_LOADED	0x8000	/* ntvattrs loaded */
4220555Sdavidn#define	IN_PRELOADED	0x4000	/* loaded from directory entry */
4364918Sgreen
44242349Sbaptstruct ntnode {
45242349Sbapt	struct vnode   *i_devvp;	/* vnode of blk dev we live on */
46242349Sbapt	struct cdev *i_dev;		/* Device associated with the inode. */
4720253Sjoerg
4820253Sjoerg	LIST_ENTRY(ntnode)	i_hash;
4920253Sjoerg	struct ntnode  *i_next;
5023318Sache	struct ntnode **i_prev;
5122394Sdavidn	struct ntfsmount       *i_mp;
5252512Sdavidn	ino_t           i_number;
5324214Sache	u_int32_t       i_flag;
5444386Sdavidn
5520253Sjoerg	/* locking */
5620253Sjoerg	struct lock	i_lock;
5720253Sjoerg	struct mtx	i_interlock;
5820253Sjoerg	int		i_usecount;
5920253Sjoerg
6020253Sjoerg	LIST_HEAD(,fnode)	i_fnlist;
6120253Sjoerg	LIST_HEAD(,ntvattr)	i_valist;
6220253Sjoerg
6320253Sjoerg	long		i_nlink;	/* MFR */
6485145Sache	ino_t		i_mainrec;	/* MFR */
6520253Sjoerg	u_int32_t	i_frflag;	/* MFR */
66283961Sbapt};
67283961Sbapt
68283961Sbapt#define	FN_PRELOADED	0x0001
69283961Sbapt#define	FN_VALID	0x0002
70283961Sbapt#define	FN_AATTRNAME	0x0004	/* space allocated for f_attrname */
71283961Sbaptstruct fnode {
72283961Sbapt	LIST_ENTRY(fnode) f_fnlist;
73283961Sbapt	struct vnode   *f_vp;		/* Associatied vnode */
74283961Sbapt	struct ntnode  *f_ip;		/* Associated ntnode */
75283961Sbapt	u_long		f_flag;
76283961Sbapt
77283961Sbapt	ntfs_times_t	f_times;	/* $NAME/dirinfo */
78283961Sbapt	ino_t		f_pnumber;	/* $NAME/dirinfo */
79283961Sbapt	u_int32_t       f_fflag;	/* $NAME/dirinfo */
80283961Sbapt	u_int64_t	f_size;		/* defattr/dirinfo: */
81283961Sbapt	u_int64_t	f_allocated;	/* defattr/dirinfo */
82283961Sbapt
83283961Sbapt	u_int32_t	f_attrtype;
84283961Sbapt	char	       *f_attrname;
85283961Sbapt
86283961Sbapt	/* for ntreaddir */
87283961Sbapt	u_int32_t       f_lastdattr;
8820253Sjoerg	u_int32_t       f_lastdblnum;
8920253Sjoerg	u_int32_t       f_lastdoff;
9020253Sjoerg	u_int32_t       f_lastdnum;
9120253Sjoerg	caddr_t         f_dirblbuf;
9220253Sjoerg	u_int32_t       f_dirblsz;
9320253Sjoerg};
9420253Sjoerg
9520253Sjoerg/* This overlays the fid structure (see <sys/mount.h>) */
9620253Sjoergstruct ntfid {
9720253Sjoerg        u_int16_t ntfid_len;     /* Length of structure. */
9820253Sjoerg        u_int16_t ntfid_pad;     /* Force 32-bit alignment. */
9920253Sjoerg        ino_t     ntfid_ino;     /* File number (ino). */
10020253Sjoerg        int32_t   ntfid_gen;     /* Generation number. */
10120253Sjoerg};
10220253Sjoerg