xref: /original-bsd/sys/ufs/ufs/ufsmount.h (revision 27393bdf)
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.6 (Berkeley) 03/30/95
8  */
9 
10 /*
11  * Arguments to mount UFS-based filesystems
12  */
13 struct ufs_args {
14 	char	*fspec;			/* block special device to mount */
15 	struct	export_args export;	/* network export information */
16 };
17 
18 #ifdef MFS
19 /*
20  * Arguments to mount MFS
21  */
22 struct mfs_args {
23 	char	*fspec;			/* name to export for statfs */
24 	struct	export_args export;	/* if exported MFSes are supported */
25 	caddr_t	base;			/* base of file system in memory */
26 	u_long	size;			/* size of file system */
27 };
28 #endif /* MFS */
29 
30 #ifdef KERNEL
31 struct buf;
32 struct inode;
33 struct nameidata;
34 struct timeval;
35 struct ucred;
36 struct uio;
37 struct vnode;
38 struct netexport;
39 
40 /* This structure describes the UFS specific mount structure data. */
41 struct ufsmount {
42 	struct	mount *um_mountp;		/* filesystem vfs structure */
43 	dev_t	um_dev;				/* device mounted */
44 	struct	vnode *um_devvp;		/* block device mounted vnode */
45 
46 	union {					/* pointer to superblock */
47 		struct	lfs *lfs;		/* LFS */
48 		struct	fs *fs;			/* FFS */
49 	} ufsmount_u;
50 #define	um_fs	ufsmount_u.fs
51 #define	um_lfs	ufsmount_u.lfs
52 
53 	struct	vnode *um_quotas[MAXQUOTAS];	/* pointer to quota files */
54 	struct	ucred *um_cred[MAXQUOTAS];	/* quota file access cred */
55 	u_long	um_nindir;			/* indirect ptrs per block */
56 	u_long	um_bptrtodb;			/* indir ptr to disk block */
57 	u_long	um_seqinc;			/* inc between seq blocks */
58 	time_t	um_btime[MAXQUOTAS];		/* block quota time limit */
59 	time_t	um_itime[MAXQUOTAS];		/* inode quota time limit */
60 	char	um_qflags[MAXQUOTAS];		/* quota specific flags */
61 	struct	netexport um_export;		/* export information */
62 	int64_t	um_savedmaxfilesize;		/* XXX - limit maxfilesize */
63 };
64 
65 /*
66  * Flags describing the state of quotas.
67  */
68 #define	QTF_OPENING	0x01			/* Q_QUOTAON in progress */
69 #define	QTF_CLOSING	0x02			/* Q_QUOTAOFF in progress */
70 
71 /* Convert mount ptr to ufsmount ptr. */
72 #define VFSTOUFS(mp)	((struct ufsmount *)((mp)->mnt_data))
73 
74 /*
75  * Macros to access file system parameters in the ufsmount structure.
76  * Used by ufs_bmap.
77  */
78 #define MNINDIR(ump)			((ump)->um_nindir)
79 #define	blkptrtodb(ump, b)		((b) << (ump)->um_bptrtodb)
80 #define	is_sequential(ump, a, b)	((b) == (a) + ump->um_seqinc)
81 #endif /* KERNEL */
82