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_JFFS2_H__ 20655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define __LINUX_JFFS2_H__ 21655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#include <linux/types.h> 22655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#include <linux/magic.h> 23655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_OLD_MAGIC_BITMASK 0x1984 24655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_MAGIC_BITMASK 0x1985 25655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define KSAMTIB_CIGAM_2SFFJ 0x8519 26655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_EMPTY_BITMASK 0xffff 27655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_DIRTY_BITMASK 0x0000 28655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_SUM_MAGIC 0x02851885 29655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_MAX_NAME_LEN 254 30655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_MIN_DATA_LEN 128 31655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_COMPR_NONE 0x00 32655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_COMPR_ZERO 0x01 33655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_COMPR_RTIME 0x02 34655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_COMPR_RUBINMIPS 0x03 35655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_COMPR_COPY 0x04 36655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_COMPR_DYNRUBIN 0x05 37655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_COMPR_ZLIB 0x06 38655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_COMPR_LZO 0x07 39655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_COMPAT_MASK 0xc000 40655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_NODE_ACCURATE 0x2000 41655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_FEATURE_INCOMPAT 0xc000 42655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_FEATURE_ROCOMPAT 0x8000 43655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_FEATURE_RWCOMPAT_COPY 0x4000 44655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_FEATURE_RWCOMPAT_DELETE 0x0000 45655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_NODETYPE_DIRENT (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 1) 46655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_NODETYPE_INODE (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 2) 47655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) 48655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4) 49655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6) 50655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_NODETYPE_XATTR (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 8) 51655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_NODETYPE_XREF (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 9) 52655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_XPREFIX_USER 1 53655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_XPREFIX_SECURITY 2 54655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_XPREFIX_ACL_ACCESS 3 55655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_XPREFIX_ACL_DEFAULT 4 56655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_XPREFIX_TRUSTED 5 57655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_ACL_VERSION 0x0001 58655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_INO_FLAG_PREREAD 1 59655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define JFFS2_INO_FLAG_USERCOMPR 2 60655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengtypedef struct { 61d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 v32; 62655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng} __attribute__((packed)) jint32_t; 63655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengtypedef struct { 64d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 m; 65655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng} __attribute__((packed)) jmode_t; 66655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengtypedef struct { 67d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u16 v16; 68655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng} __attribute__((packed)) jint16_t; 69d7db594b8d1dab36b711bd887a9dd21675c87243Tao Baostruct jffs2_unknown_node { 70d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint16_t magic; 71d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint16_t nodetype; 72d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t totlen; 73d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t hdr_crc; 74655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 75d7db594b8d1dab36b711bd887a9dd21675c87243Tao Baostruct jffs2_raw_dirent { 76d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint16_t magic; 77d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint16_t nodetype; 78d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t totlen; 79d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t hdr_crc; 80d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t pino; 81d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t version; 82d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t ino; 83d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t mctime; 84d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 nsize; 85d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 type; 86d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 unused[2]; 87d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t node_crc; 88d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t name_crc; 89d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 name[0]; 90655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 91d7db594b8d1dab36b711bd887a9dd21675c87243Tao Baostruct jffs2_raw_inode { 92d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint16_t magic; 93d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint16_t nodetype; 94d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t totlen; 95d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t hdr_crc; 96d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t ino; 97d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t version; 98d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jmode_t mode; 99d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint16_t uid; 100d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint16_t gid; 101d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t isize; 102d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t atime; 103d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t mtime; 104d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t ctime; 105d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t offset; 106d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t csize; 107d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t dsize; 108d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 compr; 109d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 usercompr; 110d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint16_t flags; 111d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t data_crc; 112d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t node_crc; 113d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 data[0]; 114655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 115d7db594b8d1dab36b711bd887a9dd21675c87243Tao Baostruct jffs2_raw_xattr { 116d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint16_t magic; 117d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint16_t nodetype; 118d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t totlen; 119d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t hdr_crc; 120d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t xid; 121d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t version; 122d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 xprefix; 123d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 name_len; 124d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint16_t value_len; 125d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t data_crc; 126d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t node_crc; 127d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 data[0]; 128655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng} __attribute__((packed)); 129d7db594b8d1dab36b711bd887a9dd21675c87243Tao Baostruct jffs2_raw_xref { 130d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint16_t magic; 131d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint16_t nodetype; 132d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t totlen; 133d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t hdr_crc; 134d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t ino; 135d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t xid; 136d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t xseqno; 137d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t node_crc; 138d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao} __attribute__((packed)); 139d7db594b8d1dab36b711bd887a9dd21675c87243Tao Baostruct jffs2_raw_summary { 140d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint16_t magic; 141d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint16_t nodetype; 142d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t totlen; 143d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t hdr_crc; 144d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t sum_num; 145d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t cln_mkr; 146d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t padded; 147d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t sum_crc; 148d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t node_crc; 149d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t sum[0]; 150655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 151d7db594b8d1dab36b711bd887a9dd21675c87243Tao Baounion jffs2_node_union { 152d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao struct jffs2_raw_inode i; 153d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao struct jffs2_raw_dirent d; 154d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao struct jffs2_raw_xattr x; 155d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao struct jffs2_raw_xref r; 156d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao struct jffs2_raw_summary s; 157d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao struct jffs2_unknown_node u; 158655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 159d7db594b8d1dab36b711bd887a9dd21675c87243Tao Baounion jffs2_device_node { 160d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint16_t old_id; 161d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao jint32_t new_id; 162655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 163655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#endif 164