2005-01-06 18:27:30 +00:00
|
|
|
/*-
|
1995-11-05 23:25:12 +00:00
|
|
|
* modified for EXT2FS support in Lites 1.1
|
|
|
|
*
|
|
|
|
* Aug 1995, Godmar Back (gback@cs.utah.edu)
|
|
|
|
* University of Utah, Department of Computer Science
|
|
|
|
*/
|
|
|
|
/*-
|
2017-11-20 19:43:44 +00:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*
|
1995-11-05 23:25:12 +00:00
|
|
|
* Copyright (c) 1991, 1993, 1994
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
2016-12-02 19:47:23 +00:00
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
1995-11-05 23:25:12 +00:00
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* @(#)ffs_extern.h 8.3 (Berkeley) 4/16/94
|
2000-11-03 16:41:48 +00:00
|
|
|
* $FreeBSD$
|
1995-11-05 23:25:12 +00:00
|
|
|
*/
|
|
|
|
|
2010-01-14 14:30:54 +00:00
|
|
|
#ifndef _FS_EXT2FS_EXT2_EXTERN_H_
|
|
|
|
#define _FS_EXT2FS_EXT2_EXTERN_H_
|
1996-05-01 02:16:17 +00:00
|
|
|
|
2010-01-14 14:30:54 +00:00
|
|
|
struct ext2fs_dinode;
|
2016-01-21 14:50:28 +00:00
|
|
|
struct ext2fs_direct_2;
|
|
|
|
struct ext2fs_searchslot;
|
2002-05-16 19:08:03 +00:00
|
|
|
struct indir;
|
1995-11-05 23:25:12 +00:00
|
|
|
struct inode;
|
|
|
|
struct mount;
|
1997-02-12 06:52:51 +00:00
|
|
|
struct vfsconf;
|
1995-11-05 23:25:12 +00:00
|
|
|
struct vnode;
|
|
|
|
|
2016-01-21 14:50:28 +00:00
|
|
|
int ext2_add_entry(struct vnode *, struct ext2fs_direct_2 *);
|
2013-08-13 15:40:43 +00:00
|
|
|
int ext2_alloc(struct inode *, daddr_t, e4fs_daddr_t, int,
|
|
|
|
struct ucred *, e4fs_daddr_t *);
|
2017-10-24 20:10:08 +00:00
|
|
|
e4fs_daddr_t ext2_alloc_meta(struct inode *ip);
|
2002-03-19 22:40:48 +00:00
|
|
|
int ext2_balloc(struct inode *,
|
2013-06-23 02:44:42 +00:00
|
|
|
e2fs_lbn_t, int, struct ucred *, struct buf **, int);
|
2002-03-19 22:40:48 +00:00
|
|
|
int ext2_blkatoff(struct vnode *, off_t, char **, struct buf **);
|
2013-08-13 15:40:43 +00:00
|
|
|
void ext2_blkfree(struct inode *, e4fs_daddr_t, long);
|
|
|
|
e4fs_daddr_t ext2_blkpref(struct inode *, e2fs_lbn_t, int, e2fs_daddr_t *,
|
|
|
|
e2fs_daddr_t);
|
2002-03-19 22:40:48 +00:00
|
|
|
int ext2_bmap(struct vop_bmap_args *);
|
2013-08-13 15:40:43 +00:00
|
|
|
int ext2_bmaparray(struct vnode *, daddr_t, daddr_t *, int *, int *);
|
2017-10-17 20:45:44 +00:00
|
|
|
int ext4_bmapext(struct vnode *, int32_t, int64_t *, int *, int *);
|
2017-10-24 20:10:08 +00:00
|
|
|
void ext2_clusteracct(struct m_ext2fs *, char *, int, e4fs_daddr_t, int);
|
2002-05-16 19:08:03 +00:00
|
|
|
void ext2_dirbad(struct inode *ip, doff_t offset, char *how);
|
2017-09-27 16:12:13 +00:00
|
|
|
void ext2_fserr(struct m_ext2fs *, uid_t, char *);
|
2018-01-14 20:46:39 +00:00
|
|
|
int ext2_ei2i(struct ext2fs_dinode *, struct inode *);
|
2013-08-13 15:40:43 +00:00
|
|
|
int ext2_getlbns(struct vnode *, daddr_t, struct indir *, int *);
|
2017-09-27 16:12:13 +00:00
|
|
|
int ext2_i2ei(struct inode *, struct ext2fs_dinode *);
|
2002-05-16 19:08:03 +00:00
|
|
|
void ext2_itimes(struct vnode *vp);
|
2013-06-26 19:43:22 +00:00
|
|
|
int ext2_reallocblks(struct vop_reallocblks_args *);
|
2002-03-19 22:40:48 +00:00
|
|
|
int ext2_reclaim(struct vop_reclaim_args *);
|
|
|
|
int ext2_truncate(struct vnode *, off_t, int, struct ucred *, struct thread *);
|
|
|
|
int ext2_update(struct vnode *, int);
|
|
|
|
int ext2_valloc(struct vnode *, int, struct ucred *, struct vnode **);
|
|
|
|
int ext2_vfree(struct vnode *, ino_t, int);
|
2004-12-01 23:16:38 +00:00
|
|
|
int ext2_vinit(struct mount *, struct vop_vector *, struct vnode **vpp);
|
2014-02-28 21:25:32 +00:00
|
|
|
int ext2_lookup(struct vop_cachedlookup_args *);
|
|
|
|
int ext2_readdir(struct vop_readdir_args *);
|
2014-11-12 16:23:56 +00:00
|
|
|
#ifdef EXT2FS_DEBUG
|
2002-03-19 22:40:48 +00:00
|
|
|
void ext2_print_inode(struct inode *);
|
2014-11-12 16:23:56 +00:00
|
|
|
#endif
|
2002-03-19 22:40:48 +00:00
|
|
|
int ext2_direnter(struct inode *,
|
|
|
|
struct vnode *, struct componentname *);
|
|
|
|
int ext2_dirremove(struct vnode *, struct componentname *);
|
|
|
|
int ext2_dirrewrite(struct inode *,
|
|
|
|
struct inode *, struct componentname *);
|
|
|
|
int ext2_dirempty(struct inode *, ino_t, struct ucred *);
|
|
|
|
int ext2_checkpath(struct inode *, struct inode *, struct ucred *);
|
2017-06-20 14:28:51 +00:00
|
|
|
int ext2_cg_has_sb(struct m_ext2fs *fs, int cg);
|
2002-03-19 22:40:48 +00:00
|
|
|
int ext2_inactive(struct vop_inactive_args *);
|
2016-01-21 14:50:28 +00:00
|
|
|
int ext2_htree_add_entry(struct vnode *, struct ext2fs_direct_2 *,
|
|
|
|
struct componentname *);
|
|
|
|
int ext2_htree_create_index(struct vnode *, struct componentname *,
|
|
|
|
struct ext2fs_direct_2 *);
|
|
|
|
int ext2_htree_has_idx(struct inode *);
|
|
|
|
int ext2_htree_hash(const char *, int, uint32_t *, int, uint32_t *,
|
|
|
|
uint32_t *);
|
|
|
|
int ext2_htree_lookup(struct inode *, const char *, int, struct buf **,
|
|
|
|
int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot *);
|
|
|
|
int ext2_search_dirblock(struct inode *, void *, int *, const char *, int,
|
|
|
|
int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot *);
|
2018-01-05 10:04:01 +00:00
|
|
|
uint32_t e2fs_gd_get_ndirs(struct ext2_gd *gd);
|
2018-01-14 20:46:39 +00:00
|
|
|
uint64_t e2fs_gd_get_i_tables(struct ext2_gd *);
|
|
|
|
void ext2_sb_csum_set_seed(struct m_ext2fs *);
|
|
|
|
int ext2_sb_csum_verify(struct m_ext2fs *);
|
|
|
|
void ext2_sb_csum_set(struct m_ext2fs *);
|
|
|
|
int ext2_extattr_blk_csum_verify(struct inode *, struct buf *);
|
|
|
|
void ext2_extattr_blk_csum_set(struct inode *, struct buf *);
|
|
|
|
int ext2_dir_blk_csum_verify(struct inode *, struct buf *);
|
|
|
|
void ext2_dir_blk_csum_set(struct inode *, struct buf *);
|
|
|
|
void ext2_dir_blk_csum_set_mem(struct inode *, char *, int);
|
|
|
|
int ext2_extent_blk_csum_verify(struct inode *, void *);
|
|
|
|
void ext2_extent_blk_csum_set(struct inode *, void *);
|
|
|
|
int ext2_gd_i_bitmap_csum_verify(struct m_ext2fs *, int, struct buf *);
|
|
|
|
void ext2_gd_i_bitmap_csum_set(struct m_ext2fs *, int, struct buf *);
|
|
|
|
int ext2_gd_b_bitmap_csum_verify(struct m_ext2fs *, int, struct buf *);
|
|
|
|
void ext2_gd_b_bitmap_csum_set(struct m_ext2fs *, int, struct buf *);
|
|
|
|
int ext2_ei_csum_verify(struct inode *, struct ext2fs_dinode *);
|
|
|
|
void ext2_ei_csum_set(struct inode *, struct ext2fs_dinode *);
|
|
|
|
int ext2_gd_csum_verify(struct m_ext2fs *, struct cdev *);
|
|
|
|
void ext2_gd_csum_set(struct m_ext2fs *);
|
2016-01-21 14:50:28 +00:00
|
|
|
|
1995-11-05 23:25:12 +00:00
|
|
|
|
2011-04-28 14:27:17 +00:00
|
|
|
/* Flags to low-level allocation routines.
|
|
|
|
* The low 16-bits are reserved for IO_ flags from vnode.h.
|
|
|
|
*/
|
|
|
|
#define BA_CLRBUF 0x00010000 /* Clear invalid areas of buffer. */
|
|
|
|
#define BA_SEQMASK 0x7F000000 /* Bits holding seq heuristic. */
|
|
|
|
#define BA_SEQSHIFT 24
|
|
|
|
#define BA_SEQMAX 0x7F
|
1995-11-05 23:25:12 +00:00
|
|
|
|
2004-12-01 23:16:38 +00:00
|
|
|
extern struct vop_vector ext2_vnodeops;
|
|
|
|
extern struct vop_vector ext2_fifoops;
|
1996-05-01 02:16:17 +00:00
|
|
|
|
2016-12-28 15:43:17 +00:00
|
|
|
#endif /* !_FS_EXT2FS_EXT2_EXTERN_H_ */
|