History

Merge branch 'work.cramfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull cramfs updates from Al Viro: "Nicolas Pitre's cramfs work" * 'work.cramfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: cramfs: rehabilitate it cramfs: add mmap support cramfs: implement uncompressed and arbitrary data block positioning cramfs: direct memory access support

Linus Torvalds committed 8 years ago

Commit cbda1b22 parents ca5b857 8d595986 files · +584 −69Browse files

Showing the changes to include/uapi (1 of 6 files). Show all

Unified · Split

include/uapi/linux/cramfs_fs.h+25−1
@@ -74,6 +74,7 @@ struct cramfs_super { · 73 unmodified lines
7474 #define CRAMFS_FLAG_HOLES 0x00000100 /* support for holes */
7575 #define CRAMFS_FLAG_WRONG_SIGNATURE 0x00000200 /* reserved */
7676 #define CRAMFS_FLAG_SHIFTED_ROOT_OFFSET 0x00000400 /* shifted root fs */
77+#define CRAMFS_FLAG_EXT_BLOCK_POINTERS 0x00000800 /* block pointer extensions */
7778
7879 /*
7980 * Valid values in super.flags. Currently we refuse to mount
@@ -83,7 +84,30 @@ struct cramfs_super { · 3 unmodified lines
8384 #define CRAMFS_SUPPORTED_FLAGS ( 0x000000ff \
8485 | CRAMFS_FLAG_HOLES \
8586 | CRAMFS_FLAG_WRONG_SIGNATURE \
86− | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET )
87+ | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET \
88+ | CRAMFS_FLAG_EXT_BLOCK_POINTERS )
8789
90+/*
91+ * Block pointer flags
92+ *
93+ * The maximum block offset that needs to be represented is roughly:
94+ *
95+ * (1 << CRAMFS_OFFSET_WIDTH) * 4 +
96+ * (1 << CRAMFS_SIZE_WIDTH) / PAGE_SIZE * (4 + PAGE_SIZE)
97+ * = 0x11004000
98+ *
99+ * That leaves room for 3 flag bits in the block pointer table.
100+ */
101+#define CRAMFS_BLK_FLAG_UNCOMPRESSED (1 << 31)
102+#define CRAMFS_BLK_FLAG_DIRECT_PTR (1 << 30)
103+
104+#define CRAMFS_BLK_FLAGS ( CRAMFS_BLK_FLAG_UNCOMPRESSED \
105+ | CRAMFS_BLK_FLAG_DIRECT_PTR )
106+
107+/*
108+ * Direct blocks are at least 4-byte aligned.
109+ * Pointers to direct blocks are shifted down by 2 bits.
110+ */
111+#define CRAMFS_BLK_DIRECT_PTR_SHIFT 2
88112
89113 #endif /* _UAPI__CRAMFS_H */