| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 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 | **************************************************************************** | 
|  | 11 | ****************************************************************************/ | 
|  | 12 | #ifndef _LINUX_FS_H | 
|  | 13 | #define _LINUX_FS_H | 
|  | 14 |  | 
|  | 15 | #include <linux/limits.h> | 
|  | 16 | #include <linux/ioctl.h> | 
|  | 17 |  | 
|  | 18 | #undef NR_OPEN | 
|  | 19 | #define NR_OPEN (1024*1024) | 
|  | 20 | #define INR_OPEN 1024 | 
|  | 21 |  | 
|  | 22 | #define BLOCK_SIZE_BITS 10 | 
|  | 23 | #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS) | 
|  | 24 |  | 
|  | 25 | #define SEEK_SET 0 | 
|  | 26 | #define SEEK_CUR 1 | 
|  | 27 | #define SEEK_END 2 | 
|  | 28 |  | 
|  | 29 | struct files_stat_struct { | 
|  | 30 | int nr_files; | 
|  | 31 | int nr_free_files; | 
|  | 32 | int max_files; | 
|  | 33 | }; | 
|  | 34 |  | 
|  | 35 | struct inodes_stat_t { | 
|  | 36 | int nr_inodes; | 
|  | 37 | int nr_unused; | 
|  | 38 | int dummy[5]; | 
|  | 39 | }; | 
|  | 40 |  | 
|  | 41 | #define NR_FILE 8192 | 
|  | 42 |  | 
|  | 43 | #define MAY_EXEC 1 | 
|  | 44 | #define MAY_WRITE 2 | 
|  | 45 | #define MAY_READ 4 | 
|  | 46 | #define MAY_APPEND 8 | 
|  | 47 |  | 
|  | 48 | #define FMODE_READ 1 | 
|  | 49 | #define FMODE_WRITE 2 | 
|  | 50 |  | 
|  | 51 | #define FMODE_LSEEK 4 | 
|  | 52 | #define FMODE_PREAD 8 | 
|  | 53 | #define FMODE_PWRITE FMODE_PREAD | 
|  | 54 |  | 
|  | 55 | #define FMODE_EXEC 16 | 
|  | 56 |  | 
|  | 57 | #define RW_MASK 1 | 
|  | 58 | #define RWA_MASK 2 | 
|  | 59 | #define READ 0 | 
|  | 60 | #define WRITE 1 | 
|  | 61 | #define READA 2 | 
|  | 62 | #define SWRITE 3 | 
|  | 63 | #define SPECIAL 4 | 
|  | 64 | #define READ_SYNC (READ | (1 << BIO_RW_SYNC)) | 
|  | 65 | #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) | 
|  | 66 | #define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) | 
|  | 67 |  | 
|  | 68 | #define SEL_IN 1 | 
|  | 69 | #define SEL_OUT 2 | 
|  | 70 | #define SEL_EX 4 | 
|  | 71 |  | 
|  | 72 | #define FS_REQUIRES_DEV 1 | 
|  | 73 | #define FS_BINARY_MOUNTDATA 2 | 
|  | 74 | #define FS_REVAL_DOT 16384 | 
|  | 75 | #define FS_ODD_RENAME 32768 | 
|  | 76 |  | 
|  | 77 | #define MS_RDONLY 1 | 
|  | 78 | #define MS_NOSUID 2 | 
|  | 79 | #define MS_NODEV 4 | 
|  | 80 | #define MS_NOEXEC 8 | 
|  | 81 | #define MS_SYNCHRONOUS 16 | 
|  | 82 | #define MS_REMOUNT 32 | 
|  | 83 | #define MS_MANDLOCK 64 | 
|  | 84 | #define MS_DIRSYNC 128 | 
|  | 85 | #define MS_NOATIME 1024 | 
|  | 86 | #define MS_NODIRATIME 2048 | 
|  | 87 | #define MS_BIND 4096 | 
|  | 88 | #define MS_MOVE 8192 | 
|  | 89 | #define MS_REC 16384 | 
|  | 90 | #define MS_VERBOSE 32768 | 
|  | 91 | #define MS_SILENT 32768 | 
|  | 92 | #define MS_POSIXACL (1<<16) | 
|  | 93 | #define MS_UNBINDABLE (1<<17) | 
|  | 94 | #define MS_PRIVATE (1<<18) | 
|  | 95 | #define MS_SLAVE (1<<19) | 
|  | 96 | #define MS_SHARED (1<<20) | 
|  | 97 | #define MS_ACTIVE (1<<30) | 
|  | 98 | #define MS_NOUSER (1<<31) | 
|  | 99 |  | 
|  | 100 | #define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK) | 
|  | 101 |  | 
|  | 102 | #define MS_MGC_VAL 0xC0ED0000 | 
|  | 103 | #define MS_MGC_MSK 0xffff0000 | 
|  | 104 |  | 
|  | 105 | #define S_SYNC 1 | 
|  | 106 | #define S_NOATIME 2 | 
|  | 107 | #define S_APPEND 4 | 
|  | 108 | #define S_IMMUTABLE 8 | 
|  | 109 | #define S_DEAD 16 | 
|  | 110 | #define S_NOQUOTA 32 | 
|  | 111 | #define S_DIRSYNC 64 | 
|  | 112 | #define S_NOCMTIME 128 | 
|  | 113 | #define S_SWAPFILE 256 | 
|  | 114 | #define S_PRIVATE 512 | 
|  | 115 |  | 
|  | 116 | #define __IS_FLG(inode,flg) ((inode)->i_sb->s_flags & (flg)) | 
|  | 117 |  | 
|  | 118 | #define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY) | 
|  | 119 | #define IS_SYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS) ||   ((inode)->i_flags & S_SYNC)) | 
|  | 120 | #define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) ||   ((inode)->i_flags & (S_SYNC|S_DIRSYNC))) | 
|  | 121 | #define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK) | 
|  | 122 |  | 
|  | 123 | #define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA) | 
|  | 124 | #define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) | 
|  | 125 | #define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) | 
|  | 126 | #define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL) | 
|  | 127 |  | 
|  | 128 | #define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD) | 
|  | 129 | #define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME) | 
|  | 130 | #define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE) | 
|  | 131 | #define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE) | 
|  | 132 |  | 
|  | 133 | #define BLKROSET _IO(0x12,93) | 
|  | 134 | #define BLKROGET _IO(0x12,94) | 
|  | 135 | #define BLKRRPART _IO(0x12,95) | 
|  | 136 | #define BLKGETSIZE _IO(0x12,96) | 
|  | 137 | #define BLKFLSBUF _IO(0x12,97) | 
|  | 138 | #define BLKRASET _IO(0x12,98) | 
|  | 139 | #define BLKRAGET _IO(0x12,99) | 
|  | 140 | #define BLKFRASET _IO(0x12,100) | 
|  | 141 | #define BLKFRAGET _IO(0x12,101) | 
|  | 142 | #define BLKSECTSET _IO(0x12,102) | 
|  | 143 | #define BLKSECTGET _IO(0x12,103) | 
|  | 144 | #define BLKSSZGET _IO(0x12,104) | 
|  | 145 |  | 
|  | 146 | #define BLKBSZGET _IOR(0x12,112,size_t) | 
|  | 147 | #define BLKBSZSET _IOW(0x12,113,size_t) | 
|  | 148 | #define BLKGETSIZE64 _IOR(0x12,114,size_t) | 
|  | 149 | #define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup) | 
|  | 150 | #define BLKTRACESTART _IO(0x12,116) | 
|  | 151 | #define BLKTRACESTOP _IO(0x12,117) | 
|  | 152 | #define BLKTRACETEARDOWN _IO(0x12,118) | 
|  | 153 |  | 
|  | 154 | #define BMAP_IOCTL 1 | 
|  | 155 | #define FIBMAP _IO(0x00,1) | 
|  | 156 | #define FIGETBSZ _IO(0x00,2) | 
|  | 157 |  | 
|  | 158 | #define SYNC_FILE_RANGE_WAIT_BEFORE 1 | 
|  | 159 | #define SYNC_FILE_RANGE_WRITE 2 | 
|  | 160 | #define SYNC_FILE_RANGE_WAIT_AFTER 4 | 
|  | 161 |  | 
|  | 162 | #endif |