2 * include/linux/bfs_fs.h - BFS data structures on disk.
3 * Copyright (C) 1999 Tigran Aivazian <tigran@veritas.com>
6 #ifndef _LINUX_BFS_FS_H
7 #define _LINUX_BFS_FS_H
9 #define BFS_BSIZE_BITS 9
10 #define BFS_BSIZE (1<<BFS_BSIZE_BITS)
12 #define BFS_MAGIC 0x1BADFACE
13 #define BFS_ROOT_INO 2
14 #define BFS_INODES_PER_BLOCK 8
16 /* SVR4 vnode type values (bfs_inode->i_vtype) */
20 /* BFS inode layout on disk */
38 #define BFS_NAMELEN 14
39 #define BFS_DIRENT_SIZE 16
40 #define BFS_DIRS_PER_BLOCK 32
44 char name[BFS_NAMELEN];
47 /* BFS superblock layout on disk */
48 struct bfs_super_block {
61 #define BFS_NZFILESIZE(ip) \
62 (((ip)->i_eoffset + 1) - (ip)->i_sblock * BFS_BSIZE)
64 #define BFS_FILESIZE(ip) \
65 ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip))
67 #define BFS_FILEBLOCKS(ip) \
68 ((ip)->i_sblock == 0 ? 0 : ((ip)->i_eblock + 1) - (ip)->i_sblock)
70 #define BFS_OFF2INO(offset) \
71 ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO)
73 #define BFS_INO2OFF(ino) \
74 ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE)
76 #define BFS_UNCLEAN(bfs_sb, sb) \
77 ((bfs_sb->s_from != -1) && (bfs_sb->s_to != -1) && !(sb->s_flags & MS_RDONLY))
79 #endif /* _LINUX_BFS_FS_H */