|
|
1.1 root 1: .TH WORM 5
2: .CT 1 dirs
3: .SH NAME
4: worm \- format of worm disks
5: .SH SYNOPSIS
6: .B #include <worm.h>
7: .SH DESCRIPTION
8: A
9: .SM WORM
10: disk is a linked list of `superblocks', roughly one for every
11: .I "worm write"
12: on the
13: .SM WORM.
14: The `governing' superblock is at block zero if it exists and
15: has a valid magic number;
16: otherwise the governing superblock is the last superblock in
17: the linked list starting at block 1.
18: (The link to the next superblock is preallocated
19: and thus the last superblock in the list will be unwritten.)
20: Each superblock has some status information and a pointer
21: to a set of `inodes' describing a set of files.
22: The status information for the
23: .SM WORM
24: is that of the governing superblock;
25: the set of files on the
26: .SM WORM
27: is the accumulation of all the superblocks
28: taken in order.
29: The structure of a superblock as given in the
30: include file is:
31: .LP
32: .EX
33: .ta \w'#define 'u +\w'unsigned 'u +\w'mment[128]; 'u
34: #define SMAGIC 0x21746967
35: #define VLINK 1 /* linked list superblock */
36: #define VBTREE 2 /* cbt superblock */
37: typedef struct superblock
38: {
39: long magic; /* magic number for superblock */
40: unsigned short blocksize; /* physical size of blocks */
41: short version; /* type of superblock */
42: long nblocks; /* number of blocks on device */
43: long zero; /* first logical data block */
44: long nfree; /* number of free blocks */
45: long ninodes; /* number of inodes */
46: long ninochars; /* number of bytes of inode names */
47: long binodes; /* start of inodes */
48: long nextffree; /* next free file block */
49: long nextsb; /* next superblock */
50: short fd; /* fildes for device (in core) */
51: char vol_id[128]; /* name the disk can be mounted as */
52: char comment[128]; /* comments */
53: long myblock; /* where this superblock is */
54: long nF; /* bytes for .F (VBTREE) */
55: long nT; /* bytes for .T (VBTREE) */
56: long ctime; /* create time for this superblock */
57: } superblock;
58: .EE
59: .PP
60: superblocks are padded with zeros to
61: .BR blocksize .
62: .PP
63: Following each
64: .B VLINK
65: superblock is a set of inodes, a string table, and then the data blocks
66: for the files described by the inodes.
67: Following a (there is at most one)
68: .B VBTREE
69: superblock
70: there is a set of inodes, a string table and the
71: .B .F
72: and
73: .B .T
74: files for a
75: .IR cbt (1)
76: database where the keys are filenames and the data is an inode number.
77: .LP
78: .EX
79: #define DMAGIC 0x3A746967
80: typedef struct Inode
81: {
82: long magic; /* magic number for Dirent */
83: long block; /* starting block of file */
84: long nbytes; /* bytes in file */
85: long ctime; /* creation time */
86: union {
87: char *n; /* core - name */
88: long o; /* disk - offset into chars block */
89: } name; /* filename */
90: long pad1 /* to 32 bytes */
91: short mode /* as in \fIstat\fP(2) */
92: short uid /* owner */
93: short gid /* owner */
94: short pad2 /* to 32 bytes */
95: } Inode
96: .EE
97: .PP
98: If the
99: .B block
100: field of an inode is negative,
101: the file has been deleted.
102: .SH "SEE ALSO"
103: .IR worm (8)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.