fs/partitions: use ADDPART_FLAG_RAID instead of magic number
authorCesar Eduardo Barros <cesarb@cesarb.net>
Sat, 17 Apr 2010 22:28:09 +0000 (19:28 -0300)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 21 May 2010 22:31:21 +0000 (18:31 -0400)
ADDPART_FLAG_RAID was introduced in commit d18d768, and most places were
converted to use it instead of a hardcoded value. However, some places seem
to have been missed.

Change all of them to the symbolic names via the following semantic patch:

@@
struct parsed_partitions *state;
expression E;
@@
(
- state->parts[E].flags = 1
+ state->parts[E].flags = ADDPART_FLAG_RAID
|
- state->parts[E].flags |= 1
+ state->parts[E].flags |= ADDPART_FLAG_RAID
|
- state->parts[E].flags = 2
+ state->parts[E].flags = ADDPART_FLAG_WHOLEDISK
|
- state->parts[E].flags |= 2
+ state->parts[E].flags |= ADDPART_FLAG_WHOLEDISK
)

Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/partitions/efi.c
fs/partitions/mac.c
fs/partitions/msdos.c

index 91babdae75875bc0e7510c9594529cca1247e20c..f5867f8ed214d5030c971c11875cf873109ff9de 100644 (file)
@@ -631,7 +631,7 @@ efi_partition(struct parsed_partitions *state, struct block_device *bdev)
                /* If this is a RAID volume, tell md */
                if (!efi_guidcmp(ptes[i].partition_type_guid,
                                 PARTITION_LINUX_RAID_GUID))
-                       state->parts[i+1].flags = 1;
+                       state->parts[i + 1].flags = ADDPART_FLAG_RAID;
        }
        kfree(ptes);
        kfree(gpt);
index d4a0fad3563b4bbee00e2155e3210e2b01f0021c..dece9b4c881ffa9cb2e6031b5651679f1d88b701 100644 (file)
@@ -75,7 +75,7 @@ int mac_partition(struct parsed_partitions *state, struct block_device *bdev)
                        be32_to_cpu(part->block_count) * (secsize/512));
 
                if (!strnicmp(part->type, "Linux_RAID", 10))
-                       state->parts[slot].flags = 1;
+                       state->parts[slot].flags = ADDPART_FLAG_RAID;
 #ifdef CONFIG_PPC_PMAC
                /*
                 * If this is the first bootable partition, tell the
index 90be97f1f5a8c8ce5cf737c3e52020e0e516a291..efe3df75f84d37b2ab3959c34dae04c11f0955d3 100644 (file)
@@ -509,7 +509,7 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev)
                }
                put_partition(state, slot, start, size);
                if (SYS_IND(p) == LINUX_RAID_PARTITION)
-                       state->parts[slot].flags = 1;
+                       state->parts[slot].flags = ADDPART_FLAG_RAID;
                if (SYS_IND(p) == DM6_PARTITION)
                        printk("[DM]");
                if (SYS_IND(p) == EZD_PARTITION)