X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fpartitions%2Fcheck.c;h=ed308494390c5539dfc7a7ce37f0990bb3ec48b9;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=b16b949f0af50ac1fd22f10f7f9296cbf363b097;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/fs/partitions/check.c b/fs/partitions/check.c index b16b949f0..ed3084943 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c @@ -29,7 +29,6 @@ #include "ldm.h" #include "mac.h" #include "msdos.h" -#include "nec98.h" #include "osf.h" #include "sgi.h" #include "sun.h" @@ -138,25 +137,14 @@ const char *bdevname(struct block_device *bdev, char *buf) EXPORT_SYMBOL(bdevname); /* - * NOTE: this cannot be called from interrupt context. - * - * But in interrupt context you should really have a struct - * block_device anyway and use bdevname() above. + * There's very little reason to use this, you should really + * have a struct block_device just about everywhere and use + * bdevname() instead. */ const char *__bdevname(dev_t dev, char *buffer) { - struct gendisk *disk; - int part; - - disk = get_gendisk(dev, &part); - if (disk) { - buffer = disk_name(disk, part, buffer); - put_disk(disk); - } else { - snprintf(buffer, BDEVNAME_SIZE, "unknown-block(%u,%u)", + scnprintf(buffer, BDEVNAME_SIZE, "unknown-block(%u,%u)", MAJOR(dev), MINOR(dev)); - } - return buffer; } @@ -407,7 +395,7 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev) if (disk->fops->revalidate_disk) disk->fops->revalidate_disk(disk); if (!get_capacity(disk) || !(state = check_partition(disk, bdev))) - return res; + return -EIO; for (p = 1; p < state->limit; p++) { sector_t size = state->parts[p].size; sector_t from = state->parts[p].from; @@ -420,7 +408,7 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev) #endif } kfree(state); - return res; + return 0; } unsigned char *read_dev_sector(struct block_device *bdev, sector_t n, Sector *p)