]>
git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - include/linux/bfs_fs.h
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) */
21 /* BFS inode layout on disk */
39 #define BFS_NAMELEN 14
40 #define BFS_DIRENT_SIZE 16
41 #define BFS_DIRS_PER_BLOCK 32
45 char name
[BFS_NAMELEN
];
48 /* BFS superblock layout on disk */
49 struct bfs_super_block
{
63 #define BFS_OFF2INO(offset) \
64 ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO)
66 #define BFS_INO2OFF(ino) \
67 ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE)
68 #define BFS_NZFILESIZE(ip) \
69 ((le32_to_cpu((ip)->i_eoffset) + 1) - le32_to_cpu((ip)->i_sblock) * BFS_BSIZE)
71 #define BFS_FILESIZE(ip) \
72 ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip))
74 #define BFS_FILEBLOCKS(ip) \
75 ((ip)->i_sblock == 0 ? 0 : (le32_to_cpu((ip)->i_eblock) + 1) - le32_to_cpu((ip)->i_sblock))
76 #define BFS_UNCLEAN(bfs_sb, sb) \
77 ((le32_to_cpu(bfs_sb->s_from) != -1) && (le32_to_cpu(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY))
80 #endif /* _LINUX_BFS_FS_H */