Skip to content

Commit

Permalink
squashfs: update documentation to include description of xattr layout
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
  • Loading branch information
Phillip Lougher committed May 26, 2010
1 parent 5c80f5a commit 899f453
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions Documentation/filesystems/squashfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ Hard link support: yes no
Real inode numbers: yes no
32-bit uids/gids: yes no
File creation time: yes no
Xattr and ACL support: no no
Xattr support: yes no
ACL support: no no

Squashfs compresses data, inodes and directories. In addition, inode and
directory data are highly compacted, and packed on byte boundaries. Each
Expand All @@ -58,7 +59,7 @@ obtained from this site also.
3. SQUASHFS FILESYSTEM DESIGN
-----------------------------

A squashfs filesystem consists of seven parts, packed together on a byte
A squashfs filesystem consists of a maximum of eight parts, packed together on a byte
alignment:

---------------
Expand All @@ -80,6 +81,9 @@ alignment:
|---------------|
| uid/gid |
| lookup table |
|---------------|
| xattr |
| table |
---------------

Compressed data blocks are written to the filesystem as files are read from
Expand Down Expand Up @@ -192,16 +196,34 @@ This table is stored compressed into metadata blocks. A second index table is
used to locate these. This second index table for speed of access (and because
it is small) is read at mount time and cached in memory.

3.7 Xattr table
---------------

The xattr table contains extended attributes for each inode. The xattrs
for each inode are stored in a list, each list entry containing a type,
name and value field. The type field encodes the xattr prefix
("user.", "trusted." etc) and it also encodes how the name/value fields
should be interpreted. Currently the type indicates whether the value
is stored inline (in which case the value field contains the xattr value),
or if it is stored out of line (in which case the value field stores a
reference to where the actual value is stored). This allows large values
to be stored out of line improving scanning and lookup performance and it
also allows values to be de-duplicated, the value being stored once, and
all other occurences holding an out of line reference to that value.

The xattr lists are packed into compressed 8K metadata blocks.
To reduce overhead in inodes, rather than storing the on-disk
location of the xattr list inside each inode, a 32-bit xattr id
is stored. This xattr id is mapped into the location of the xattr
list using a second xattr id lookup table.

4. TODOS AND OUTSTANDING ISSUES
-------------------------------

4.1 Todo list
-------------

Implement Xattr and ACL support. The Squashfs 4.0 filesystem layout has hooks
for these but the code has not been written. Once the code has been written
the existing layout should not require modification.
Implement ACL support.

4.2 Squashfs internal cache
---------------------------
Expand Down

0 comments on commit 899f453

Please sign in to comment.