Annotation of src/sys/ufs/ufs/ufsmount.h, Revision 1.29
1.29 ! ad 1: /* $NetBSD: ufsmount.h,v 1.28 2007/03/04 06:03:48 christos Exp $ */
1.4 mycroft 2:
1.1 mycroft 3: /*
4: * Copyright (c) 1982, 1986, 1989, 1993
5: * The Regents of the University of California. All rights reserved.
6: *
7: * Redistribution and use in source and binary forms, with or without
8: * modification, are permitted provided that the following conditions
9: * are met:
10: * 1. Redistributions of source code must retain the above copyright
11: * notice, this list of conditions and the following disclaimer.
12: * 2. Redistributions in binary form must reproduce the above copyright
13: * notice, this list of conditions and the following disclaimer in the
14: * documentation and/or other materials provided with the distribution.
1.14 agc 15: * 3. Neither the name of the University nor the names of its contributors
1.1 mycroft 16: * may be used to endorse or promote products derived from this software
17: * without specific prior written permission.
18: *
19: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29: * SUCH DAMAGE.
30: *
1.6 fvdl 31: * @(#)ufsmount.h 8.6 (Berkeley) 3/30/95
1.1 mycroft 32: */
33:
1.10 matt 34: #ifndef _UFS_UFS_UFSMOUNT_H_
35: #define _UFS_UFS_UFSMOUNT_H_
36:
1.6 fvdl 37: /*
38: * Arguments to mount UFS-based filesystems
39: */
40: struct ufs_args {
41: char *fspec; /* block special device to mount */
42: };
43:
44: /*
45: * Arguments to mount MFS
46: */
47: struct mfs_args {
48: char *fspec; /* name to export for statfs */
1.21 jmmv 49: struct export_args30 _pad1; /* compat with old userland tools */
1.28 christos 50: void * base; /* base of file system in memory */
1.6 fvdl 51: u_long size; /* size of file system */
52: };
53:
54: #ifdef _KERNEL
1.9 dbj 55:
56: #if defined(_KERNEL_OPT)
57: #include "opt_ffs.h"
58: #endif
59:
1.29 ! ad 60: #include <sys/mutex.h>
! 61:
1.19 thorpej 62: #include <ufs/ufs/extattr.h>
63:
1.1 mycroft 64: struct buf;
65: struct inode;
66: struct nameidata;
67: struct timeval;
68: struct uio;
69: struct vnode;
70:
71: /* This structure describes the UFS specific mount structure data. */
72: struct ufsmount {
73: struct mount *um_mountp; /* filesystem vfs structure */
74: dev_t um_dev; /* device mounted */
75: struct vnode *um_devvp; /* block device mounted vnode */
1.11 fvdl 76: u_long um_fstype;
1.7 bouyer 77: u_int32_t um_flags; /* UFS-specific flags - see below */
1.1 mycroft 78: union { /* pointer to superblock */
1.5 bouyer 79: struct fs *fs; /* FFS */
1.1 mycroft 80: struct lfs *lfs; /* LFS */
1.5 bouyer 81: struct m_ext2fs *e2fs; /* EXT2FS */
1.1 mycroft 82: } ufsmount_u;
83: #define um_fs ufsmount_u.fs
84: #define um_lfs ufsmount_u.lfs
1.5 bouyer 85: #define um_e2fs ufsmount_u.e2fs
86: #define um_e2fsb ufsmount_u.e2fs->s_es
1.3 mycroft 87:
1.19 thorpej 88: /* Extended attribute information. */
89: struct ufs_extattr_per_mount um_extattr;
90:
1.1 mycroft 91: struct vnode *um_quotas[MAXQUOTAS]; /* pointer to quota files */
1.27 elad 92: kauth_cred_t um_cred[MAXQUOTAS]; /* quota file access cred */
1.1 mycroft 93: u_long um_nindir; /* indirect ptrs per block */
1.8 chs 94: u_long um_lognindir; /* log2 of um_nindir */
1.1 mycroft 95: u_long um_bptrtodb; /* indir ptr to disk block */
96: u_long um_seqinc; /* inc between seq blocks */
1.29 ! ad 97: kmutex_t um_lock; /* lock on global data */
1.1 mycroft 98: time_t um_btime[MAXQUOTAS]; /* block quota time limit */
99: time_t um_itime[MAXQUOTAS]; /* inode quota time limit */
100: char um_qflags[MAXQUOTAS]; /* quota specific flags */
1.16 hannken 101: void *um_oldfscompat; /* save 4.2 rotbl */
1.18 hannken 102: TAILQ_HEAD(inodelst, inode) um_snapshots; /* list of active snapshots */
1.16 hannken 103: daddr_t *um_snapblklist; /* snapshot block hints list */
1.17 mycroft 104: int um_maxsymlinklen;
105: int um_dirblksiz;
1.22 yamt 106: u_int64_t um_maxfilesize;
1.23 yamt 107:
108: const struct ufs_ops *um_ops;
109: };
110:
111: struct ufs_ops {
112: void (*uo_itimes)(struct inode *ip, const struct timespec *,
113: const struct timespec *, const struct timespec *);
1.24 yamt 114: int (*uo_update)(struct vnode *, const struct timespec *,
115: const struct timespec *, int);
1.27 elad 116: int (*uo_truncate)(struct vnode *, off_t, int, kauth_cred_t,
1.25 christos 117: struct lwp *);
1.27 elad 118: int (*uo_valloc)(struct vnode *, int, kauth_cred_t, struct vnode **);
1.24 yamt 119: int (*uo_vfree)(struct vnode *, ino_t, int);
1.27 elad 120: int (*uo_balloc)(struct vnode *, off_t, int, kauth_cred_t, int,
1.24 yamt 121: struct buf **);
1.1 mycroft 122: };
1.7 bouyer 123:
1.24 yamt 124: #define UFS_OPS(vp) (VFSTOUFS((vp)->v_mount)->um_ops)
125:
1.23 yamt 126: #define UFS_ITIMES(vp, acc, mod, cre) \
1.24 yamt 127: (*UFS_OPS(vp)->uo_itimes)(VTOI(vp), (acc), (mod), (cre))
128: #define UFS_UPDATE(vp, acc, mod, flags) \
129: (*UFS_OPS(vp)->uo_update)((vp), (acc), (mod), (flags))
130: #define UFS_TRUNCATE(vp, off, flags, cr, p) \
131: (*UFS_OPS(vp)->uo_truncate)((vp), (off), (flags), (cr), (p))
132: #define UFS_VALLOC(vp, mode, cr, vpp) \
133: (*UFS_OPS(vp)->uo_valloc)((vp), (mode), (cr), (vpp))
134: #define UFS_VFREE(vp, ino, mode) \
135: (*UFS_OPS(vp)->uo_vfree)((vp), (ino), (mode))
136: #define UFS_BALLOC(vp, off, size, cr, flags, bpp) \
137: (*UFS_OPS(vp)->uo_balloc)((vp), (off), (size), (cr), (flags), (bpp))
1.23 yamt 138:
1.7 bouyer 139: /* UFS-specific flags */
140: #define UFS_NEEDSWAP 0x01 /* filesystem metadata need byte-swapping */
1.9 dbj 141: #define UFS_ISAPPLEUFS 0x02 /* filesystem is Apple UFS */
1.11 fvdl 142:
143: /*
144: * Filesystem types
145: */
146: #define UFS1 1
147: #define UFS2 2
148:
1.3 mycroft 149:
1.1 mycroft 150: /*
151: * Flags describing the state of quotas.
152: */
153: #define QTF_OPENING 0x01 /* Q_QUOTAON in progress */
154: #define QTF_CLOSING 0x02 /* Q_QUOTAOFF in progress */
155:
156: /* Convert mount ptr to ufsmount ptr. */
157: #define VFSTOUFS(mp) ((struct ufsmount *)((mp)->mnt_data))
1.9 dbj 158:
159: #ifdef APPLE_UFS
1.17 mycroft 160: #define UFS_MPISAPPLEUFS(ump) ((ump)->um_flags & UFS_ISAPPLEUFS)
1.9 dbj 161: #else
1.17 mycroft 162: #define UFS_MPISAPPLEUFS(ump) (0)
1.9 dbj 163: #endif
1.1 mycroft 164:
165: /*
166: * Macros to access file system parameters in the ufsmount structure.
167: * Used by ufs_bmap.
168: */
1.3 mycroft 169: #define MNINDIR(ump) ((ump)->um_nindir)
170: #define blkptrtodb(ump, b) ((b) << (ump)->um_bptrtodb)
1.6 fvdl 171: #endif /* _KERNEL */
1.10 matt 172:
173: #endif /* !_UFS_UFS_UFSMOUNT_H_ */
CVSweb <webmaster@jp.NetBSD.org>