source: MondoRescue/branches/stable/mindi-busybox/e2fsprogs/ext2fs/ext2_ext_attr.h @ 821

Last change on this file since 821 was 821, checked in by Bruno Cornec, 14 years ago

Addition of busybox 1.2.1 as a mindi-busybox new package
This should avoid delivering binary files in mindi not built there (Fedora and Debian are quite serious about that)

File size: 1.9 KB
Line 
1/*
2  File: linux/ext2_ext_attr.h
3
4  On-disk format of extended attributes for the ext2 filesystem.
5
6  (C) 2000 Andreas Gruenbacher, <a.gruenbacher@computer.org>
7*/
8
9/* Magic value in attribute blocks */
10#define EXT2_EXT_ATTR_MAGIC_v1      0xEA010000
11#define EXT2_EXT_ATTR_MAGIC     0xEA020000
12
13/* Maximum number of references to one attribute block */
14#define EXT2_EXT_ATTR_REFCOUNT_MAX  1024
15
16struct ext2_ext_attr_header {
17    __u32   h_magic;    /* magic number for identification */
18    __u32   h_refcount; /* reference count */
19    __u32   h_blocks;   /* number of disk blocks used */
20    __u32   h_hash;     /* hash value of all attributes */
21    __u32   h_reserved[4];  /* zero right now */
22};
23
24struct ext2_ext_attr_entry {
25    __u8    e_name_len; /* length of name */
26    __u8    e_name_index;   /* attribute name index */
27    __u16   e_value_offs;   /* offset in disk block of value */
28    __u32   e_value_block;  /* disk block attribute is stored on (n/i) */
29    __u32   e_value_size;   /* size of attribute value */
30    __u32   e_hash;     /* hash value of name and value */
31};
32
33#define EXT2_EXT_ATTR_PAD_BITS      2
34#define EXT2_EXT_ATTR_PAD       (1<<EXT2_EXT_ATTR_PAD_BITS)
35#define EXT2_EXT_ATTR_ROUND     (EXT2_EXT_ATTR_PAD-1)
36#define EXT2_EXT_ATTR_LEN(name_len) \
37    (((name_len) + EXT2_EXT_ATTR_ROUND + \
38    sizeof(struct ext2_ext_attr_entry)) & ~EXT2_EXT_ATTR_ROUND)
39#define EXT2_EXT_ATTR_NEXT(entry) \
40    ( (struct ext2_ext_attr_entry *)( \
41      (char *)(entry) + EXT2_EXT_ATTR_LEN((entry)->e_name_len)) )
42#define EXT2_EXT_ATTR_SIZE(size) \
43    (((size) + EXT2_EXT_ATTR_ROUND) & ~EXT2_EXT_ATTR_ROUND)
44#define EXT2_EXT_IS_LAST_ENTRY(entry) (*((__u32 *)(entry)) == 0UL)
45#define EXT2_EXT_ATTR_NAME(entry) \
46    (((char *) (entry)) + sizeof(struct ext2_ext_attr_entry))
47#define EXT2_XATTR_LEN(name_len) \
48    (((name_len) + EXT2_EXT_ATTR_ROUND + \
49    sizeof(struct ext2_xattr_entry)) & ~EXT2_EXT_ATTR_ROUND)
50#define EXT2_XATTR_SIZE(size) \
51    (((size) + EXT2_EXT_ATTR_ROUND) & ~EXT2_EXT_ATTR_ROUND)
52
Note: See TracBrowser for help on using the repository browser.