mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
block,ide: simplify bdops->set_capacity() to ->unlock_native_capacity()
bdops->set_capacity() is unnecessarily generic. All that's required is a simple one way notification to lower level driver telling it to try to unlock native capacity. There's no reason to pass in target capacity or return the new capacity. The former is always the inherent native capacity and the latter can be handled via the usual device resize / revalidation path. In fact, the current API is always used that way. Replace ->set_capacity() with ->unlock_native_capacity() which take only @disk and doesn't return anything. IDE which is the only current user of the API is converted accordingly. Signed-off-by: Tejun Heo <[email protected]> Cc: Ben Hutchings <[email protected]> Cc: Bartlomiej Zolnierkiewicz <[email protected]> Acked-by: David S. Miller <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
56bca01738
commit
c3e33e043f
5 changed files with 24 additions and 36 deletions
|
|
@ -601,10 +601,10 @@ rescan:
|
|||
"%s: p%d size %llu exceeds device capacity, ",
|
||||
disk->disk_name, p, (unsigned long long) size);
|
||||
|
||||
if (bdops->set_capacity &&
|
||||
if (bdops->unlock_native_capacity &&
|
||||
(disk->flags & GENHD_FL_NATIVE_CAPACITY) == 0) {
|
||||
printk(KERN_CONT "enabling native capacity\n");
|
||||
bdops->set_capacity(disk, ~0ULL);
|
||||
bdops->unlock_native_capacity(disk);
|
||||
disk->flags |= GENHD_FL_NATIVE_CAPACITY;
|
||||
/* free state and restart */
|
||||
kfree(state);
|
||||
|
|
|
|||
Loading…
Reference in a new issue