|
|
1.1 root 1: /*
2: * Structure of the super-block
3: */
4: struct filsys
5: {
6: unsigned short s_isize; /* size in blocks of i-list */
7: daddr_t s_fsize; /* size in blocks of entire volume */
8: short s_ninode; /* number of i-nodes in s_inode */
9: ino_t s_inode[NICINOD]; /* free i-node list */
10: char s_flock; /* lock during free list manipulation */
11: char s_ilock; /* lock during i-list manipulation */
12: char s_fmod; /* super block modified flag */
13: char s_ronly; /* mounted read-only flag */
14: time_t s_time; /* last super block update */
15: daddr_t s_tfree; /* total free blocks*/
16: ino_t s_tinode; /* total free inodes */
17: short s_dinfo[2]; /* interleave stuff */
18: #define s_m s_dinfo[0] /* only mkfs.c? */
19: #define s_n s_dinfo[1]
20: #define s_cylsize s_dinfo[0]
21: #define s_aspace s_dinfo[1]
22: char s_fsmnt[14]; /* ordinary file mounted on */
23: ino_t s_lasti; /* start place for circular search */
24: ino_t s_nbehind; /* est # free inodes before s_lasti */
25: union {
26: struct {
27: short S_nfree;/* number of addresses in s_free */
28: daddr_t S_free[NICFREE];/* free block list */
29: } R;
30: struct {
31: char S_valid;/* 1 on disk means bit map valid */
32: char S_flag;
33: #define BITMAP 961
34: long S_bfree[BITMAP];/* bit map for free data blocks */
35: } B;
36: struct {
37: char S_valid;
38: char S_flag; /* 1 means bitmap not in S_bfree */
39: long S_bsize;/* how big the bitmap blocks are */
40: struct buf * S_blk[BITMAP-1];
41: } N;
42: } U;
43: };
44: #define s_nfree U.R.S_nfree
45: #define s_free U.R.S_free
46: #define s_valid U.B.S_valid
47: #define s_bfree U.B.S_bfree
48:
49: /*
50: * fiddle bits in free block bitmap
51: * assume NBBY*sizeof(long) is a power of 2
52: */
53: #define BITCELL (NBBY*sizeof(long))
54: #define BITISFREE(p, i) (p[(i)/BITCELL]&(1<<((i)&(BITCELL-1))))
55: #define BITFREE(p, i) (p[(i)/BITCELL]|=(1<<((i)&(BITCELL-1))))
56: #define BITALLOC(p, i) (p[(i)/BITCELL]&=~(1<<((i)&(BITCELL-1))))
57:
58: #ifdef KERNEL
59: struct filsys *getfs();
60: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.