diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/bfs_fs.h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'include/linux/bfs_fs.h')
-rw-r--r-- | include/linux/bfs_fs.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/include/linux/bfs_fs.h b/include/linux/bfs_fs.h new file mode 100644 index 000000000000..f7f0913cd110 --- /dev/null +++ b/include/linux/bfs_fs.h | |||
@@ -0,0 +1,79 @@ | |||
1 | /* | ||
2 | * include/linux/bfs_fs.h - BFS data structures on disk. | ||
3 | * Copyright (C) 1999 Tigran Aivazian <tigran@veritas.com> | ||
4 | */ | ||
5 | |||
6 | #ifndef _LINUX_BFS_FS_H | ||
7 | #define _LINUX_BFS_FS_H | ||
8 | |||
9 | #define BFS_BSIZE_BITS 9 | ||
10 | #define BFS_BSIZE (1<<BFS_BSIZE_BITS) | ||
11 | |||
12 | #define BFS_MAGIC 0x1BADFACE | ||
13 | #define BFS_ROOT_INO 2 | ||
14 | #define BFS_INODES_PER_BLOCK 8 | ||
15 | |||
16 | /* SVR4 vnode type values (bfs_inode->i_vtype) */ | ||
17 | #define BFS_VDIR 2 | ||
18 | #define BFS_VREG 1 | ||
19 | |||
20 | /* BFS inode layout on disk */ | ||
21 | struct bfs_inode { | ||
22 | __u16 i_ino; | ||
23 | __u16 i_unused; | ||
24 | __u32 i_sblock; | ||
25 | __u32 i_eblock; | ||
26 | __u32 i_eoffset; | ||
27 | __u32 i_vtype; | ||
28 | __u32 i_mode; | ||
29 | __s32 i_uid; | ||
30 | __s32 i_gid; | ||
31 | __u32 i_nlink; | ||
32 | __u32 i_atime; | ||
33 | __u32 i_mtime; | ||
34 | __u32 i_ctime; | ||
35 | __u32 i_padding[4]; | ||
36 | }; | ||
37 | |||
38 | #define BFS_NAMELEN 14 | ||
39 | #define BFS_DIRENT_SIZE 16 | ||
40 | #define BFS_DIRS_PER_BLOCK 32 | ||
41 | |||
42 | struct bfs_dirent { | ||
43 | __u16 ino; | ||
44 | char name[BFS_NAMELEN]; | ||
45 | }; | ||
46 | |||
47 | /* BFS superblock layout on disk */ | ||
48 | struct bfs_super_block { | ||
49 | __u32 s_magic; | ||
50 | __u32 s_start; | ||
51 | __u32 s_end; | ||
52 | __s32 s_from; | ||
53 | __s32 s_to; | ||
54 | __s32 s_bfrom; | ||
55 | __s32 s_bto; | ||
56 | char s_fsname[6]; | ||
57 | char s_volume[6]; | ||
58 | __u32 s_padding[118]; | ||
59 | }; | ||
60 | |||
61 | #define BFS_NZFILESIZE(ip) \ | ||
62 | (((ip)->i_eoffset + 1) - (ip)->i_sblock * BFS_BSIZE) | ||
63 | |||
64 | #define BFS_FILESIZE(ip) \ | ||
65 | ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip)) | ||
66 | |||
67 | #define BFS_FILEBLOCKS(ip) \ | ||
68 | ((ip)->i_sblock == 0 ? 0 : ((ip)->i_eblock + 1) - (ip)->i_sblock) | ||
69 | |||
70 | #define BFS_OFF2INO(offset) \ | ||
71 | ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO) | ||
72 | |||
73 | #define BFS_INO2OFF(ino) \ | ||
74 | ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE) | ||
75 | |||
76 | #define BFS_UNCLEAN(bfs_sb, sb) \ | ||
77 | ((bfs_sb->s_from != -1) && (bfs_sb->s_to != -1) && !(sb->s_flags & MS_RDONLY)) | ||
78 | |||
79 | #endif /* _LINUX_BFS_FS_H */ | ||