/*-1* SPDX-License-Identifier: BSD-3-Clause2*3* Copyright (c) 1982, 1986, 1989, 19934* The Regents of the University of California. All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14* 3. Neither the name of the University nor the names of its contributors15* may be used to endorse or promote products derived from this software16* without specific prior written permission.17*18* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND19* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE20* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE21* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE22* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL23* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS24* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)25* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT26* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY27* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF28* SUCH DAMAGE.29*/3031#ifndef _FS_EXT2FS_EXT2_MOUNT_H_32#define _FS_EXT2FS_EXT2_MOUNT_H_3334#ifdef _KERNEL3536#ifdef MALLOC_DECLARE37MALLOC_DECLARE(M_EXT2NODE);38#endif3940struct vnode;4142/* This structure describes the ext2fs specific mount structure data. */43struct ext2mount {44struct mount *um_mountp; /* filesystem vfs structure */45struct cdev *um_dev; /* device mounted */46struct vnode *um_devvp; /* block device mounted vnode */4748struct m_ext2fs *um_e2fs; /* EXT2FS */4950u_long um_nindir; /* indirect ptrs per block */51u_long um_bptrtodb; /* indir ptr to disk block */52u_long um_seqinc; /* inc between seq blocks */5354struct mtx um_lock; /* Protects ext2mount & fs */5556struct g_consumer *um_cp;57struct bufobj *um_bo;58};5960#define EXT2_LOCK(aa) mtx_lock(&(aa)->um_lock)61#define EXT2_UNLOCK(aa) mtx_unlock(&(aa)->um_lock)62#define EXT2_MTX(aa) (&(aa)->um_lock)6364/* Convert mount ptr to ext2fsmount ptr. */65#define VFSTOEXT2(mp) ((struct ext2mount *)((mp)->mnt_data))6667/*68* Macros to access file system parameters in the ufsmount structure.69* Used by ufs_bmap.70*/71#define MNINDIR(ump) ((ump)->um_nindir)72#define blkptrtodb(ump, b) ((b) << (ump)->um_bptrtodb)73#define is_sequential(ump, a, b) ((b) == (a) + ump->um_seqinc)74#endif /* _KERNEL */7576#endif /* !_FS_EXT2FS_EXT2_MOUNT_H_ */777879