Linux Audio

Check our new training course

Loading...
v3.1
  1/*
  2 * Copyright (c) 2000-2001 Christoph Hellwig.
 
  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 *    without modification.
 11 * 2. The name of the author may not be used to endorse or promote products
 12 *    derived from this software without specific prior written permission.
 13 *
 14 * Alternatively, this software may be distributed under the terms of the
 15 * GNU General Public License ("GPL").
 16 *
 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
 21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 27 * SUCH DAMAGE.
 28 *
 29 */
 30#ifndef _VXFS_SUPER_H_
 31#define _VXFS_SUPER_H_
 32
 33/*
 34 * Veritas filesystem driver - superblock structure.
 35 *
 36 * This file contains the definition of the disk and core
 37 * superblocks of the Veritas Filesystem.
 38 */
 39#include <linux/types.h>
 40
 41
 42/*
 43 * Data types for use with the VxFS ondisk format.
 44 */
 45typedef	int32_t		vx_daddr_t;
 46typedef int32_t		vx_ino_t;
 47
 48/*
 49 * Superblock magic number (vxfs_super->vs_magic).
 50 */
 51#define VXFS_SUPER_MAGIC	0xa501FCF5
 52
 53/*
 54 * The root inode.
 55 */
 56#define VXFS_ROOT_INO		2
 57
 58/*
 59 * Num of entries in free extent array
 60 */
 61#define VXFS_NEFREE		32
 62
 
 
 
 
 
 
 
 
 63
 64/*
 65 * VxFS superblock (disk).
 66 */
 67struct vxfs_sb {
 68	/*
 69	 * Readonly fields for the version 1 superblock.
 70	 *
 71	 * Lots of this fields are no more used by version 2
 72	 * and never filesystems.
 73	 */
 74	u_int32_t	vs_magic;		/* Magic number */
 75	int32_t		vs_version;		/* VxFS version */
 76	u_int32_t	vs_ctime;		/* create time - secs */
 77	u_int32_t	vs_cutime;		/* create time - usecs */
 78	int32_t		__unused1;		/* unused */
 79	int32_t		__unused2;		/* unused */
 80	vx_daddr_t	vs_old_logstart;	/* obsolete */
 81	vx_daddr_t	vs_old_logend;		/* obsolete */
 82	int32_t		vs_bsize;		/* block size */
 83	int32_t		vs_size;		/* number of blocks */
 84	int32_t		vs_dsize;		/* number of data blocks */
 85	u_int32_t	vs_old_ninode;		/* obsolete */
 86	int32_t		vs_old_nau;		/* obsolete */
 87	int32_t		__unused3;		/* unused */
 88	int32_t		vs_old_defiextsize;	/* obsolete */
 89	int32_t		vs_old_ilbsize;		/* obsolete */
 90	int32_t		vs_immedlen;		/* size of immediate data area */
 91	int32_t		vs_ndaddr;		/* number of direct extentes */
 92	vx_daddr_t	vs_firstau;		/* address of first AU */
 93	vx_daddr_t	vs_emap;		/* offset of extent map in AU */
 94	vx_daddr_t	vs_imap;		/* offset of inode map in AU */
 95	vx_daddr_t	vs_iextop;		/* offset of ExtOp. map in AU */
 96	vx_daddr_t	vs_istart;		/* offset of inode list in AU */
 97	vx_daddr_t	vs_bstart;		/* offset of fdblock in AU */
 98	vx_daddr_t	vs_femap;		/* aufirst + emap */
 99	vx_daddr_t	vs_fimap;		/* aufirst + imap */
100	vx_daddr_t	vs_fiextop;		/* aufirst + iextop */
101	vx_daddr_t	vs_fistart;		/* aufirst + istart */
102	vx_daddr_t	vs_fbstart;		/* aufirst + bstart */
103	int32_t		vs_nindir;		/* number of entries in indir */
104	int32_t		vs_aulen;		/* length of AU in blocks */
105	int32_t		vs_auimlen;		/* length of imap in blocks */
106	int32_t		vs_auemlen;		/* length of emap in blocks */
107	int32_t		vs_auilen;		/* length of ilist in blocks */
108	int32_t		vs_aupad;		/* length of pad in blocks */
109	int32_t		vs_aublocks;		/* data blocks in AU */
110	int32_t		vs_maxtier;		/* log base 2 of aublocks */
111	int32_t		vs_inopb;		/* number of inodes per blk */
112	int32_t		vs_old_inopau;		/* obsolete */
113	int32_t		vs_old_inopilb;		/* obsolete */
114	int32_t		vs_old_ndiripau;	/* obsolete */
115	int32_t		vs_iaddrlen;		/* size of indirect addr ext. */
116	int32_t		vs_bshift;		/* log base 2 of bsize */
117	int32_t		vs_inoshift;		/* log base 2 of inobp */
118	int32_t		vs_bmask;		/* ~( bsize - 1 ) */
119	int32_t		vs_boffmask;		/* bsize - 1 */
120	int32_t		vs_old_inomask;		/* old_inopilb - 1 */
121	int32_t		vs_checksum;		/* checksum of V1 data */
122	
123	/*
124	 * Version 1, writable
125	 */
126	int32_t		vs_free;		/* number of free blocks */
127	int32_t		vs_ifree;		/* number of free inodes */
128	int32_t		vs_efree[VXFS_NEFREE];	/* number of free extents by size */
129	int32_t		vs_flags;		/* flags ?!? */
130	u_int8_t	vs_mod;			/* filesystem has been changed */
131	u_int8_t	vs_clean;		/* clean FS */
132	u_int16_t	__unused4;		/* unused */
133	u_int32_t	vs_firstlogid;		/* mount time log ID */
134	u_int32_t	vs_wtime;		/* last time written - sec */
135	u_int32_t	vs_wutime;		/* last time written - usec */
136	u_int8_t	vs_fname[6];		/* FS name */
137	u_int8_t	vs_fpack[6];		/* FS pack name */
138	int32_t		vs_logversion;		/* log format version */
139	int32_t		__unused5;		/* unused */
140	
141	/*
142	 * Version 2, Read-only
143	 */
144	vx_daddr_t	vs_oltext[2];		/* OLT extent and replica */
145	int32_t		vs_oltsize;		/* OLT extent size */
146	int32_t		vs_iauimlen;		/* size of inode map */
147	int32_t		vs_iausize;		/* size of IAU in blocks */
148	int32_t		vs_dinosize;		/* size of inode in bytes */
149	int32_t		vs_old_dniaddr;		/* indir levels per inode */
150	int32_t		vs_checksum2;		/* checksum of V2 RO */
151
152	/*
153	 * Actually much more...
154	 */
155};
156
157
158/*
159 * In core superblock filesystem private data for VxFS.
160 */
161struct vxfs_sb_info {
162	struct vxfs_sb		*vsi_raw;	/* raw (on disk) superblock */
163	struct buffer_head	*vsi_bp;	/* buffer for raw superblock*/
164	struct inode		*vsi_fship;	/* fileset header inode */
165	struct inode		*vsi_ilist;	/* inode list inode */
166	struct inode		*vsi_stilist;	/* structural inode list inode */
167	u_long			vsi_iext;	/* initial inode list */
168	ino_t			vsi_fshino;	/* fileset header inode */
169	daddr_t			vsi_oltext;	/* OLT extent */
170	daddr_t			vsi_oltsize;	/* OLT size */
 
171};
172
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
174/*
175 * File modes.  File types above 0xf000 are vxfs internal only, they should
176 * not be passed back to higher levels of the system.  vxfs file types must
177 * never have one of the regular file type bits set.
178 */
179enum vxfs_mode {
180	VXFS_ISUID = 0x00000800,	/* setuid */
181	VXFS_ISGID = 0x00000400,	/* setgid */
182	VXFS_ISVTX = 0x00000200,	/* sticky bit */
183	VXFS_IREAD = 0x00000100,	/* read */
184	VXFS_IWRITE = 0x00000080,	/* write */
185	VXFS_IEXEC = 0x00000040,	/* exec */
186
187	VXFS_IFIFO = 0x00001000,	/* Named pipe */
188	VXFS_IFCHR = 0x00002000,	/* Character device */
189	VXFS_IFDIR = 0x00004000,	/* Directory */
190	VXFS_IFNAM = 0x00005000,	/* Xenix device ?? */
191	VXFS_IFBLK = 0x00006000,	/* Block device */
192	VXFS_IFREG = 0x00008000,	/* Regular file */
193	VXFS_IFCMP = 0x00009000,	/* Compressed file ?!? */
194	VXFS_IFLNK = 0x0000a000,	/* Symlink */
195	VXFS_IFSOC = 0x0000c000,	/* Socket */
196
197	/* VxFS internal */
198	VXFS_IFFSH = 0x10000000,	/* Fileset header */
199	VXFS_IFILT = 0x20000000,	/* Inode list */
200	VXFS_IFIAU = 0x30000000,	/* Inode allocation unit */
201	VXFS_IFCUT = 0x40000000,	/* Current usage table */
202	VXFS_IFATT = 0x50000000,	/* Attr. inode */
203	VXFS_IFLCT = 0x60000000,	/* Link count table */
204	VXFS_IFIAT = 0x70000000,	/* Indirect attribute file */
205	VXFS_IFEMR = 0x80000000,	/* Extent map reorg file */
206	VXFS_IFQUO = 0x90000000,	/* BSD quota file */
207	VXFS_IFPTI = 0xa0000000,	/* "Pass through" inode */
208	VXFS_IFLAB = 0x11000000,	/* Device label file */
209	VXFS_IFOLT = 0x12000000,	/* OLT file */
210	VXFS_IFLOG = 0x13000000,	/* Log file */
211	VXFS_IFEMP = 0x14000000,	/* Extent map file */
212	VXFS_IFEAU = 0x15000000,	/* Extent AU file */
213	VXFS_IFAUS = 0x16000000,	/* Extent AU summary file */
214	VXFS_IFDEV = 0x17000000,	/* Device config file */
215
216};
217
218#define	VXFS_TYPE_MASK		0xfffff000
219
220#define VXFS_IS_TYPE(ip,type)	(((ip)->vii_mode & VXFS_TYPE_MASK) == (type))
221#define VXFS_ISFIFO(x)		VXFS_IS_TYPE((x),VXFS_IFIFO)
222#define VXFS_ISCHR(x)		VXFS_IS_TYPE((x),VXFS_IFCHR)
223#define VXFS_ISDIR(x)		VXFS_IS_TYPE((x),VXFS_IFDIR)
224#define VXFS_ISNAM(x)		VXFS_IS_TYPE((x),VXFS_IFNAM)
225#define VXFS_ISBLK(x)		VXFS_IS_TYPE((x),VXFS_IFBLK)
226#define VXFS_ISLNK(x)		VXFS_IS_TYPE((x),VXFS_IFLNK)
227#define VXFS_ISREG(x)		VXFS_IS_TYPE((x),VXFS_IFREG)
228#define VXFS_ISCMP(x)		VXFS_IS_TYPE((x),VXFS_IFCMP)
229#define VXFS_ISSOC(x)		VXFS_IS_TYPE((x),VXFS_IFSOC)
230
231#define VXFS_ISFSH(x)		VXFS_IS_TYPE((x),VXFS_IFFSH)
232#define VXFS_ISILT(x)		VXFS_IS_TYPE((x),VXFS_IFILT)
233
234/*
235 * Inmode organisation types.
236 */
237enum {
238	VXFS_ORG_NONE	= 0,	/* Inode has *no* format ?!? */
239	VXFS_ORG_EXT4	= 1,	/* Ext4 */
240	VXFS_ORG_IMMED	= 2,	/* All data stored in inode */
241	VXFS_ORG_TYPED	= 3,	/* Typed extents */
242};
243
244#define VXFS_IS_ORG(ip,org)	((ip)->vii_orgtype == (org))
245#define VXFS_ISNONE(ip)		VXFS_IS_ORG((ip), VXFS_ORG_NONE)
246#define VXFS_ISEXT4(ip)		VXFS_IS_ORG((ip), VXFS_ORG_EXT4)
247#define VXFS_ISIMMED(ip)	VXFS_IS_ORG((ip), VXFS_ORG_IMMED)
248#define VXFS_ISTYPED(ip)	VXFS_IS_ORG((ip), VXFS_ORG_TYPED)
249
250
251/*
252 * Get filesystem private data from VFS inode.
253 */
254#define VXFS_INO(ip) \
255	((struct vxfs_inode_info *)(ip)->i_private)
256
257/*
258 * Get filesystem private data from VFS superblock.
259 */
260#define VXFS_SBI(sbp) \
261	((struct vxfs_sb_info *)(sbp)->s_fs_info)
262
263#endif /* _VXFS_SUPER_H_ */
v4.10.11
  1/*
  2 * Copyright (c) 2000-2001 Christoph Hellwig.
  3 * Copyright (c) 2016 Krzysztof Blaszkowski
  4 * All rights reserved.
  5 *
  6 * Redistribution and use in source and binary forms, with or without
  7 * modification, are permitted provided that the following conditions
  8 * are met:
  9 * 1. Redistributions of source code must retain the above copyright
 10 *    notice, this list of conditions, and the following disclaimer,
 11 *    without modification.
 12 * 2. The name of the author may not be used to endorse or promote products
 13 *    derived from this software without specific prior written permission.
 14 *
 15 * Alternatively, this software may be distributed under the terms of the
 16 * GNU General Public License ("GPL").
 17 *
 18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
 22 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 28 * SUCH DAMAGE.
 29 *
 30 */
 31#ifndef _VXFS_SUPER_H_
 32#define _VXFS_SUPER_H_
 33
 34/*
 35 * Veritas filesystem driver - superblock structure.
 36 *
 37 * This file contains the definition of the disk and core
 38 * superblocks of the Veritas Filesystem.
 39 */
 40#include <linux/types.h>
 41
 
 
 
 
 
 
 
 42/*
 43 * Superblock magic number (vxfs_super->vs_magic).
 44 */
 45#define VXFS_SUPER_MAGIC	0xa501FCF5
 46
 47/*
 48 * The root inode.
 49 */
 50#define VXFS_ROOT_INO		2
 51
 52/*
 53 * Num of entries in free extent array
 54 */
 55#define VXFS_NEFREE		32
 56
 57enum vxfs_byte_order {
 58	VXFS_BO_LE,
 59	VXFS_BO_BE,
 60};
 61
 62typedef __u16 __bitwise __fs16;
 63typedef __u32 __bitwise __fs32;
 64typedef __u64 __bitwise __fs64;
 65
 66/*
 67 * VxFS superblock (disk).
 68 */
 69struct vxfs_sb {
 70	/*
 71	 * Readonly fields for the version 1 superblock.
 72	 *
 73	 * Lots of this fields are no more used by version 2
 74	 * and never filesystems.
 75	 */
 76	__fs32		vs_magic;		/* Magic number */
 77	__fs32		vs_version;		/* VxFS version */
 78	__fs32		vs_ctime;		/* create time - secs */
 79	__fs32		vs_cutime;		/* create time - usecs */
 80	__fs32		__unused1;		/* unused */
 81	__fs32		__unused2;		/* unused */
 82	__fs32		vs_old_logstart;	/* obsolete */
 83	__fs32		vs_old_logend;		/* obsolete */
 84	__fs32		vs_bsize;		/* block size */
 85	__fs32		vs_size;		/* number of blocks */
 86	__fs32		vs_dsize;		/* number of data blocks */
 87	__fs32		vs_old_ninode;		/* obsolete */
 88	__fs32		vs_old_nau;		/* obsolete */
 89	__fs32		__unused3;		/* unused */
 90	__fs32		vs_old_defiextsize;	/* obsolete */
 91	__fs32		vs_old_ilbsize;		/* obsolete */
 92	__fs32		vs_immedlen;		/* size of immediate data area */
 93	__fs32		vs_ndaddr;		/* number of direct extentes */
 94	__fs32		vs_firstau;		/* address of first AU */
 95	__fs32		vs_emap;		/* offset of extent map in AU */
 96	__fs32		vs_imap;		/* offset of inode map in AU */
 97	__fs32		vs_iextop;		/* offset of ExtOp. map in AU */
 98	__fs32		vs_istart;		/* offset of inode list in AU */
 99	__fs32		vs_bstart;		/* offset of fdblock in AU */
100	__fs32		vs_femap;		/* aufirst + emap */
101	__fs32		vs_fimap;		/* aufirst + imap */
102	__fs32		vs_fiextop;		/* aufirst + iextop */
103	__fs32		vs_fistart;		/* aufirst + istart */
104	__fs32		vs_fbstart;		/* aufirst + bstart */
105	__fs32		vs_nindir;		/* number of entries in indir */
106	__fs32		vs_aulen;		/* length of AU in blocks */
107	__fs32		vs_auimlen;		/* length of imap in blocks */
108	__fs32		vs_auemlen;		/* length of emap in blocks */
109	__fs32		vs_auilen;		/* length of ilist in blocks */
110	__fs32		vs_aupad;		/* length of pad in blocks */
111	__fs32		vs_aublocks;		/* data blocks in AU */
112	__fs32		vs_maxtier;		/* log base 2 of aublocks */
113	__fs32		vs_inopb;		/* number of inodes per blk */
114	__fs32		vs_old_inopau;		/* obsolete */
115	__fs32		vs_old_inopilb;		/* obsolete */
116	__fs32		vs_old_ndiripau;	/* obsolete */
117	__fs32		vs_iaddrlen;		/* size of indirect addr ext. */
118	__fs32		vs_bshift;		/* log base 2 of bsize */
119	__fs32		vs_inoshift;		/* log base 2 of inobp */
120	__fs32		vs_bmask;		/* ~( bsize - 1 ) */
121	__fs32		vs_boffmask;		/* bsize - 1 */
122	__fs32		vs_old_inomask;		/* old_inopilb - 1 */
123	__fs32		vs_checksum;		/* checksum of V1 data */
124	
125	/*
126	 * Version 1, writable
127	 */
128	__fs32		vs_free;		/* number of free blocks */
129	__fs32		vs_ifree;		/* number of free inodes */
130	__fs32		vs_efree[VXFS_NEFREE];	/* number of free extents by size */
131	__fs32		vs_flags;		/* flags ?!? */
132	__u8		vs_mod;			/* filesystem has been changed */
133	__u8		vs_clean;		/* clean FS */
134	__fs16		__unused4;		/* unused */
135	__fs32		vs_firstlogid;		/* mount time log ID */
136	__fs32		vs_wtime;		/* last time written - sec */
137	__fs32		vs_wutime;		/* last time written - usec */
138	__u8		vs_fname[6];		/* FS name */
139	__u8		vs_fpack[6];		/* FS pack name */
140	__fs32		vs_logversion;		/* log format version */
141	__u32		__unused5;		/* unused */
142	
143	/*
144	 * Version 2, Read-only
145	 */
146	__fs32		vs_oltext[2];		/* OLT extent and replica */
147	__fs32		vs_oltsize;		/* OLT extent size */
148	__fs32		vs_iauimlen;		/* size of inode map */
149	__fs32		vs_iausize;		/* size of IAU in blocks */
150	__fs32		vs_dinosize;		/* size of inode in bytes */
151	__fs32		vs_old_dniaddr;		/* indir levels per inode */
152	__fs32		vs_checksum2;		/* checksum of V2 RO */
153
154	/*
155	 * Actually much more...
156	 */
157};
158
159
160/*
161 * In core superblock filesystem private data for VxFS.
162 */
163struct vxfs_sb_info {
164	struct vxfs_sb		*vsi_raw;	/* raw (on disk) superblock */
165	struct buffer_head	*vsi_bp;	/* buffer for raw superblock*/
166	struct inode		*vsi_fship;	/* fileset header inode */
167	struct inode		*vsi_ilist;	/* inode list inode */
168	struct inode		*vsi_stilist;	/* structural inode list inode */
169	u_long			vsi_iext;	/* initial inode list */
170	ino_t			vsi_fshino;	/* fileset header inode */
171	daddr_t			vsi_oltext;	/* OLT extent */
172	daddr_t			vsi_oltsize;	/* OLT size */
173	enum vxfs_byte_order	byte_order;
174};
175
176static inline u16 fs16_to_cpu(struct vxfs_sb_info *sbi, __fs16 a)
177{
178	if (sbi->byte_order == VXFS_BO_BE)
179		return be16_to_cpu((__force __be16)a);
180	else
181		return le16_to_cpu((__force __le16)a);
182}
183
184static inline u32 fs32_to_cpu(struct vxfs_sb_info *sbi, __fs32 a)
185{
186	if (sbi->byte_order == VXFS_BO_BE)
187		return be32_to_cpu((__force __be32)a);
188	else
189		return le32_to_cpu((__force __le32)a);
190}
191
192static inline u64 fs64_to_cpu(struct vxfs_sb_info *sbi, __fs64 a)
193{
194	if (sbi->byte_order == VXFS_BO_BE)
195		return be64_to_cpu((__force __be64)a);
196	else
197		return le64_to_cpu((__force __le64)a);
198}
199
200/*
201 * File modes.  File types above 0xf000 are vxfs internal only, they should
202 * not be passed back to higher levels of the system.  vxfs file types must
203 * never have one of the regular file type bits set.
204 */
205enum vxfs_mode {
206	VXFS_ISUID = 0x00000800,	/* setuid */
207	VXFS_ISGID = 0x00000400,	/* setgid */
208	VXFS_ISVTX = 0x00000200,	/* sticky bit */
209	VXFS_IREAD = 0x00000100,	/* read */
210	VXFS_IWRITE = 0x00000080,	/* write */
211	VXFS_IEXEC = 0x00000040,	/* exec */
212
213	VXFS_IFIFO = 0x00001000,	/* Named pipe */
214	VXFS_IFCHR = 0x00002000,	/* Character device */
215	VXFS_IFDIR = 0x00004000,	/* Directory */
216	VXFS_IFNAM = 0x00005000,	/* Xenix device ?? */
217	VXFS_IFBLK = 0x00006000,	/* Block device */
218	VXFS_IFREG = 0x00008000,	/* Regular file */
219	VXFS_IFCMP = 0x00009000,	/* Compressed file ?!? */
220	VXFS_IFLNK = 0x0000a000,	/* Symlink */
221	VXFS_IFSOC = 0x0000c000,	/* Socket */
222
223	/* VxFS internal */
224	VXFS_IFFSH = 0x10000000,	/* Fileset header */
225	VXFS_IFILT = 0x20000000,	/* Inode list */
226	VXFS_IFIAU = 0x30000000,	/* Inode allocation unit */
227	VXFS_IFCUT = 0x40000000,	/* Current usage table */
228	VXFS_IFATT = 0x50000000,	/* Attr. inode */
229	VXFS_IFLCT = 0x60000000,	/* Link count table */
230	VXFS_IFIAT = 0x70000000,	/* Indirect attribute file */
231	VXFS_IFEMR = 0x80000000,	/* Extent map reorg file */
232	VXFS_IFQUO = 0x90000000,	/* BSD quota file */
233	VXFS_IFPTI = 0xa0000000,	/* "Pass through" inode */
234	VXFS_IFLAB = 0x11000000,	/* Device label file */
235	VXFS_IFOLT = 0x12000000,	/* OLT file */
236	VXFS_IFLOG = 0x13000000,	/* Log file */
237	VXFS_IFEMP = 0x14000000,	/* Extent map file */
238	VXFS_IFEAU = 0x15000000,	/* Extent AU file */
239	VXFS_IFAUS = 0x16000000,	/* Extent AU summary file */
240	VXFS_IFDEV = 0x17000000,	/* Device config file */
241
242};
243
244#define	VXFS_TYPE_MASK		0xfffff000
245
246#define VXFS_IS_TYPE(ip,type)	(((ip)->vii_mode & VXFS_TYPE_MASK) == (type))
247#define VXFS_ISFIFO(x)		VXFS_IS_TYPE((x),VXFS_IFIFO)
248#define VXFS_ISCHR(x)		VXFS_IS_TYPE((x),VXFS_IFCHR)
249#define VXFS_ISDIR(x)		VXFS_IS_TYPE((x),VXFS_IFDIR)
250#define VXFS_ISNAM(x)		VXFS_IS_TYPE((x),VXFS_IFNAM)
251#define VXFS_ISBLK(x)		VXFS_IS_TYPE((x),VXFS_IFBLK)
252#define VXFS_ISLNK(x)		VXFS_IS_TYPE((x),VXFS_IFLNK)
253#define VXFS_ISREG(x)		VXFS_IS_TYPE((x),VXFS_IFREG)
254#define VXFS_ISCMP(x)		VXFS_IS_TYPE((x),VXFS_IFCMP)
255#define VXFS_ISSOC(x)		VXFS_IS_TYPE((x),VXFS_IFSOC)
256
257#define VXFS_ISFSH(x)		VXFS_IS_TYPE((x),VXFS_IFFSH)
258#define VXFS_ISILT(x)		VXFS_IS_TYPE((x),VXFS_IFILT)
259
260/*
261 * Inmode organisation types.
262 */
263enum {
264	VXFS_ORG_NONE	= 0,	/* Inode has *no* format ?!? */
265	VXFS_ORG_EXT4	= 1,	/* Ext4 */
266	VXFS_ORG_IMMED	= 2,	/* All data stored in inode */
267	VXFS_ORG_TYPED	= 3,	/* Typed extents */
268};
269
270#define VXFS_IS_ORG(ip,org)	((ip)->vii_orgtype == (org))
271#define VXFS_ISNONE(ip)		VXFS_IS_ORG((ip), VXFS_ORG_NONE)
272#define VXFS_ISEXT4(ip)		VXFS_IS_ORG((ip), VXFS_ORG_EXT4)
273#define VXFS_ISIMMED(ip)	VXFS_IS_ORG((ip), VXFS_ORG_IMMED)
274#define VXFS_ISTYPED(ip)	VXFS_IS_ORG((ip), VXFS_ORG_TYPED)
 
 
 
 
 
 
 
275
276/*
277 * Get filesystem private data from VFS superblock.
278 */
279#define VXFS_SBI(sbp) \
280	((struct vxfs_sb_info *)(sbp)->s_fs_info)
281
282#endif /* _VXFS_SUPER_H_ */