efs.h
1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* Common include file for filesystem tools.
*
* $Revision: 1.1.1.1 $
*/
#include <sys/param.h>
#include <sys/types.h>
#include <sys/sysmacros.h>
#include <assert.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
#include <values.h>
#include <sys/fs/efs.h>
#include "efs_inode.h"
/*
* Operators for manipulating the bitmap
*/
#define bset(bp, b) (*((bp) + ((b) >> 3)) |= 1 << ((b) & 7))
#define bclr(bp, b) (*((bp) + ((b) >> 3)) &= ~(1 << ((b) & 7)))
#define btst(bp, b) (*((bp) + ((b) >> 3)) & (1 << ((b) & 7)))
/*
* Convenience stuff for easy thinking
*/
#define bzero(buf, len) memset((char *)(buf), 0, (len))
#define bcopy(from, to, count) memcpy((char *)(to), (char *)(from), (count))
extern int fs_fd; /* descriptor filesystem is open on */
extern struct efs *fs; /* pointer to superblock */
extern int error(); /* user provided error printer */
extern char *progname; /* program running */
extern char *bitmap; /* pointer to bitmap memory */
/* library exports */
extern struct efs_dinode *efs_iget();
extern void efs_iput();
extern void efs_mknod();
extern void efs_checksum();
extern void efs_extend();
extern void efs_write();
extern void efs_update();
extern ino_t efs_allocino();
extern void efs_bget();
extern void efs_bput();
extern daddr_t efs_bmap();
extern extent *efs_getextents();
extern void efs_enter();