xref: /original-bsd/sys/ufs/ffs/ufsmount.h (revision 3705696b)
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.1 (Berkeley) 06/11/93
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 radix_node_head;
18 #ifndef AF_MAX
19 #include <sys/socket.h>
20 #endif
21 
22 /* This structure describes the UFS specific mount structure data. */
23 struct ufsmount {
24 	struct	mount *um_mountp;		/* filesystem vfs structure */
25 	dev_t	um_dev;				/* device mounted */
26 	struct	vnode *um_devvp;		/* block device mounted vnode */
27 	union {					/* pointer to superblock */
28 		struct	lfs *lfs;		/* LFS */
29 		struct	fs *fs;			/* FFS */
30 	} ufsmount_u;
31 #define	um_fs	ufsmount_u.fs
32 #define	um_lfs	ufsmount_u.lfs
33 	struct	vnode *um_quotas[MAXQUOTAS];	/* pointer to quota files */
34 	struct	ucred *um_cred[MAXQUOTAS];	/* quota file access cred */
35 	u_long	um_nindir;			/* indirect ptrs per block */
36 	u_long	um_bptrtodb;			/* indir ptr to disk block */
37 	u_long	um_seqinc;			/* inc between seq blocks */
38 	time_t	um_btime[MAXQUOTAS];		/* block quota time limit */
39 	time_t	um_itime[MAXQUOTAS];		/* inode quota time limit */
40 	char	um_qflags[MAXQUOTAS];		/* quota specific flags */
41 	struct	netcred um_defexported;		/* Default export */
42 	struct	radix_node_head *um_rtable[AF_MAX+1]; /* Individual exports */
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	blkptrtodb(ump, b)	((b) << (ump)->um_bptrtodb)
58 #define	is_sequential(ump, a, b) ((b) == (a) + ump->um_seqinc)
59 #define MNINDIR(ump)	((ump)->um_nindir)
60 
61 
62