blob: e2e0615b2b130cc432f59c0c37b0b6b56414fab5 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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 */
Tao Baod7db5942015-01-28 10:07:51 -080024#define BFS_BSIZE (1 << BFS_BSIZE_BITS)
Ben Cheng655a7c02013-10-16 16:09:24 -070025#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
31struct bfs_inode {
Tao Baod7db5942015-01-28 10:07:51 -080032 __le16 i_ino;
Ben Cheng655a7c02013-10-16 16:09:24 -070033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080034 __u16 i_unused;
35 __le32 i_sblock;
36 __le32 i_eblock;
37 __le32 i_eoffset;
Ben Cheng655a7c02013-10-16 16:09:24 -070038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080039 __le32 i_vtype;
40 __le32 i_mode;
41 __le32 i_uid;
42 __le32 i_gid;
Ben Cheng655a7c02013-10-16 16:09:24 -070043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080044 __le32 i_nlink;
45 __le32 i_atime;
46 __le32 i_mtime;
47 __le32 i_ctime;
Ben Cheng655a7c02013-10-16 16:09:24 -070048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080049 __u32 i_padding[4];
Ben Cheng655a7c02013-10-16 16:09:24 -070050};
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
55struct bfs_dirent {
Tao Baod7db5942015-01-28 10:07:51 -080056 __le16 ino;
57 char name[BFS_NAMELEN];
Ben Cheng655a7c02013-10-16 16:09:24 -070058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59};
60struct bfs_super_block {
Tao Baod7db5942015-01-28 10:07:51 -080061 __le32 s_magic;
62 __le32 s_start;
Ben Cheng655a7c02013-10-16 16:09:24 -070063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080064 __le32 s_end;
65 __le32 s_from;
66 __le32 s_to;
67 __s32 s_bfrom;
Ben Cheng655a7c02013-10-16 16:09:24 -070068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080069 __s32 s_bto;
70 char s_fsname[6];
71 char s_volume[6];
72 __u32 s_padding[118];
Ben Cheng655a7c02013-10-16 16:09:24 -070073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74};
Tao Baod7db5942015-01-28 10:07:51 -080075#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)
Ben Cheng655a7c02013-10-16 16:09:24 -070078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080079#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))
Ben Cheng655a7c02013-10-16 16:09:24 -070082#endif
83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */