1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _LINUX_BFS_FS_H
20 #define _LINUX_BFS_FS_H
21 #include <linux/types.h>
22 #define BFS_BSIZE_BITS 9
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 #define BFS_BSIZE (1<<BFS_BSIZE_BITS)
25 #define BFS_MAGIC 0x1BADFACE
26 #define BFS_ROOT_INO 2
27 #define BFS_INODES_PER_BLOCK 8
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 #define BFS_VDIR 2L
30 #define BFS_VREG 1L
31 struct bfs_inode {
32  __le16 i_ino;
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34  __u16 i_unused;
35  __le32 i_sblock;
36  __le32 i_eblock;
37  __le32 i_eoffset;
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39  __le32 i_vtype;
40  __le32 i_mode;
41  __le32 i_uid;
42  __le32 i_gid;
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44  __le32 i_nlink;
45  __le32 i_atime;
46  __le32 i_mtime;
47  __le32 i_ctime;
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49  __u32 i_padding[4];
50 };
51 #define BFS_NAMELEN 14
52 #define BFS_DIRENT_SIZE 16
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54 #define BFS_DIRS_PER_BLOCK 32
55 struct bfs_dirent {
56  __le16 ino;
57  char name[BFS_NAMELEN];
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59 };
60 struct bfs_super_block {
61  __le32 s_magic;
62  __le32 s_start;
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64  __le32 s_end;
65  __le32 s_from;
66  __le32 s_to;
67  __s32 s_bfrom;
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69  __s32 s_bto;
70  char s_fsname[6];
71  char s_volume[6];
72  __u32 s_padding[118];
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 };
75 #define BFS_OFF2INO(offset)   ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO)
76 #define BFS_INO2OFF(ino)   ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE)
77 #define BFS_NZFILESIZE(ip)   ((le32_to_cpu((ip)->i_eoffset) + 1) - le32_to_cpu((ip)->i_sblock) * BFS_BSIZE)
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79 #define BFS_FILESIZE(ip)   ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip))
80 #define BFS_FILEBLOCKS(ip)   ((ip)->i_sblock == 0 ? 0 : (le32_to_cpu((ip)->i_eblock) + 1) - le32_to_cpu((ip)->i_sblock))
81 #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 & MS_RDONLY))
82 #endif
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84