xref: /openbsd-src/sys/ntfs/ntfs_inode.h (revision b66b9ef836b4335d57b8481be6faf1a0b9b7e205)
1*b66b9ef8Sjsg /*	$OpenBSD: ntfs_inode.h,v 1.8 2021/03/11 13:31:35 jsg Exp $	*/
226f3deacStedu /*	$NetBSD: ntfs_inode.h,v 1.1 2002/12/23 17:38:33 jdolecek Exp $	*/
326f3deacStedu 
426f3deacStedu /*-
526f3deacStedu  * Copyright (c) 1998, 1999 Semen Ustimenko
626f3deacStedu  * All rights reserved.
726f3deacStedu  *
826f3deacStedu  * Redistribution and use in source and binary forms, with or without
926f3deacStedu  * modification, are permitted provided that the following conditions
1026f3deacStedu  * are met:
1126f3deacStedu  * 1. Redistributions of source code must retain the above copyright
1226f3deacStedu  *    notice, this list of conditions and the following disclaimer.
1326f3deacStedu  * 2. Redistributions in binary form must reproduce the above copyright
1426f3deacStedu  *    notice, this list of conditions and the following disclaimer in the
1526f3deacStedu  *    documentation and/or other materials provided with the distribution.
1626f3deacStedu  *
1726f3deacStedu  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1826f3deacStedu  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1926f3deacStedu  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2026f3deacStedu  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2126f3deacStedu  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2226f3deacStedu  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2326f3deacStedu  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2426f3deacStedu  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2526f3deacStedu  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2626f3deacStedu  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2726f3deacStedu  * SUCH DAMAGE.
2826f3deacStedu  *
2926f3deacStedu  *	Id: ntfs_inode.h,v 1.4 1999/05/12 09:43:00 semenu Exp
3026f3deacStedu  */
3126f3deacStedu 
3226f3deacStedu #define	IN_HASHED	0x0800	/* Inode is on hash list */
3326f3deacStedu #define	IN_LOADED	0x8000	/* ntvattrs loaded */
3426f3deacStedu #define	IN_PRELOADED	0x4000	/* loaded from directory entry */
3526f3deacStedu 
3626f3deacStedu struct ntnode {
3726f3deacStedu 	struct vnode   *i_devvp;	/* vnode of blk dev we live on */
3826f3deacStedu 	dev_t           i_dev;		/* Device associated with the inode. */
3926f3deacStedu 
4026f3deacStedu 	LIST_ENTRY(ntnode)	i_hash;
418fc6378aSjsing 	TAILQ_ENTRY(ntnode)	i_loaded;
428fc6378aSjsing 
4326f3deacStedu 	struct ntnode  *i_next;
4426f3deacStedu 	struct ntnode **i_prev;
458fc6378aSjsing 
4626f3deacStedu 	struct ntfsmount       *i_mp;
4795a73601Sguenther 	ntfsino_t       i_number;
4826f3deacStedu 	u_int32_t       i_flag;
4926f3deacStedu 
5026f3deacStedu 	/* locking */
51c74ceabfSoga 	struct rwlock	i_lock;
5226f3deacStedu 	int		i_usecount;
5326f3deacStedu 
5426f3deacStedu 	LIST_HEAD(,fnode)	i_fnlist;
5526f3deacStedu 	LIST_HEAD(,ntvattr)	i_valist;
5626f3deacStedu 
5726f3deacStedu 	long		i_nlink;	/* MFR */
5895a73601Sguenther 	u_int64_t	i_mainrec;	/* MFR */
5926f3deacStedu 	u_int32_t	i_frflag;	/* MFR */
6026f3deacStedu };
6126f3deacStedu 
6226f3deacStedu #define	FN_PRELOADED	0x0001
6326f3deacStedu #define	FN_VALID	0x0002
6426f3deacStedu #define	FN_AATTRNAME	0x0004	/* space allocated for f_attrname */
6526f3deacStedu struct fnode {
6626f3deacStedu 	LIST_ENTRY(fnode) f_fnlist;
67*b66b9ef8Sjsg 	struct vnode   *f_vp;		/* Associated vnode */
6826f3deacStedu 	struct ntnode  *f_ip;		/* Associated ntnode */
6926f3deacStedu 	u_long		f_flag;
7026f3deacStedu 
7126f3deacStedu 	ntfs_times_t	f_times;	/* $NAME/dirinfo */
7295a73601Sguenther 	u_int32_t	f_pnumber;	/* $NAME/dirinfo */
7326f3deacStedu 	u_int32_t       f_fflag;	/* $NAME/dirinfo */
7426f3deacStedu 	u_int64_t	f_size;		/* defattr/dirinfo: */
7526f3deacStedu 	u_int64_t	f_allocated;	/* defattr/dirinfo */
7626f3deacStedu 
7726f3deacStedu 	u_int32_t	f_attrtype;
7826f3deacStedu 	char	       *f_attrname;
7926f3deacStedu 
8026f3deacStedu 	/* for ntreaddir */
8126f3deacStedu 	u_int32_t       f_lastdattr;
8226f3deacStedu 	u_int32_t       f_lastdblnum;
8326f3deacStedu 	u_int32_t       f_lastdoff;
8426f3deacStedu 	u_int32_t       f_lastdnum;
8526f3deacStedu 	caddr_t         f_dirblbuf;
8626f3deacStedu 	u_int32_t       f_dirblsz;
8726f3deacStedu };
8826f3deacStedu 
8926f3deacStedu /* This overlays the fid structure (see <sys/mount.h>) */
9026f3deacStedu struct ntfid {
9126f3deacStedu 	u_int16_t ntfid_len;	/* Length of structure. */
9226f3deacStedu 	u_int16_t ntfid_pad;	/* Force 32-bit alignment. */
9395a73601Sguenther 	ntfsino_t ntfid_ino;	/* File number (ino). */
9426f3deacStedu 	u_int8_t  ntfid_attr;	/* Attribute identifier */
9526f3deacStedu #ifdef notyet
9626f3deacStedu 	int32_t   ntfid_gen;	/* Generation number. */
9726f3deacStedu #endif
9826f3deacStedu };
99