patch-2.4.11-dontuse linux/fs/partitions/osf.c
Next file: linux/fs/partitions/osf.h
Previous file: linux/fs/partitions/msdos.h
Back to the patch index
Back to the overall index
- Lines: 51
- Date:
Mon Oct 1 20:03:26 2001
- Orig file:
v2.4.10/linux/fs/partitions/osf.c
- Orig date:
Fri Feb 16 16:02:37 2001
diff -u --recursive --new-file v2.4.10/linux/fs/partitions/osf.c linux/fs/partitions/osf.c
@@ -17,12 +17,13 @@
#include "check.h"
#include "osf.h"
-int osf_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sector,
- int current_minor)
+int osf_partition(struct gendisk *hd, struct block_device *bdev,
+ unsigned long first_sector, int current_minor)
{
int i;
+ Sector sect;
+ unsigned char *data;
int mask = (1 << hd->minor_shift) - 1;
- struct buffer_head *bh;
struct disklabel {
u32 d_magic;
u16 d_type,d_subtype;
@@ -56,18 +57,18 @@
} * label;
struct d_partition * partition;
- if (!(bh = bread(dev,0,get_ptable_blocksize(dev)))) {
- if (warn_no_part) printk("unable to read partition table\n");
+ data = read_dev_sector(bdev, 0, §);
+ if (!data)
return -1;
- }
- label = (struct disklabel *) (bh->b_data+64);
+
+ label = (struct disklabel *) (data+64);
partition = label->d_partitions;
if (le32_to_cpu(label->d_magic) != DISKLABELMAGIC) {
- brelse(bh);
+ put_dev_sector(sect);
return 0;
}
if (le32_to_cpu(label->d_magic2) != DISKLABELMAGIC) {
- brelse(bh);
+ put_dev_sector(sect);
return 0;
}
for (i = 0 ; i < le16_to_cpu(label->d_npartitions); i++, partition++) {
@@ -80,7 +81,7 @@
current_minor++;
}
printk("\n");
- brelse(bh);
+ put_dev_sector(sect);
return 1;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)