ext2_extern.h revision 331722
1/*-
2 *  modified for EXT2FS support in Lites 1.1
3 *
4 *  Aug 1995, Godmar Back (gback@cs.utah.edu)
5 *  University of Utah, Department of Computer Science
6 */
7/*-
8 * Copyright (c) 1991, 1993, 1994
9 *	The Regents of the University of California.  All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 *    notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 *    notice, this list of conditions and the following disclaimer in the
18 *    documentation and/or other materials provided with the distribution.
19 * 4. Neither the name of the University nor the names of its contributors
20 *    may be used to endorse or promote products derived from this software
21 *    without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 *	@(#)ffs_extern.h	8.3 (Berkeley) 4/16/94
36 * $FreeBSD: stable/11/sys/fs/ext2fs/ext2_extern.h 331722 2018-03-29 02:50:57Z eadler $
37 */
38
39#ifndef _FS_EXT2FS_EXT2_EXTERN_H_
40#define	_FS_EXT2FS_EXT2_EXTERN_H_
41
42struct ext2fs_dinode;
43struct ext2fs_direct_2;
44struct ext2fs_searchslot;
45struct indir;
46struct inode;
47struct mount;
48struct vfsconf;
49struct vnode;
50
51int	ext2_add_entry(struct vnode *, struct ext2fs_direct_2 *);
52int	ext2_alloc(struct inode *, daddr_t, e4fs_daddr_t, int,
53	    struct ucred *, e4fs_daddr_t *);
54daddr_t ext2_allocfacl(struct inode *ip);
55int	ext2_balloc(struct inode *,
56	    e2fs_lbn_t, int, struct ucred *, struct buf **, int);
57int	ext2_blkatoff(struct vnode *, off_t, char **, struct buf **);
58void	ext2_blkfree(struct inode *,  e4fs_daddr_t, long);
59e4fs_daddr_t	ext2_blkpref(struct inode *, e2fs_lbn_t, int, e2fs_daddr_t *,
60	    e2fs_daddr_t);
61int	ext2_bmap(struct vop_bmap_args *);
62int	ext2_bmaparray(struct vnode *, daddr_t, daddr_t *, int *, int *);
63void	ext2_clusteracct(struct m_ext2fs *, char *, int, daddr_t, int);
64void	ext2_dirbad(struct inode *ip, doff_t offset, char *how);
65void	ext2_fserr(struct m_ext2fs *, uid_t, char *);
66void	ext2_ei2i(struct ext2fs_dinode *, struct inode *);
67int	ext2_getlbns(struct vnode *, daddr_t, struct indir *, int *);
68int	ext2_i2ei(struct inode *, struct ext2fs_dinode *);
69void	ext2_itimes(struct vnode *vp);
70int	ext2_reallocblks(struct vop_reallocblks_args *);
71int	ext2_reclaim(struct vop_reclaim_args *);
72int	ext2_truncate(struct vnode *, off_t, int, struct ucred *, struct thread *);
73int	ext2_update(struct vnode *, int);
74int	ext2_valloc(struct vnode *, int, struct ucred *, struct vnode **);
75int	ext2_vfree(struct vnode *, ino_t, int);
76int	ext2_vinit(struct mount *, struct vop_vector *, struct vnode **vpp);
77int	ext2_lookup(struct vop_cachedlookup_args *);
78int	ext2_readdir(struct vop_readdir_args *);
79#ifdef EXT2FS_DEBUG
80void	ext2_print_inode(struct inode *);
81#endif
82int	ext2_direnter(struct inode *,
83		struct vnode *, struct componentname *);
84int	ext2_dirremove(struct vnode *, struct componentname *);
85int	ext2_dirrewrite(struct inode *,
86		struct inode *, struct componentname *);
87int	ext2_dirempty(struct inode *, ino_t, struct ucred *);
88int	ext2_checkpath(struct inode *, struct inode *, struct ucred *);
89int	ext2_cg_has_sb(struct m_ext2fs *fs, int cg);
90int	ext2_inactive(struct vop_inactive_args *);
91int	ext2_htree_add_entry(struct vnode *, struct ext2fs_direct_2 *,
92	    struct componentname *);
93int	ext2_htree_create_index(struct vnode *, struct componentname *,
94	    struct ext2fs_direct_2 *);
95int	ext2_htree_has_idx(struct inode *);
96int	ext2_htree_hash(const char *, int, uint32_t *, int, uint32_t *,
97	    uint32_t *);
98int	ext2_htree_lookup(struct inode *, const char *, int, struct buf **,
99	    int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot *);
100int	ext2_search_dirblock(struct inode *, void *, int *, const char *, int,
101	    int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot *);
102int	ext2_gd_csum_verify(struct m_ext2fs *fs, struct cdev *dev);
103void	ext2_gd_csum_set(struct m_ext2fs *fs);
104
105
106/* Flags to low-level allocation routines.
107 * The low 16-bits are reserved for IO_ flags from vnode.h.
108 */
109#define	BA_CLRBUF	0x00010000	/* Clear invalid areas of buffer. */
110#define	BA_SEQMASK	0x7F000000	/* Bits holding seq heuristic. */
111#define	BA_SEQSHIFT	24
112#define	BA_SEQMAX	0x7F
113
114extern struct vop_vector ext2_vnodeops;
115extern struct vop_vector ext2_fifoops;
116
117#endif	/* !_FS_EXT2FS_EXT2_EXTERN_H_ */
118