summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorYegor Yefremov <yegorslists@googlemail.com>2016-01-26 11:38:37 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-02-03 07:57:36 +0100
commitc8b37d49830a38243d570b90d03da6be8c0b664c (patch)
tree1d774ae0ce776b965898d857c33456943860982d /fs
parent0123e9f63304304b4b1cf86871cc33832d9569f6 (diff)
downloadbarebox-c8b37d49830a38243d570b90d03da6be8c0b664c.tar.gz
barebox-c8b37d49830a38243d570b90d03da6be8c0b664c.tar.xz
fs: import magic.h from Linux kernel
include/linux/magic.h provides MAGIC numbers for various file systems. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/cramfs/cramfs.c1
-rw-r--r--fs/ext4/ext4_common.c3
-rw-r--r--fs/ext4/ext_common.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c
index 97f028a3ec..988fa7e8e6 100644
--- a/fs/cramfs/cramfs.c
+++ b/fs/cramfs/cramfs.c
@@ -34,6 +34,7 @@
#include <asm/byteorder.h>
#include <linux/stat.h>
+#include <linux/magic.h>
#include <cramfs/cramfs_fs.h>
/* These two macros may change in future, to provide better st_ino
diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
index 04b1915d5f..590f54d5d8 100644
--- a/fs/ext4/ext4_common.c
+++ b/fs/ext4/ext4_common.c
@@ -32,6 +32,7 @@
#include <malloc.h>
#include <linux/stat.h>
#include <linux/time.h>
+#include <linux/magic.h>
#include <asm/byteorder.h>
#include <dma.h>
@@ -499,7 +500,7 @@ int ext4fs_mount(struct ext_filesystem *fs)
goto fail;
/* Make sure this is an ext2 filesystem. */
- if (__le16_to_cpu(data->sblock.magic) != EXT2_MAGIC) {
+ if (__le16_to_cpu(data->sblock.magic) != EXT2_SUPER_MAGIC) {
ret = -EINVAL;
goto fail;
}
diff --git a/fs/ext4/ext_common.h b/fs/ext4/ext_common.h
index 517a1c1487..704d8e66a6 100644
--- a/fs/ext4/ext_common.h
+++ b/fs/ext4/ext_common.h
@@ -33,8 +33,6 @@
#define SECTOR_SIZE 0x200
#define SECTOR_BITS 9
-/* Magic value used to identify an ext2 filesystem. */
-#define EXT2_MAGIC 0xEF53
/* Amount of indirect blocks in an inode. */
#define INDIRECT_BLOCKS 12
/* Maximum lenght of a pathname. */