Displaying 1 result from an estimated 1 matches for "lvm2_magic".
Did you mean:
lvm2_magic_l
2006 Mar 22
0
[patch] Add LVM2 detection to fstype
...}
+static int lvm2_image(const void *buf, unsigned long long *blocks)
+{
+ const struct lvm2_super_block *lsb;
+ int i;
+
+ /* We must check every 512 byte sector */
+ for (i = 0; i < BLOCK_SIZE; i += 0x200) {
+ lsb = (const struct lvm2_super_block *)(buf + i);
+
+ if (!memcmp(lsb->magic, LVM2_MAGIC, LVM2_MAGIC_L) &&
+ !memcmp(lsb->type, LVM2_TYPE, LVM2_TYPE_L)) {
+ /* This is just one of possibly many PV's */
+ *blocks = 0;
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
struct imagetype {
off_t block;
const char name[12];
@@ -214,6 +235,8 @@
{ 0, "romfs"...