aboutsummaryrefslogtreecommitdiff
path: root/e2fsprogs/ext2fs/ext2_fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'e2fsprogs/ext2fs/ext2_fs.h')
-rw-r--r--e2fsprogs/ext2fs/ext2_fs.h75
1 files changed, 0 insertions, 75 deletions
diff --git a/e2fsprogs/ext2fs/ext2_fs.h b/e2fsprogs/ext2fs/ext2_fs.h
index 400587324..44b04beb7 100644
--- a/e2fsprogs/ext2fs/ext2_fs.h
+++ b/e2fsprogs/ext2fs/ext2_fs.h
@@ -19,27 +19,6 @@
19#include "ext2_types.h" /* Changed from linux/types.h */ 19#include "ext2_types.h" /* Changed from linux/types.h */
20 20
21/* 21/*
22 * The second extended filesystem constants/structures
23 */
24
25/*
26 * Define EXT2FS_DEBUG to produce debug messages
27 */
28#undef EXT2FS_DEBUG
29
30/*
31 * Define EXT2_PREALLOCATE to preallocate data blocks for expanding files
32 */
33#define EXT2_PREALLOCATE
34#define EXT2_DEFAULT_PREALLOC_BLOCKS 8
35
36/*
37 * The second extended file system version
38 */
39#define EXT2FS_DATE "95/08/09"
40#define EXT2FS_VERSION "0.5b"
41
42/*
43 * Special inode numbers 22 * Special inode numbers
44 */ 23 */
45#define EXT2_BAD_INO 1 /* Bad blocks inode */ 24#define EXT2_BAD_INO 1 /* Bad blocks inode */
@@ -59,14 +38,10 @@
59 */ 38 */
60#define EXT2_SUPER_MAGIC 0xEF53 39#define EXT2_SUPER_MAGIC 0xEF53
61 40
62#ifdef __KERNEL__
63#define EXT2_SB(sb) (&((sb)->u.ext2_sb))
64#else
65/* Assume that user mode programs are passing in an ext2fs superblock, not 41/* Assume that user mode programs are passing in an ext2fs superblock, not
66 * a kernel struct super_block. This will allow us to call the feature-test 42 * a kernel struct super_block. This will allow us to call the feature-test
67 * macros from user land. */ 43 * macros from user land. */
68#define EXT2_SB(sb) (sb) 44#define EXT2_SB(sb) (sb)
69#endif
70 45
71/* 46/*
72 * Maximal count of links to a file 47 * Maximal count of links to a file
@@ -80,20 +55,12 @@
80#define EXT2_MAX_BLOCK_LOG_SIZE 16 /* 65536 */ 55#define EXT2_MAX_BLOCK_LOG_SIZE 16 /* 65536 */
81#define EXT2_MIN_BLOCK_SIZE (1 << EXT2_MIN_BLOCK_LOG_SIZE) 56#define EXT2_MIN_BLOCK_SIZE (1 << EXT2_MIN_BLOCK_LOG_SIZE)
82#define EXT2_MAX_BLOCK_SIZE (1 << EXT2_MAX_BLOCK_LOG_SIZE) 57#define EXT2_MAX_BLOCK_SIZE (1 << EXT2_MAX_BLOCK_LOG_SIZE)
83#ifdef __KERNEL__
84#define EXT2_BLOCK_SIZE(s) ((s)->s_blocksize)
85#define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits)
86#define EXT2_ADDR_PER_BLOCK_BITS(s) (EXT2_SB(s)->addr_per_block_bits)
87#define EXT2_INODE_SIZE(s) (EXT2_SB(s)->s_inode_size)
88#define EXT2_FIRST_INO(s) (EXT2_SB(s)->s_first_ino)
89#else
90#define EXT2_BLOCK_SIZE(s) (EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size) 58#define EXT2_BLOCK_SIZE(s) (EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size)
91#define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10) 59#define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10)
92#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ 60#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
93 EXT2_GOOD_OLD_INODE_SIZE : (s)->s_inode_size) 61 EXT2_GOOD_OLD_INODE_SIZE : (s)->s_inode_size)
94#define EXT2_FIRST_INO(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ 62#define EXT2_FIRST_INO(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
95 EXT2_GOOD_OLD_FIRST_INO : (s)->s_first_ino) 63 EXT2_GOOD_OLD_FIRST_INO : (s)->s_first_ino)
96#endif
97#define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof(__u32)) 64#define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof(__u32))
98 65
99/* 66/*
@@ -102,13 +69,8 @@
102#define EXT2_MIN_FRAG_SIZE EXT2_MIN_BLOCK_SIZE 69#define EXT2_MIN_FRAG_SIZE EXT2_MIN_BLOCK_SIZE
103#define EXT2_MAX_FRAG_SIZE EXT2_MAX_BLOCK_SIZE 70#define EXT2_MAX_FRAG_SIZE EXT2_MAX_BLOCK_SIZE
104#define EXT2_MIN_FRAG_LOG_SIZE EXT2_MIN_BLOCK_LOG_SIZE 71#define EXT2_MIN_FRAG_LOG_SIZE EXT2_MIN_BLOCK_LOG_SIZE
105#ifdef __KERNEL__
106# define EXT2_FRAG_SIZE(s) (EXT2_SB(s)->s_frag_size)
107# define EXT2_FRAGS_PER_BLOCK(s) (EXT2_SB(s)->s_frags_per_block)
108#else
109# define EXT2_FRAG_SIZE(s) (EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size) 72# define EXT2_FRAG_SIZE(s) (EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size)
110# define EXT2_FRAGS_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s)) 73# define EXT2_FRAGS_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s))
111#endif
112 74
113/* 75/*
114 * ACL structures 76 * ACL structures
@@ -193,12 +155,7 @@ struct ext2_dx_countlimit {
193/* limits imposed by 16-bit value gd_free_{blocks,inode}_count */ 155/* limits imposed by 16-bit value gd_free_{blocks,inode}_count */
194#define EXT2_MAX_BLOCKS_PER_GROUP(s) ((1 << 16) - 8) 156#define EXT2_MAX_BLOCKS_PER_GROUP(s) ((1 << 16) - 8)
195#define EXT2_MAX_INODES_PER_GROUP(s) ((1 << 16) - EXT2_INODES_PER_BLOCK(s)) 157#define EXT2_MAX_INODES_PER_GROUP(s) ((1 << 16) - EXT2_INODES_PER_BLOCK(s))
196#ifdef __KERNEL__
197#define EXT2_DESC_PER_BLOCK(s) (EXT2_SB(s)->s_desc_per_block)
198#define EXT2_DESC_PER_BLOCK_BITS(s) (EXT2_SB(s)->s_desc_per_block_bits)
199#else
200#define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc)) 158#define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc))
201#endif
202 159
203/* 160/*
204 * Constants relative to the data blocks 161 * Constants relative to the data blocks
@@ -365,38 +322,6 @@ struct ext2_inode_large {
365 322
366#define i_size_high i_dir_acl 323#define i_size_high i_dir_acl
367 324
368#if defined(__KERNEL__) || defined(__linux__)
369#define i_reserved1 osd1.linux1.l_i_reserved1
370#define i_frag osd2.linux2.l_i_frag
371#define i_fsize osd2.linux2.l_i_fsize
372#define i_uid_low i_uid
373#define i_gid_low i_gid
374#define i_uid_high osd2.linux2.l_i_uid_high
375#define i_gid_high osd2.linux2.l_i_gid_high
376#define i_reserved2 osd2.linux2.l_i_reserved2
377
378#else
379#if defined(__GNU__)
380
381#define i_translator osd1.hurd1.h_i_translator
382#define i_frag osd2.hurd2.h_i_frag;
383#define i_fsize osd2.hurd2.h_i_fsize;
384#define i_uid_high osd2.hurd2.h_i_uid_high
385#define i_gid_high osd2.hurd2.h_i_gid_high
386#define i_author osd2.hurd2.h_i_author
387
388#else
389#if defined(__masix__)
390
391#define i_reserved1 osd1.masix1.m_i_reserved1
392#define i_frag osd2.masix2.m_i_frag
393#define i_fsize osd2.masix2.m_i_fsize
394#define i_reserved2 osd2.masix2.m_i_reserved2
395
396#endif /* __masix__ */
397#endif /* __GNU__ */
398#endif /* defined(__KERNEL__) || defined(__linux__) */
399
400/* 325/*
401 * File system states 326 * File system states
402 */ 327 */