squashfs: add support for xattr reading

Add support for listxattr and getxattr.  Also add xattr definitions.

Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
This commit is contained in:
Phillip Lougher
2010-05-17 03:17:04 +01:00
parent 4b5397dc24
commit f41d207cbe
4 changed files with 342 additions and 1 deletions

View File

@@ -46,6 +46,7 @@
#define SQUASHFS_NAME_LEN 256
#define SQUASHFS_INVALID_FRAG (0xffffffffU)
#define SQUASHFS_INVALID_XATTR (0xffffffffU)
#define SQUASHFS_INVALID_BLK (-1LL)
/* Filesystem flags */
@@ -96,6 +97,13 @@
#define SQUASHFS_LFIFO_TYPE 13
#define SQUASHFS_LSOCKET_TYPE 14
/* Xattr types */
#define SQUASHFS_XATTR_USER 0
#define SQUASHFS_XATTR_TRUSTED 1
#define SQUASHFS_XATTR_SECURITY 2
#define SQUASHFS_XATTR_VALUE_OOL 256
#define SQUASHFS_XATTR_PREFIX_MASK 0xff
/* Flag whether block is compressed or uncompressed, bit is set if block is
* uncompressed */
#define SQUASHFS_COMPRESSED_BIT (1 << 15)
@@ -395,6 +403,17 @@ struct squashfs_fragment_entry {
unsigned int unused;
};
struct squashfs_xattr_entry {
__le16 type;
__le16 size;
char data[0];
};
struct squashfs_xattr_val {
__le32 vsize;
char value[0];
};
struct squashfs_xattr_id {
__le64 xattr;
__le32 count;