1e09c00caSUlf Lilleengen /*- 2e09c00caSUlf Lilleengen * Copyright (c) 1982, 1986, 1989, 1993 3e09c00caSUlf Lilleengen * The Regents of the University of California. All rights reserved. 4e09c00caSUlf Lilleengen * 5e09c00caSUlf Lilleengen * Redistribution and use in source and binary forms, with or without 6e09c00caSUlf Lilleengen * modification, are permitted provided that the following conditions 7e09c00caSUlf Lilleengen * are met: 8e09c00caSUlf Lilleengen * 1. Redistributions of source code must retain the above copyright 9e09c00caSUlf Lilleengen * notice, this list of conditions and the following disclaimer. 10e09c00caSUlf Lilleengen * 2. Redistributions in binary form must reproduce the above copyright 11e09c00caSUlf Lilleengen * notice, this list of conditions and the following disclaimer in the 12e09c00caSUlf Lilleengen * documentation and/or other materials provided with the distribution. 13e09c00caSUlf Lilleengen * 4. Neither the name of the University nor the names of its contributors 14e09c00caSUlf Lilleengen * may be used to endorse or promote products derived from this software 15e09c00caSUlf Lilleengen * without specific prior written permission. 16e09c00caSUlf Lilleengen * 17e09c00caSUlf Lilleengen * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18e09c00caSUlf Lilleengen * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19e09c00caSUlf Lilleengen * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20e09c00caSUlf Lilleengen * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21e09c00caSUlf Lilleengen * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22e09c00caSUlf Lilleengen * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23e09c00caSUlf Lilleengen * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24e09c00caSUlf Lilleengen * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25e09c00caSUlf Lilleengen * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26e09c00caSUlf Lilleengen * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27e09c00caSUlf Lilleengen * SUCH DAMAGE. 28e09c00caSUlf Lilleengen * 29e09c00caSUlf Lilleengen * @(#)ufsmount.h 8.6 (Berkeley) 3/30/95 30e09c00caSUlf Lilleengen * $FreeBSD$ 31e09c00caSUlf Lilleengen */ 32e09c00caSUlf Lilleengen 33e09c00caSUlf Lilleengen #ifndef _FS_EXT2FS_EXT2_MOUNT_H_ 34e09c00caSUlf Lilleengen #define _FS_EXT2FS_EXT2_MOUNT_H_ 35e09c00caSUlf Lilleengen 36e09c00caSUlf Lilleengen #ifdef _KERNEL 37e09c00caSUlf Lilleengen 38e09c00caSUlf Lilleengen #ifdef MALLOC_DECLARE 39e09c00caSUlf Lilleengen MALLOC_DECLARE(M_EXT2NODE); 40e09c00caSUlf Lilleengen #endif 41e09c00caSUlf Lilleengen 42e09c00caSUlf Lilleengen struct vnode; 43e09c00caSUlf Lilleengen 44e09c00caSUlf Lilleengen /* This structure describes the ext2fs specific mount structure data. */ 45e09c00caSUlf Lilleengen struct ext2mount { 46e09c00caSUlf Lilleengen struct mount *um_mountp; /* filesystem vfs structure */ 47e09c00caSUlf Lilleengen struct cdev *um_dev; /* device mounted */ 48e09c00caSUlf Lilleengen struct vnode *um_devvp; /* block device mounted vnode */ 49e09c00caSUlf Lilleengen 50e09c00caSUlf Lilleengen struct m_ext2fs *um_e2fs; /* EXT2FS */ 51e09c00caSUlf Lilleengen #define em_e2fsb um_e2fs->e2fs 52e09c00caSUlf Lilleengen 53e09c00caSUlf Lilleengen u_long um_nindir; /* indirect ptrs per block */ 54e09c00caSUlf Lilleengen u_long um_bptrtodb; /* indir ptr to disk block */ 55e09c00caSUlf Lilleengen u_long um_seqinc; /* inc between seq blocks */ 56e09c00caSUlf Lilleengen 57e09c00caSUlf Lilleengen struct mtx um_lock; /* Protects ext2mount & fs */ 58e09c00caSUlf Lilleengen 59e09c00caSUlf Lilleengen struct g_consumer *um_cp; 60e09c00caSUlf Lilleengen struct bufobj *um_bo; 61e09c00caSUlf Lilleengen }; 62e09c00caSUlf Lilleengen 63e09c00caSUlf Lilleengen #define EXT2_LOCK(aa) mtx_lock(&(aa)->um_lock) 64e09c00caSUlf Lilleengen #define EXT2_UNLOCK(aa) mtx_unlock(&(aa)->um_lock) 65e09c00caSUlf Lilleengen #define EXT2_MTX(aa) (&(aa)->um_lock) 66e09c00caSUlf Lilleengen 67e09c00caSUlf Lilleengen /* Convert mount ptr to ext2fsmount ptr. */ 68e09c00caSUlf Lilleengen #define VFSTOEXT2(mp) ((struct ext2mount *)((mp)->mnt_data)) 69e09c00caSUlf Lilleengen 70e09c00caSUlf Lilleengen /* 71e09c00caSUlf Lilleengen * Macros to access file system parameters in the ufsmount structure. 72e09c00caSUlf Lilleengen * Used by ufs_bmap. 73e09c00caSUlf Lilleengen */ 74e09c00caSUlf Lilleengen #define MNINDIR(ump) ((ump)->um_nindir) 75e09c00caSUlf Lilleengen #define blkptrtodb(ump, b) ((b) << (ump)->um_bptrtodb) 76e09c00caSUlf Lilleengen #define is_sequential(ump, a, b) ((b) == (a) + ump->um_seqinc) 77e09c00caSUlf Lilleengen #endif /* _KERNEL */ 78e09c00caSUlf Lilleengen 79*45641afbSJohn Baldwin #endif /* !_FS_EXT2FS_EXT2_MOUNT_H_ */ 80