aboutsummaryrefslogtreecommitdiffstats
path: root/fs/squashfs/squashfs_fs.h
diff options
context:
space:
mode:
authorPhillip Lougher <phillip@lougher.demon.co.uk>2010-05-14 15:48:47 -0400
committerPhillip Lougher <phillip@lougher.demon.co.uk>2010-05-17 14:54:05 -0400
commit4b5397dc24ab12afaac85be3d0863b7f6eb8b0f0 (patch)
treebd385be428cfefcdf520f19c532196df1202d687 /fs/squashfs/squashfs_fs.h
parentb57f95a38233a2e73b679bea4a5453a1cc2a1cc9 (diff)
squashfs: add xattr id support
This patch adds support for mapping xattr ids (stored in inodes) into the on-disk location of the xattrs themselves. Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
Diffstat (limited to 'fs/squashfs/squashfs_fs.h')
-rw-r--r--fs/squashfs/squashfs_fs.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/fs/squashfs/squashfs_fs.h b/fs/squashfs/squashfs_fs.h
index 79024245ea00..c654e863d3c0 100644
--- a/fs/squashfs/squashfs_fs.h
+++ b/fs/squashfs/squashfs_fs.h
@@ -174,6 +174,24 @@
174 174
175#define SQUASHFS_ID_BLOCK_BYTES(A) (SQUASHFS_ID_BLOCKS(A) *\ 175#define SQUASHFS_ID_BLOCK_BYTES(A) (SQUASHFS_ID_BLOCKS(A) *\
176 sizeof(u64)) 176 sizeof(u64))
177/* xattr id lookup table defines */
178#define SQUASHFS_XATTR_BYTES(A) ((A) * sizeof(struct squashfs_xattr_id))
179
180#define SQUASHFS_XATTR_BLOCK(A) (SQUASHFS_XATTR_BYTES(A) / \
181 SQUASHFS_METADATA_SIZE)
182
183#define SQUASHFS_XATTR_BLOCK_OFFSET(A) (SQUASHFS_XATTR_BYTES(A) % \
184 SQUASHFS_METADATA_SIZE)
185
186#define SQUASHFS_XATTR_BLOCKS(A) ((SQUASHFS_XATTR_BYTES(A) + \
187 SQUASHFS_METADATA_SIZE - 1) / \
188 SQUASHFS_METADATA_SIZE)
189
190#define SQUASHFS_XATTR_BLOCK_BYTES(A) (SQUASHFS_XATTR_BLOCKS(A) *\
191 sizeof(u64))
192#define SQUASHFS_XATTR_BLK(A) ((unsigned int) ((A) >> 16))
193
194#define SQUASHFS_XATTR_OFFSET(A) ((unsigned int) ((A) & 0xffff))
177 195
178/* cached data constants for filesystem */ 196/* cached data constants for filesystem */
179#define SQUASHFS_CACHED_BLKS 8 197#define SQUASHFS_CACHED_BLKS 8
@@ -228,7 +246,7 @@ struct squashfs_super_block {
228 __le64 root_inode; 246 __le64 root_inode;
229 __le64 bytes_used; 247 __le64 bytes_used;
230 __le64 id_table_start; 248 __le64 id_table_start;
231 __le64 xattr_table_start; 249 __le64 xattr_id_table_start;
232 __le64 inode_table_start; 250 __le64 inode_table_start;
233 __le64 directory_table_start; 251 __le64 directory_table_start;
234 __le64 fragment_table_start; 252 __le64 fragment_table_start;
@@ -377,4 +395,16 @@ struct squashfs_fragment_entry {
377 unsigned int unused; 395 unsigned int unused;
378}; 396};
379 397
398struct squashfs_xattr_id {
399 __le64 xattr;
400 __le32 count;
401 __le32 size;
402};
403
404struct squashfs_xattr_id_table {
405 __le64 xattr_table_start;
406 __le32 xattr_ids;
407 __le32 unused;
408};
409
380#endif 410#endif