]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - sys/gnu/fs/ext2fs/ext2_extern.h
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / sys / gnu / fs / ext2fs / ext2_extern.h
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$
37  */
38
39 #ifndef _SYS_GNU_EXT2FS_EXT2_EXTERN_H_
40 #define _SYS_GNU_EXT2FS_EXT2_EXTERN_H_
41
42 struct ext2_inode;
43 struct indir;
44 struct inode;
45 struct mount;
46 struct vfsconf;
47 struct vnode;
48
49 int     ext2_alloc(struct inode *,
50             int32_t, int32_t, int, struct ucred *, int32_t *);
51 int     ext2_balloc(struct inode *,
52             int32_t, int, struct ucred *, struct buf **, int);
53 int     ext2_blkatoff(struct vnode *, off_t, char **, struct buf **);
54 void    ext2_blkfree(struct inode *, int32_t, long);
55 int32_t ext2_blkpref(struct inode *, int32_t, int, int32_t *, int32_t);
56 int     ext2_bmap(struct vop_bmap_args *);
57 int     ext2_bmaparray(struct vnode *, int32_t, int32_t *, int *, int *);
58 void    ext2_dirbad(struct inode *ip, doff_t offset, char *how);
59 void    ext2_ei2i(struct ext2_inode *, struct inode *);
60 int     ext2_getlbns(struct vnode *, int32_t, struct indir *, int *);
61 void    ext2_i2ei(struct inode *, struct ext2_inode *);
62 void    ext2_itimes(struct vnode *vp);
63 int     ext2_reallocblks(struct vop_reallocblks_args *);
64 int     ext2_reclaim(struct vop_reclaim_args *);
65 void    ext2_setblock(struct ext2_sb_info *, u_char *, int32_t);
66 int     ext2_truncate(struct vnode *, off_t, int, struct ucred *, struct thread *);
67 int     ext2_update(struct vnode *, int);
68 int     ext2_valloc(struct vnode *, int, struct ucred *, struct vnode **);
69 int     ext2_vfree(struct vnode *, ino_t, int);
70 int     ext2_vinit(struct mount *, struct vop_vector *, struct vnode **vpp);
71 int     ext2_lookup(struct vop_cachedlookup_args *);
72 int     ext2_readdir(struct vop_readdir_args *);
73 void    ext2_print_inode(struct inode *);
74 int     ext2_direnter(struct inode *, 
75                 struct vnode *, struct componentname *);
76 int     ext2_dirremove(struct vnode *, struct componentname *);
77 int     ext2_dirrewrite(struct inode *,
78                 struct inode *, struct componentname *);
79 int     ext2_dirempty(struct inode *, ino_t, struct ucred *);
80 int     ext2_checkpath(struct inode *, struct inode *, struct ucred *);
81 struct  ext2_group_desc * get_group_desc(struct mount * , 
82                 unsigned int , struct buf ** );
83 int     ext2_group_sparse(int group);
84 void    ext2_discard_prealloc(struct inode *);
85 int     ext2_inactive(struct vop_inactive_args *);
86 int     ext2_new_block(struct mount * mp, unsigned long goal,
87             u_int32_t *prealloc_count, u_int32_t *prealloc_block);
88 ino_t   ext2_new_inode(const struct inode * dir, int mode);
89 unsigned long ext2_count_free(struct buf *map, unsigned int numchars);
90 void    ext2_free_blocks(struct mount *mp, unsigned long block,
91             unsigned long count);
92 void    ext2_free_inode(struct inode * inode);
93 void    mark_buffer_dirty(struct buf *bh);
94
95 /* Flags to low-level allocation routines. */
96 #define B_CLRBUF        0x01    /* Request allocated buffer be cleared. */
97 #define B_SYNC          0x02    /* Do all allocations synchronously. */
98 #define B_METAONLY      0x04    /* Return indirect block buffer. */
99 #define B_NOWAIT        0x08    /* do not sleep to await lock */
100
101 extern struct vop_vector ext2_vnodeops;
102 extern struct vop_vector ext2_fifoops;
103
104 #endif /* !_SYS_GNU_EXT2FS_EXT2_EXTERN_H_ */