• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef _LINUX_BFS_FS_H
8 #define _LINUX_BFS_FS_H
9 #include <linux/types.h>
10 #define BFS_BSIZE_BITS 9
11 #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
15 #define BFS_VDIR 2L
16 #define BFS_VREG 1L
17 struct bfs_inode {
18   __le16 i_ino;
19   __u16 i_unused;
20   __le32 i_sblock;
21   __le32 i_eblock;
22   __le32 i_eoffset;
23   __le32 i_vtype;
24   __le32 i_mode;
25   __le32 i_uid;
26   __le32 i_gid;
27   __le32 i_nlink;
28   __le32 i_atime;
29   __le32 i_mtime;
30   __le32 i_ctime;
31   __u32 i_padding[4];
32 };
33 #define BFS_NAMELEN 14
34 #define BFS_DIRENT_SIZE 16
35 #define BFS_DIRS_PER_BLOCK 32
36 struct bfs_dirent {
37   __le16 ino;
38   char name[BFS_NAMELEN];
39 };
40 struct bfs_super_block {
41   __le32 s_magic;
42   __le32 s_start;
43   __le32 s_end;
44   __le32 s_from;
45   __le32 s_to;
46   __s32 s_bfrom;
47   __s32 s_bto;
48   char s_fsname[6];
49   char s_volume[6];
50   __u32 s_padding[118];
51 };
52 #define BFS_OFF2INO(offset) ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO)
53 #define BFS_INO2OFF(ino) ((__u32) (((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE)
54 #define BFS_NZFILESIZE(ip) ((le32_to_cpu((ip)->i_eoffset) + 1) - le32_to_cpu((ip)->i_sblock) * BFS_BSIZE)
55 #define BFS_FILESIZE(ip) ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip))
56 #define BFS_FILEBLOCKS(ip) ((ip)->i_sblock == 0 ? 0 : (le32_to_cpu((ip)->i_eblock) + 1) - le32_to_cpu((ip)->i_sblock))
57 #define BFS_UNCLEAN(bfs_sb,sb) ((le32_to_cpu(bfs_sb->s_from) != - 1) && (le32_to_cpu(bfs_sb->s_to) != - 1) && ! (sb->s_flags & SB_RDONLY))
58 #endif
59