aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 14:37:45 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 14:37:45 -0500
commitc827ba4cb49a30ce581201fd0ba2be77cde412c7 (patch)
treeb573020e4d30ecdf69b22fcd1ced3dbb0e024ed3 /fs
parentfdba0f2da4b1db682b829b76302b2f25c376051c (diff)
parent784020fb950741cbb7390c6b622321da626fb1e8 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: [SPARC64]: Update defconfig. [SPARC64]: Add PCI MSI support on Niagara. [SPARC64] IRQ: Use irq_desc->chip_data instead of irq_desc->handler_data [SPARC64]: Add obppath sysfs attribute for SBUS and PCI devices. [PARTITION]: Add whole_disk attribute.
Diffstat (limited to 'fs')
-rw-r--r--fs/partitions/check.c15
-rw-r--r--fs/partitions/msdos.c2
-rw-r--r--fs/partitions/sgi.c2
-rw-r--r--fs/partitions/sun.c5
4 files changed, 18 insertions, 6 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 3d73d94d93a7..ac32a2e8540c 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -365,7 +365,7 @@ void delete_partition(struct gendisk *disk, int part)
365 kobject_put(&p->kobj); 365 kobject_put(&p->kobj);
366} 366}
367 367
368void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len) 368void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len, int flags)
369{ 369{
370 struct hd_struct *p; 370 struct hd_struct *p;
371 371
@@ -390,6 +390,15 @@ void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len)
390 if (!disk->part_uevent_suppress) 390 if (!disk->part_uevent_suppress)
391 kobject_uevent(&p->kobj, KOBJ_ADD); 391 kobject_uevent(&p->kobj, KOBJ_ADD);
392 sysfs_create_link(&p->kobj, &block_subsys.kset.kobj, "subsystem"); 392 sysfs_create_link(&p->kobj, &block_subsys.kset.kobj, "subsystem");
393 if (flags & ADDPART_FLAG_WHOLEDISK) {
394 static struct attribute addpartattr = {
395 .name = "whole_disk",
396 .mode = S_IRUSR | S_IRGRP | S_IROTH,
397 .owner = THIS_MODULE,
398 };
399
400 sysfs_create_file(&p->kobj, &addpartattr);
401 }
393 partition_sysfs_add_subdir(p); 402 partition_sysfs_add_subdir(p);
394 disk->part[part-1] = p; 403 disk->part[part-1] = p;
395} 404}
@@ -543,9 +552,9 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
543 printk(" %s: p%d exceeds device capacity\n", 552 printk(" %s: p%d exceeds device capacity\n",
544 disk->disk_name, p); 553 disk->disk_name, p);
545 } 554 }
546 add_partition(disk, p, from, size); 555 add_partition(disk, p, from, size, state->parts[p].flags);
547#ifdef CONFIG_BLK_DEV_MD 556#ifdef CONFIG_BLK_DEV_MD
548 if (state->parts[p].flags) 557 if (state->parts[p].flags & ADDPART_FLAG_RAID)
549 md_autodetect_dev(bdev->bd_dev+p); 558 md_autodetect_dev(bdev->bd_dev+p);
550#endif 559#endif
551 } 560 }
diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c
index 78443e07b3c4..4ccec4cd1367 100644
--- a/fs/partitions/msdos.c
+++ b/fs/partitions/msdos.c
@@ -165,7 +165,7 @@ parse_extended(struct parsed_partitions *state, struct block_device *bdev,
165 165
166 put_partition(state, state->next, next, size); 166 put_partition(state, state->next, next, size);
167 if (SYS_IND(p) == LINUX_RAID_PARTITION) 167 if (SYS_IND(p) == LINUX_RAID_PARTITION)
168 state->parts[state->next].flags = 1; 168 state->parts[state->next].flags = ADDPART_FLAG_RAID;
169 loopct = 0; 169 loopct = 0;
170 if (++state->next == state->limit) 170 if (++state->next == state->limit)
171 goto done; 171 goto done;
diff --git a/fs/partitions/sgi.c b/fs/partitions/sgi.c
index 6fa4ff895104..ed5ac83fe83a 100644
--- a/fs/partitions/sgi.c
+++ b/fs/partitions/sgi.c
@@ -72,7 +72,7 @@ int sgi_partition(struct parsed_partitions *state, struct block_device *bdev)
72 if (blocks) { 72 if (blocks) {
73 put_partition(state, slot, start, blocks); 73 put_partition(state, slot, start, blocks);
74 if (be32_to_cpu(p->type) == LINUX_RAID_PARTITION) 74 if (be32_to_cpu(p->type) == LINUX_RAID_PARTITION)
75 state->parts[slot].flags = 1; 75 state->parts[slot].flags = ADDPART_FLAG_RAID;
76 } 76 }
77 slot++; 77 slot++;
78 } 78 }
diff --git a/fs/partitions/sun.c b/fs/partitions/sun.c
index 0a5927c806ca..123f8b46c8ba 100644
--- a/fs/partitions/sun.c
+++ b/fs/partitions/sun.c
@@ -80,8 +80,11 @@ int sun_partition(struct parsed_partitions *state, struct block_device *bdev)
80 num_sectors = be32_to_cpu(p->num_sectors); 80 num_sectors = be32_to_cpu(p->num_sectors);
81 if (num_sectors) { 81 if (num_sectors) {
82 put_partition(state, slot, st_sector, num_sectors); 82 put_partition(state, slot, st_sector, num_sectors);
83 state->parts[slot].flags = 0;
83 if (label->infos[i].id == LINUX_RAID_PARTITION) 84 if (label->infos[i].id == LINUX_RAID_PARTITION)
84 state->parts[slot].flags = 1; 85 state->parts[slot].flags |= ADDPART_FLAG_RAID;
86 if (label->infos[i].id == SUN_WHOLE_DISK)
87 state->parts[slot].flags |= ADDPART_FLAG_WHOLEDISK;
85 } 88 }
86 slot++; 89 slot++;
87 } 90 }