diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 11:37:45 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 11:37:45 -0800 |
commit | c827ba4cb49a30ce581201fd0ba2be77cde412c7 (patch) | |
tree | b573020e4d30ecdf69b22fcd1ced3dbb0e024ed3 /fs/partitions | |
parent | fdba0f2da4b1db682b829b76302b2f25c376051c (diff) | |
parent | 784020fb950741cbb7390c6b622321da626fb1e8 (diff) | |
download | kernel-common-c827ba4cb49a30ce581201fd0ba2be77cde412c7.tar.gz kernel-common-c827ba4cb49a30ce581201fd0ba2be77cde412c7.tar.bz2 kernel-common-c827ba4cb49a30ce581201fd0ba2be77cde412c7.zip |
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/partitions')
-rw-r--r-- | fs/partitions/check.c | 15 | ||||
-rw-r--r-- | fs/partitions/msdos.c | 2 | ||||
-rw-r--r-- | fs/partitions/sgi.c | 2 | ||||
-rw-r--r-- | fs/partitions/sun.c | 5 |
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) kobject_put(&p->kobj); } -void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len) +void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len, int flags) { struct hd_struct *p; @@ -390,6 +390,15 @@ void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len) if (!disk->part_uevent_suppress) kobject_uevent(&p->kobj, KOBJ_ADD); sysfs_create_link(&p->kobj, &block_subsys.kset.kobj, "subsystem"); + if (flags & ADDPART_FLAG_WHOLEDISK) { + static struct attribute addpartattr = { + .name = "whole_disk", + .mode = S_IRUSR | S_IRGRP | S_IROTH, + .owner = THIS_MODULE, + }; + + sysfs_create_file(&p->kobj, &addpartattr); + } partition_sysfs_add_subdir(p); disk->part[part-1] = p; } @@ -543,9 +552,9 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev) printk(" %s: p%d exceeds device capacity\n", disk->disk_name, p); } - add_partition(disk, p, from, size); + add_partition(disk, p, from, size, state->parts[p].flags); #ifdef CONFIG_BLK_DEV_MD - if (state->parts[p].flags) + if (state->parts[p].flags & ADDPART_FLAG_RAID) md_autodetect_dev(bdev->bd_dev+p); #endif } 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, put_partition(state, state->next, next, size); if (SYS_IND(p) == LINUX_RAID_PARTITION) - state->parts[state->next].flags = 1; + state->parts[state->next].flags = ADDPART_FLAG_RAID; loopct = 0; if (++state->next == state->limit) 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) if (blocks) { put_partition(state, slot, start, blocks); if (be32_to_cpu(p->type) == LINUX_RAID_PARTITION) - state->parts[slot].flags = 1; + state->parts[slot].flags = ADDPART_FLAG_RAID; } slot++; } 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) num_sectors = be32_to_cpu(p->num_sectors); if (num_sectors) { put_partition(state, slot, st_sector, num_sectors); + state->parts[slot].flags = 0; if (label->infos[i].id == LINUX_RAID_PARTITION) - state->parts[slot].flags = 1; + state->parts[slot].flags |= ADDPART_FLAG_RAID; + if (label->infos[i].id == SUN_WHOLE_DISK) + state->parts[slot].flags |= ADDPART_FLAG_WHOLEDISK; } slot++; } |