23 |
|
|
24 |
#define cpu_to_be32(x) __cpu_to_be32(x) /* Needed by romfs_fs.h */ |
#define cpu_to_be32(x) __cpu_to_be32(x) /* Needed by romfs_fs.h */ |
25 |
|
|
26 |
#include "romfs_fs.h" |
#include "btrfs.h" |
27 |
#include "cramfs_fs.h" |
#include "cramfs_fs.h" |
|
#include "minix_fs.h" |
|
28 |
#include "ext2_fs.h" |
#include "ext2_fs.h" |
29 |
#include "ext3_fs.h" |
#include "ext3_fs.h" |
30 |
#include "xfs_sb.h" |
#include "gfs2_fs.h" |
31 |
|
#include "iso9660_sb.h" |
32 |
#include "luks_fs.h" |
#include "luks_fs.h" |
33 |
#include "lvm2_sb.h" |
#include "lvm2_sb.h" |
34 |
#include "iso9660_sb.h" |
#include "minix_fs.h" |
|
#include "squashfs_fs.h" |
|
|
#include "gfs2_fs.h" |
|
|
#include "ocfs2_fs.h" |
|
35 |
#include "nilfs_fs.h" |
#include "nilfs_fs.h" |
36 |
|
#include "ocfs2_fs.h" |
37 |
|
#include "romfs_fs.h" |
38 |
|
#include "squashfs_fs.h" |
39 |
|
#include "xfs_sb.h" |
40 |
|
|
41 |
/* |
/* |
42 |
* Slightly cleaned up version of jfs_superblock to |
* Slightly cleaned up version of jfs_superblock to |
197 |
if (sb->s_magic != __cpu_to_le16(EXT2_SUPER_MAGIC)) |
if (sb->s_magic != __cpu_to_le16(EXT2_SUPER_MAGIC)) |
198 |
return 0; |
return 0; |
199 |
|
|
|
/* |
|
|
* For now, ext4 requires a journal -- but this may change |
|
|
* soon if we get that patch from Google. :-) |
|
|
*/ |
|
|
if ((sb->s_feature_compat |
|
|
& __cpu_to_le32(EXT3_FEATURE_COMPAT_HAS_JOURNAL)) == 0) |
|
|
return 0; |
|
|
|
|
200 |
/* There is at least one feature not supported by ext3 */ |
/* There is at least one feature not supported by ext3 */ |
201 |
if ((sb->s_feature_incompat |
if ((sb->s_feature_incompat |
202 |
& __cpu_to_le32(EXT3_FEATURE_INCOMPAT_UNSUPPORTED)) || |
& __cpu_to_le32(EXT3_FEATURE_INCOMPAT_UNSUPPORTED)) || |
454 |
return 0; |
return 0; |
455 |
} |
} |
456 |
|
|
457 |
|
static int btrfs_image(const void *buf, unsigned long long *bytes) |
458 |
|
{ |
459 |
|
const struct btrfs_super_block *sb = |
460 |
|
(const struct btrfs_super_block *)buf; |
461 |
|
|
462 |
|
if (!memcmp(sb->magic, BTRFS_MAGIC, BTRFS_MAGIC_L)) { |
463 |
|
*bytes = (unsigned long long)__le64_to_cpu(sb->total_bytes); |
464 |
|
return 1; |
465 |
|
} |
466 |
|
return 0; |
467 |
|
} |
468 |
|
|
469 |
struct imagetype { |
struct imagetype { |
470 |
off_t block; |
off_t block; |
471 |
const char name[12]; |
const char name[12]; |
501 |
{64, "reiserfs", reiserfs_image}, |
{64, "reiserfs", reiserfs_image}, |
502 |
{64, "reiser4", reiser4_image}, |
{64, "reiser4", reiser4_image}, |
503 |
{64, "gfs2", gfs2_image}, |
{64, "gfs2", gfs2_image}, |
504 |
|
{64, "btrfs", btrfs_image}, |
505 |
{32, "jfs", jfs_image}, |
{32, "jfs", jfs_image}, |
506 |
{32, "iso9660", iso_image}, |
{32, "iso9660", iso_image}, |
507 |
{0, "luks", luks_image}, |
{0, "luks", luks_image}, |