diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-06-07 07:52:52 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-06-07 07:52:52 -0400 |
commit | e957b60d1583022a0f7c03267d37fcae2ddb78b1 (patch) | |
tree | 5e9518eb38d427b9ac41c9b90b31b9b2453aebfc /include/linux/ide.h | |
parent | db429e9ec0f9dee2d8e50c154f04f29f880fc9d6 (diff) |
ide-gd: implement block device ->set_capacity method (v2)
* Use ->probed_capacity to store native device capacity for ATA disks.
* Add ->set_capacity method to struct ide_disk_ops.
* Implement disk device ->set_capacity method for ATA disks.
* Implement block device ->set_capacity method.
v2:
* Check if LBA and HPA are supported in ide_disk_set_capacity().
* According to the spec the SET MAX ADDRESS command shall be
immediately preceded by a READ NATIVE MAX ADDRESS command.
* Add ide_disk_hpa_{get_native,set}_capacity() helpers.
Together with the previous patch adding ->set_capacity block device
method this allows automatic disabling of Host Protected Area (HPA)
if any partitions overlapping HPA are detected.
Cc: Robert Hancock <hancockrwd@gmail.com>
Cc: Frans Pop <elendil@planet.nl>
Cc: "Andries E. Brouwer" <Andries.Brouwer@cwi.nl>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Emphatically-Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r-- | include/linux/ide.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index 9fed365a598b..e96ace12872a 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -397,6 +397,7 @@ struct ide_drive_s; | |||
397 | struct ide_disk_ops { | 397 | struct ide_disk_ops { |
398 | int (*check)(struct ide_drive_s *, const char *); | 398 | int (*check)(struct ide_drive_s *, const char *); |
399 | int (*get_capacity)(struct ide_drive_s *); | 399 | int (*get_capacity)(struct ide_drive_s *); |
400 | u64 (*set_capacity)(struct ide_drive_s *, u64); | ||
400 | void (*setup)(struct ide_drive_s *); | 401 | void (*setup)(struct ide_drive_s *); |
401 | void (*flush)(struct ide_drive_s *); | 402 | void (*flush)(struct ide_drive_s *); |
402 | int (*init_media)(struct ide_drive_s *, struct gendisk *); | 403 | int (*init_media)(struct ide_drive_s *, struct gendisk *); |
@@ -568,8 +569,7 @@ struct ide_drive_s { | |||
568 | unsigned int drive_data; /* used by set_pio_mode/dev_select() */ | 569 | unsigned int drive_data; /* used by set_pio_mode/dev_select() */ |
569 | unsigned int failures; /* current failure count */ | 570 | unsigned int failures; /* current failure count */ |
570 | unsigned int max_failures; /* maximum allowed failure count */ | 571 | unsigned int max_failures; /* maximum allowed failure count */ |
571 | u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */ | 572 | u64 probed_capacity;/* initial/native media capacity */ |
572 | |||
573 | u64 capacity64; /* total number of sectors */ | 573 | u64 capacity64; /* total number of sectors */ |
574 | 574 | ||
575 | int lun; /* logical unit */ | 575 | int lun; /* logical unit */ |