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