1655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng/**************************************************************************** 2655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng **************************************************************************** 3655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 4655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** This header was automatically generated from a Linux kernel header 5655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** of the same name, to make information necessary for userspace to 6655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** call into the kernel available to libc. It contains only constants, 7655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** structures, and macros generated from the original header, and thus, 8655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** contains no copyrightable information. 9655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 10655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** To edit the content of this header, modify the corresponding 11655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** source file (e.g. under external/kernel-headers/original/) then 12655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** run bionic/libc/kernel/tools/update_all.py 13655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 14655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** Any manual change here will be lost the next time this script will 15655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** be run. You've been warned! 16655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 17655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng **************************************************************************** 18655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ****************************************************************************/ 19655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#ifndef _LINUX_BFS_FS_H 20655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define _LINUX_BFS_FS_H 21655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#include <linux/types.h> 22655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define BFS_BSIZE_BITS 9 23d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define BFS_BSIZE (1 << BFS_BSIZE_BITS) 24655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define BFS_MAGIC 0x1BADFACE 25655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define BFS_ROOT_INO 2 26655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define BFS_INODES_PER_BLOCK 8 27655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define BFS_VDIR 2L 28655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define BFS_VREG 1L 29655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct bfs_inode { 30d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le16 i_ino; 31d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u16 i_unused; 32d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le32 i_sblock; 33d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le32 i_eblock; 34d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le32 i_eoffset; 35d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le32 i_vtype; 36d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le32 i_mode; 37d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le32 i_uid; 38d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le32 i_gid; 39d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le32 i_nlink; 40d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le32 i_atime; 41d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le32 i_mtime; 42d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le32 i_ctime; 43d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 i_padding[4]; 44655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 45655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define BFS_NAMELEN 14 46655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define BFS_DIRENT_SIZE 16 47655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define BFS_DIRS_PER_BLOCK 32 48655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct bfs_dirent { 49d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le16 ino; 50d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao char name[BFS_NAMELEN]; 51655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 52655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct bfs_super_block { 53d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le32 s_magic; 54d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le32 s_start; 55d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le32 s_end; 56d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le32 s_from; 57d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le32 s_to; 58d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __s32 s_bfrom; 59d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __s32 s_bto; 60d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao char s_fsname[6]; 61d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao char s_volume[6]; 62d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 s_padding[118]; 63655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 64d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define BFS_OFF2INO(offset) ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO) 65d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define BFS_INO2OFF(ino) ((__u32) (((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE) 66d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define BFS_NZFILESIZE(ip) ((le32_to_cpu((ip)->i_eoffset) + 1) - le32_to_cpu((ip)->i_sblock) * BFS_BSIZE) 67d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define BFS_FILESIZE(ip) ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip)) 68d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define BFS_FILEBLOCKS(ip) ((ip)->i_sblock == 0 ? 0 : (le32_to_cpu((ip)->i_eblock) + 1) - le32_to_cpu((ip)->i_sblock)) 69d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#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)) 70655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#endif 71