| 1 | /* |
| 2 | * Copyright (c) 1982, 1986, 1989 Regents of the University of California. |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * %sccs.include.redist.c% |
| 6 | * |
| 7 | * @(#)ufsmount.h 7.10 (Berkeley) %G% |
| 8 | */ |
| 9 | |
| 10 | /* |
| 11 | * The root inode is the root of the file system. Inode 0 can't be used for |
| 12 | * normal purposes and historically bad blocks were linked to inode 1, thus |
| 13 | * the root inode is 2. (inode 1 is no longer used for this purpose, however |
| 14 | * numerous dump tapes make this assumption, so we are stuck with it). |
| 15 | */ |
| 16 | #define ROOTINO ((ino_t)2) |
| 17 | |
| 18 | struct buf; |
| 19 | struct inode; |
| 20 | struct nameidata; |
| 21 | struct timeval; |
| 22 | struct ucred; |
| 23 | struct uio; |
| 24 | struct vnode; |
| 25 | |
| 26 | /* This structure describes the UFS specific mount structure data. */ |
| 27 | struct ufsmount { |
| 28 | struct mount *um_mountp; /* filesystem vfs structure */ |
| 29 | dev_t um_dev; /* device mounted */ |
| 30 | struct vnode *um_devvp; /* block device mounted vnode */ |
| 31 | union { /* pointer to superblock */ |
| 32 | struct lfs *lfs; /* LFS */ |
| 33 | struct fs *fs; /* FFS */ |
| 34 | } ufsmount_u; |
| 35 | #define um_fs ufsmount_u.fs |
| 36 | #define um_lfs ufsmount_u.lfs |
| 37 | struct vnode *um_quotas[MAXQUOTAS]; /* pointer to quota files */ |
| 38 | struct ucred *um_cred[MAXQUOTAS]; /* quota file access cred */ |
| 39 | time_t um_btime[MAXQUOTAS]; /* block quota time limit */ |
| 40 | time_t um_itime[MAXQUOTAS]; /* inode quota time limit */ |
| 41 | char um_qflags[MAXQUOTAS]; /* quota specific flags */ |
| 42 | |
| 43 | /* |
| 44 | * The following is the inode switch. It is intended to provide |
| 45 | * the interface between the Unix File System semantics and the |
| 46 | * on-disk allocation, layout and I/O. |
| 47 | */ |
| 48 | int (*um_blkatoff) __P((struct inode *ip, |
| 49 | off_t offset, char **res, struct buf **bpp)); |
| 50 | int (*um_write) __P((struct vnode *vp, |
| 51 | struct uio *uio, int ioflag, struct ucred *cred)); |
| 52 | int (*um_iget) __P((struct inode *pip, |
| 53 | ino_t ino, struct inode **ipp)); |
| 54 | int (*um_ialloc) __P((struct inode *pip, |
| 55 | int mode, struct ucred *cred, struct inode **ipp)); |
| 56 | void (*um_ifree) __P((struct inode *pip, ino_t ino, int mode)); |
| 57 | int (*um_itrunc) __P((struct inode *oip, u_long length, int flags)); |
| 58 | int (*um_iupdat) __P((struct inode *ip, |
| 59 | struct timeval *ta, struct timeval *tm, int waitfor)); |
| 60 | int (*um_bwrite) /* XXX changes */ |
| 61 | __P((struct buf *bp)); |
| 62 | int (*um_bmap) /* XXX changes */ |
| 63 | __P((struct inode *ip, daddr_t bn, daddr_t *bnp)); |
| 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)) |