diff options
author | Christoph Hellwig <hch@lst.de> | 2006-01-08 04:02:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-08 23:13:54 -0500 |
commit | a885c8c4316e1c1d2d2c8755da3f3d14f852528d (patch) | |
tree | e4f4e7a7657c0944d11c259f8f17ffcd6b2da0f5 /include/linux | |
parent | 5b0ed2c64d8fdafb5fcfb3baabdd288628b1ff9b (diff) |
[PATCH] Add block_device_operations.getgeo block device method
HDIO_GETGEO is implemented in most block drivers, and all of them have to
duplicate the code to copy the structure to userspace, as well as getting
the start sector. This patch moves that to common code [1] and adds a
->getgeo method to fill out the raw kernel hd_geometry structure. For many
drivers this means ->ioctl can go away now.
[1] the s390 block drivers are odd in this respect. xpram sets ->start
to 4 always which seems more than odd, and the dasd driver shifts
the start offset around, probably because of it's non-standard
sector size.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@suse.de>
Cc: <mike.miller@hp.com>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Paolo Giarrusso <blaisorblade@yahoo.it>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/fs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 74c01aabd4ab..7f140480c6a8 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -224,6 +224,7 @@ extern int dir_notify_enable; | |||
224 | #include <asm/semaphore.h> | 224 | #include <asm/semaphore.h> |
225 | #include <asm/byteorder.h> | 225 | #include <asm/byteorder.h> |
226 | 226 | ||
227 | struct hd_geometry; | ||
227 | struct iovec; | 228 | struct iovec; |
228 | struct nameidata; | 229 | struct nameidata; |
229 | struct kiocb; | 230 | struct kiocb; |
@@ -962,6 +963,7 @@ struct block_device_operations { | |||
962 | int (*direct_access) (struct block_device *, sector_t, unsigned long *); | 963 | int (*direct_access) (struct block_device *, sector_t, unsigned long *); |
963 | int (*media_changed) (struct gendisk *); | 964 | int (*media_changed) (struct gendisk *); |
964 | int (*revalidate_disk) (struct gendisk *); | 965 | int (*revalidate_disk) (struct gendisk *); |
966 | int (*getgeo)(struct block_device *, struct hd_geometry *); | ||
965 | struct module *owner; | 967 | struct module *owner; |
966 | }; | 968 | }; |
967 | 969 | ||