diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-18 20:13:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-18 20:13:31 -0400 |
commit | 237045fc3c67d44088f767dca5a9fa30815eba62 (patch) | |
tree | 50773de6320e4b3358e3935c2f3c6f93d0dc93f3 /drivers/lightnvm/core.c | |
parent | 35d88d97bee90fc09286d28209a64a991291a64a (diff) | |
parent | 118472ab8532e55f48395ef5764b354fe48b1d73 (diff) |
Merge branch 'for-4.6/drivers' of git://git.kernel.dk/linux-block
Pull block driver updates from Jens Axboe:
"This is the block driver pull request for this merge window. It sits
on top of for-4.6/core, that was just sent out.
This contains:
- A set of fixes for lightnvm. One from Alan, fixing an overflow,
and the rest from the usual suspects, Javier and Matias.
- A set of fixes for nbd from Markus and Dan, and a fixup from Arnd
for correct usage of the signed 64-bit divider.
- A set of bug fixes for the Micron mtip32xx, from Asai.
- A fix for the brd discard handling from Bart.
- Update the maintainers entry for cciss, since that hardware has
transferred ownership.
- Three bug fixes for bcache from Eric Wheeler.
- Set of fixes for xen-blk{back,front} from Jan and Konrad.
- Removal of the cpqarray driver. It has been disabled in Kconfig
since 2013, and we were initially scheduled to remove it in 3.15.
- Various updates and fixes for NVMe, with the most important being:
- Removal of the per-device NVMe thread, replacing that with a
watchdog timer instead. From Christoph.
- Exposing the namespace WWID through sysfs, from Keith.
- Set of cleanups from Ming Lin.
- Logging the controller device name instead of the underlying
PCI device name, from Sagi.
- And a bunch of fixes and optimizations from the usual suspects
in this area"
* 'for-4.6/drivers' of git://git.kernel.dk/linux-block: (49 commits)
NVMe: Expose ns wwid through single sysfs entry
drivers:block: cpqarray clean up
brd: Fix discard request processing
cpqarray: remove it from the kernel
cciss: update MAINTAINERS
NVMe: Remove unused sq_head read in completion path
bcache: fix cache_set_flush() NULL pointer dereference on OOM
bcache: cleaned up error handling around register_cache()
bcache: fix race of writeback thread starting before complete initialization
NVMe: Create discard zero quirk white list
nbd: use correct div_s64 helper
mtip32xx: remove unneeded variable in mtip_cmd_timeout()
lightnvm: generalize rrpc ppa calculations
lightnvm: remove struct nvm_dev->total_blocks
lightnvm: rename ->nr_pages to ->nr_sects
lightnvm: update closed list outside of intr context
xen/blback: Fit the important information of the thread in 17 characters
lightnvm: fold get bb tbl when using dual/quad plane mode
lightnvm: fix up nonsensical configure overrun checking
xen-blkback: advertise indirect segment support earlier
...
Diffstat (limited to 'drivers/lightnvm/core.c')
-rw-r--r-- | drivers/lightnvm/core.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index 9f6acd5d1d2e..0d1fb6b40c46 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c | |||
@@ -250,7 +250,7 @@ int nvm_set_rqd_ppalist(struct nvm_dev *dev, struct nvm_rq *rqd, | |||
250 | return 0; | 250 | return 0; |
251 | } | 251 | } |
252 | 252 | ||
253 | plane_cnt = (1 << dev->plane_mode); | 253 | plane_cnt = dev->plane_mode; |
254 | rqd->nr_pages = plane_cnt * nr_ppas; | 254 | rqd->nr_pages = plane_cnt * nr_ppas; |
255 | 255 | ||
256 | if (dev->ops->max_phys_sect < rqd->nr_pages) | 256 | if (dev->ops->max_phys_sect < rqd->nr_pages) |
@@ -463,11 +463,7 @@ static int nvm_core_init(struct nvm_dev *dev) | |||
463 | dev->sec_per_lun = dev->sec_per_blk * dev->blks_per_lun; | 463 | dev->sec_per_lun = dev->sec_per_blk * dev->blks_per_lun; |
464 | dev->nr_luns = dev->luns_per_chnl * dev->nr_chnls; | 464 | dev->nr_luns = dev->luns_per_chnl * dev->nr_chnls; |
465 | 465 | ||
466 | dev->total_blocks = dev->nr_planes * | 466 | dev->total_secs = dev->nr_luns * dev->sec_per_lun; |
467 | dev->blks_per_lun * | ||
468 | dev->luns_per_chnl * | ||
469 | dev->nr_chnls; | ||
470 | dev->total_pages = dev->total_blocks * dev->pgs_per_blk; | ||
471 | INIT_LIST_HEAD(&dev->online_targets); | 467 | INIT_LIST_HEAD(&dev->online_targets); |
472 | mutex_init(&dev->mlock); | 468 | mutex_init(&dev->mlock); |
473 | 469 | ||
@@ -872,20 +868,19 @@ static int nvm_configure_by_str_event(const char *val, | |||
872 | 868 | ||
873 | static int nvm_configure_get(char *buf, const struct kernel_param *kp) | 869 | static int nvm_configure_get(char *buf, const struct kernel_param *kp) |
874 | { | 870 | { |
875 | int sz = 0; | 871 | int sz; |
876 | char *buf_start = buf; | ||
877 | struct nvm_dev *dev; | 872 | struct nvm_dev *dev; |
878 | 873 | ||
879 | buf += sprintf(buf, "available devices:\n"); | 874 | sz = sprintf(buf, "available devices:\n"); |
880 | down_write(&nvm_lock); | 875 | down_write(&nvm_lock); |
881 | list_for_each_entry(dev, &nvm_devices, devices) { | 876 | list_for_each_entry(dev, &nvm_devices, devices) { |
882 | if (sz > 4095 - DISK_NAME_LEN) | 877 | if (sz > 4095 - DISK_NAME_LEN - 2) |
883 | break; | 878 | break; |
884 | buf += sprintf(buf, " %32s\n", dev->name); | 879 | sz += sprintf(buf + sz, " %32s\n", dev->name); |
885 | } | 880 | } |
886 | up_write(&nvm_lock); | 881 | up_write(&nvm_lock); |
887 | 882 | ||
888 | return buf - buf_start - 1; | 883 | return sz; |
889 | } | 884 | } |
890 | 885 | ||
891 | static const struct kernel_param_ops nvm_configure_by_str_event_param_ops = { | 886 | static const struct kernel_param_ops nvm_configure_by_str_event_param_ops = { |