|
Last change
on this file was
2,
checked in by jglee, 11 years ago
|
|
first commit
|
-
Property svn:executable set to
*
|
|
File size:
1.7 KB
|
| Line | |
|---|
| 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 | #include <asm/types.h> |
|---|
| 10 | |
|---|
| 11 | #define BFS_BSIZE_BITS 9 |
|---|
| 12 | #define BFS_BSIZE (1<<BFS_BSIZE_BITS) |
|---|
| 13 | |
|---|
| 14 | #define BFS_MAGIC 0x1BADFACE |
|---|
| 15 | #define BFS_ROOT_INO 2 |
|---|
| 16 | #define BFS_INODES_PER_BLOCK 8 |
|---|
| 17 | |
|---|
| 18 | /* SVR4 vnode type values (bfs_inode->i_vtype) */ |
|---|
| 19 | #define BFS_VDIR 2 |
|---|
| 20 | #define BFS_VREG 1 |
|---|
| 21 | |
|---|
| 22 | /* BFS inode layout on disk */ |
|---|
| 23 | struct bfs_inode { |
|---|
| 24 | __u16 i_ino; |
|---|
| 25 | __u16 i_unused; |
|---|
| 26 | __u32 i_sblock; |
|---|
| 27 | __u32 i_eblock; |
|---|
| 28 | __u32 i_eoffset; |
|---|
| 29 | __u32 i_vtype; |
|---|
| 30 | __u32 i_mode; |
|---|
| 31 | __s32 i_uid; |
|---|
| 32 | __s32 i_gid; |
|---|
| 33 | __u32 i_nlink; |
|---|
| 34 | __u32 i_atime; |
|---|
| 35 | __u32 i_mtime; |
|---|
| 36 | __u32 i_ctime; |
|---|
| 37 | __u32 i_padding[4]; |
|---|
| 38 | }; |
|---|
| 39 | |
|---|
| 40 | #define BFS_NAMELEN 14 |
|---|
| 41 | #define BFS_DIRENT_SIZE 16 |
|---|
| 42 | #define BFS_DIRS_PER_BLOCK 32 |
|---|
| 43 | |
|---|
| 44 | struct bfs_dirent { |
|---|
| 45 | __u16 ino; |
|---|
| 46 | char name[BFS_NAMELEN]; |
|---|
| 47 | }; |
|---|
| 48 | |
|---|
| 49 | /* BFS superblock layout on disk */ |
|---|
| 50 | struct bfs_super_block { |
|---|
| 51 | __u32 s_magic; |
|---|
| 52 | __u32 s_start; |
|---|
| 53 | __u32 s_end; |
|---|
| 54 | __s32 s_from; |
|---|
| 55 | __s32 s_to; |
|---|
| 56 | __s32 s_bfrom; |
|---|
| 57 | __s32 s_bto; |
|---|
| 58 | char s_fsname[6]; |
|---|
| 59 | char s_volume[6]; |
|---|
| 60 | __u32 s_padding[118]; |
|---|
| 61 | }; |
|---|
| 62 | |
|---|
| 63 | #define BFS_NZFILESIZE(ip) \ |
|---|
| 64 | (((ip)->i_eoffset + 1) - (ip)->i_sblock * BFS_BSIZE) |
|---|
| 65 | |
|---|
| 66 | #define BFS_FILESIZE(ip) \ |
|---|
| 67 | ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip)) |
|---|
| 68 | |
|---|
| 69 | #define BFS_FILEBLOCKS(ip) \ |
|---|
| 70 | ((ip)->i_sblock == 0 ? 0 : ((ip)->i_eblock + 1) - (ip)->i_sblock) |
|---|
| 71 | |
|---|
| 72 | #define BFS_OFF2INO(offset) \ |
|---|
| 73 | ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO) |
|---|
| 74 | |
|---|
| 75 | #define BFS_INO2OFF(ino) \ |
|---|
| 76 | ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE) |
|---|
| 77 | |
|---|
| 78 | #define BFS_UNCLEAN(bfs_sb, sb) \ |
|---|
| 79 | ((bfs_sb->s_from != -1) && (bfs_sb->s_to != -1) && !(sb->s_flags & MS_RDONLY)) |
|---|
| 80 | |
|---|
| 81 | #endif /* _LINUX_BFS_FS_H */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.