xref: /original-bsd/sys/ufs/ufs/ufsmount.h (revision deff14a8)
1 /*
2  * Copyright (c) 1982, 1986, 1989, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)ufsmount.h	8.4 (Berkeley) 10/27/94
8  */
9 
10 struct buf;
11 struct inode;
12 struct nameidata;
13 struct timeval;
14 struct ucred;
15 struct uio;
16 struct vnode;
17 struct netexport;
18 
19 /* This structure describes the UFS specific mount structure data. */
20 struct ufsmount {
21 	struct	mount *um_mountp;		/* filesystem vfs structure */
22 	dev_t	um_dev;				/* device mounted */
23 	struct	vnode *um_devvp;		/* block device mounted vnode */
24 
25 	union {					/* pointer to superblock */
26 		struct	lfs *lfs;		/* LFS */
27 		struct	fs *fs;			/* FFS */
28 	} ufsmount_u;
29 #define	um_fs	ufsmount_u.fs
30 #define	um_lfs	ufsmount_u.lfs
31 
32 	struct	vnode *um_quotas[MAXQUOTAS];	/* pointer to quota files */
33 	struct	ucred *um_cred[MAXQUOTAS];	/* quota file access cred */
34 	u_long	um_nindir;			/* indirect ptrs per block */
35 	u_long	um_bptrtodb;			/* indir ptr to disk block */
36 	u_long	um_seqinc;			/* inc between seq blocks */
37 	time_t	um_btime[MAXQUOTAS];		/* block quota time limit */
38 	time_t	um_itime[MAXQUOTAS];		/* inode quota time limit */
39 	char	um_qflags[MAXQUOTAS];		/* quota specific flags */
40 	struct	netexport um_export;		/* export information */
41 	quad_t	um_savedmaxfilesize;		/* XXX - limit maxfilesize */
42 };
43 
44 /*
45  * Flags describing the state of quotas.
46  */
47 #define	QTF_OPENING	0x01			/* Q_QUOTAON in progress */
48 #define	QTF_CLOSING	0x02			/* Q_QUOTAOFF in progress */
49 
50 /* Convert mount ptr to ufsmount ptr. */
51 #define VFSTOUFS(mp)	((struct ufsmount *)((mp)->mnt_data))
52 
53 /*
54  * Macros to access file system parameters in the ufsmount structure.
55  * Used by ufs_bmap.
56  */
57 #define MNINDIR(ump)			((ump)->um_nindir)
58 #define	blkptrtodb(ump, b)		((b) << (ump)->um_bptrtodb)
59 #define	is_sequential(ump, a, b)	((b) == (a) + ump->um_seqinc)
60