search for: swap_magic_l

Displaying 1 result from an estimated 1 matches for "swap_magic_l".

2006 Feb 05
1
Add swap support to fstype, second version
...== 037 && (buf[1] == 0213 || buf[1] == 0236)) { @@ -182,6 +186,19 @@ return 0; } +static int swap_image(const unsigned char *buf, unsigned long long *blocks) +{ + const struct swap_super_block *ssb = + (const struct swap_super_block *)buf; + + if (!memcmp(ssb->magic, SWAP_MAGIC_1, SWAP_MAGIC_L) || + !memcmp(ssb->magic, SWAP_MAGIC_2, SWAP_MAGIC_L)) { + *blocks = 0; + return 1; + } + return 0; +} + struct imagetype { off_t block; const char name[12]; @@ -189,17 +206,18 @@ }; static struct imagetype images[] = { - { 0, "gzip", gzip_image }, - { 0, "cramfs&...