efs_subr.h revision 1.1 1 1.1 rumble /* $NetBSD: efs_subr.h,v 1.1 2007/06/29 23:30:30 rumble Exp $ */
2 1.1 rumble
3 1.1 rumble /*
4 1.1 rumble * Copyright (c) 2006 Stephen M. Rumble <rumble (at) ephemeral.org>
5 1.1 rumble *
6 1.1 rumble * Permission to use, copy, modify, and distribute this software for any
7 1.1 rumble * purpose with or without fee is hereby granted, provided that the above
8 1.1 rumble * copyright notice and this permission notice appear in all copies.
9 1.1 rumble *
10 1.1 rumble * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 1.1 rumble * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 1.1 rumble * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 1.1 rumble * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 1.1 rumble * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 1.1 rumble * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 1.1 rumble * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 1.1 rumble */
18 1.1 rumble
19 1.1 rumble #ifndef _FS_EFS_EFS_SUBR_H_
20 1.1 rumble #define _FS_EFS_EFS_SUBR_H_
21 1.1 rumble
22 1.1 rumble extern struct pool efs_inode_pool;
23 1.1 rumble
24 1.1 rumble struct efs_extent_iterator {
25 1.1 rumble struct efs_inode *exi_eip;
26 1.1 rumble off_t exi_next; /* next logical extent*/
27 1.1 rumble off_t exi_dnext; /* next direct extent */
28 1.1 rumble off_t exi_innext; /* next indirect ext */
29 1.1 rumble struct efs_dextent *exi_incache; /* indirect ext cache */
30 1.1 rumble size_t exi_nincache; /* size of incache */
31 1.1 rumble };
32 1.1 rumble
33 1.1 rumble int32_t efs_sb_checksum(struct efs_sb *, int);
34 1.1 rumble int efs_sb_validate(struct efs_sb *, const char **);
35 1.1 rumble void efs_locate_inode(ino_t, struct efs_sb *, uint32_t *, int *);
36 1.1 rumble int efs_read_inode(struct efs_mount *, ino_t, struct lwp *,
37 1.1 rumble struct efs_dinode *);
38 1.1 rumble void efs_dextent_to_extent(struct efs_dextent *, struct efs_extent *);
39 1.1 rumble void efs_extent_to_dextent(struct efs_extent *, struct efs_dextent *);
40 1.1 rumble int efs_inode_lookup(struct efs_mount *, struct efs_inode *,
41 1.1 rumble struct componentname *, ino_t *);
42 1.1 rumble int efs_bread(struct efs_mount *, uint32_t, int, struct lwp *,
43 1.1 rumble struct buf **);
44 1.1 rumble void efs_sync_inode_to_dinode(struct efs_inode *);
45 1.1 rumble void efs_sync_dinode_to_inode(struct efs_inode *);
46 1.1 rumble void efs_extent_iterator_init(struct efs_extent_iterator *,
47 1.1 rumble struct efs_inode *);
48 1.1 rumble int efs_extent_iterator_next(struct efs_extent_iterator *,
49 1.1 rumble struct efs_extent *);
50 1.1 rumble void efs_extent_iterator_free(struct efs_extent_iterator *);
51 1.1 rumble
52 1.1 rumble #endif /* !_FS_EFS_EFS_SUBR_H_ */
53