diff options
| author | Andrew Morton <akpm@digeo.com> | 2002-10-08 18:37:17 -0700 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2002-10-08 18:37:17 -0700 |
| commit | 9f2f568c623f879193b781bffa20f40136740bbe (patch) | |
| tree | 6924cf7a03560cf3726a775310477268bae76734 /include/linux | |
| parent | 7eb32c6d524ba601b632642ec26a8b658bb3fba4 (diff) | |
[PATCH] 64-bit sector_t - various driver changes
peter's code works for me, and the 40-odd people who download
the -mm patches. Anton has tested it on ppc64 and I presume that
Peter has tested it on ia64. I use gcc-2.91.66 and others use
later compilers. I expect that any remaining problems will
mainly be caught by the compiler. And compiler bugs can be
detected by turning off the option in config and seeing if things
get better.
From Peter Chubb
- do_request() function takes sector_t not unsigned long as the
block number to operate on.
- Various casts to long where the underlying device can never get
big enough to warrant a 64-bit sector offset.
- Cast sector_t to unsigned long long when printing.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/blkdev.h | 20 | ||||
| -rw-r--r-- | include/linux/genhd.h | 6 | ||||
| -rw-r--r-- | include/linux/ide.h | 2 |
3 files changed, 22 insertions, 6 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 9ea7b652237b..4929d743683d 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -37,7 +37,7 @@ struct request { int errors; sector_t sector; unsigned long nr_sectors; - unsigned long hard_sector; /* the hard_* are block layer + sector_t hard_sector; /* the hard_* are block layer * internals, no driver should * touch them */ @@ -394,13 +394,29 @@ extern inline unsigned int block_size(struct block_device *bdev) typedef struct {struct page *v;} Sector; -unsigned char *read_dev_sector(struct block_device *, unsigned long, Sector *); +unsigned char *read_dev_sector(struct block_device *, sector_t, Sector *); static inline void put_dev_sector(Sector p) { page_cache_release(p.v); } +#ifdef CONFIG_LBD +# include <asm/div64.h> +# define sector_div(a, b) do_div(a, b) +#else +# define sector_div(n, b)( \ +{ \ + int _res; \ + _res = (n) % (b); \ + (n) /= (b); \ + _res; \ +} \ +) +#endif + + + extern atomic_t nr_iowait_tasks; void io_schedule(void); void io_schedule_timeout(long timeout); diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 3c7d1c358f5b..62781b452fe9 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -59,8 +59,8 @@ struct partition { # include <linux/devfs_fs_kernel.h> struct hd_struct { - unsigned long start_sect; - unsigned long nr_sects; + sector_t start_sect; + sector_t nr_sects; devfs_handle_t de; /* primary (master) devfs entry */ struct device hd_driverfs_dev; /* support driverfs hiearchy */ }; @@ -95,7 +95,7 @@ extern void add_disk(struct gendisk *disk); extern void del_gendisk(struct gendisk *gp); extern void unlink_gendisk(struct gendisk *gp); extern struct gendisk *get_gendisk(dev_t dev, int *part); -static inline unsigned long get_start_sect(struct block_device *bdev) +static inline sector_t get_start_sect(struct block_device *bdev) { return bdev->bd_offset; } diff --git a/include/linux/ide.h b/include/linux/ide.h index dccb454552b3..0655a585300f 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1183,7 +1183,7 @@ typedef struct ide_driver_s { int (*suspend)(ide_drive_t *); int (*resume)(ide_drive_t *); int (*flushcache)(ide_drive_t *); - ide_startstop_t (*do_request)(ide_drive_t *, struct request *, unsigned long); + ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); int (*end_request)(ide_drive_t *, int, int); u8 (*sense)(ide_drive_t *, const char *, u8); ide_startstop_t (*error)(ide_drive_t *, const char *, u8); |
