summaryrefslogtreecommitdiffstats
path: root/include/envfs.h
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2012-08-21 21:47:53 +0800
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2012-09-05 03:22:14 +0800
commitd3cbc615962c8e96f88d9e74645c5afb441431bb (patch)
tree0c8e74d8cf0044a2205841e4d30f1fbfd38fc4e3 /include/envfs.h
parentff3058e3bb5644803cdb7836bbfe11e8c5fbc5db (diff)
downloadbarebox-d3cbc615962c8e96f88d9e74645c5afb441431bb.tar.gz
barebox-d3cbc615962c8e96f88d9e74645c5afb441431bb.tar.xz
envfs: add support of variable inode size
Introduce a struct envfs_inode_end with more data. Today this will just containt the file mode to be able to add the symlink support. But this is compatible with the previous envfs version as they will do not care about the extra as the previous version is just reading the filename and then consume the extra data without using them. Increase the envfs version to 1.0 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'include/envfs.h')
-rw-r--r--include/envfs.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/envfs.h b/include/envfs.h
index c6df8c5048..3d14fcb9ee 100644
--- a/include/envfs.h
+++ b/include/envfs.h
@@ -5,18 +5,19 @@
#include <asm/byteorder.h>
#endif
-#define ENVFS_MAJOR 0
-#define ENVFS_MINOR 1
+#define ENVFS_MAJOR 1
+#define ENVFS_MINOR 0
#define ENVFS_MAGIC 0x798fba79 /* some random number */
#define ENVFS_INODE_MAGIC 0x67a8c78d
+#define ENVFS_INODE_END_MAGIC 0x68a8c78d
#define ENVFS_END_MAGIC 0x6a87d6cd
#define ENVFS_SIGNATURE "barebox envfs"
struct envfs_inode {
uint32_t magic; /* ENVFS_INODE_MAGIC */
uint32_t size; /* data size in bytes */
- uint32_t namelen; /* The length of the filename _including_ a trailing 0 */
+ uint32_t headerlen; /* The length of the filename _including_ a trailing 0 */
char data[0]; /* The filename (zero terminated) + padding to 4 byte boundary
* followed by the data for this inode.
* The next inode follows after the data + padding to 4 byte
@@ -24,6 +25,11 @@ struct envfs_inode {
*/
};
+struct envfs_inode_end {
+ uint32_t magic; /* ENVFS_INODE_END_MAGIC */
+ uint32_t mode; /* file mode */
+};
+
/*
* Superblock information at the beginning of the FS.
*/