[PATCH 5/5] lightnvm: set block priority in nvm_set_rqd_ppalist()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When a ppa_list with vblks is expanded, it can either go block or
plane first. Currently it is been plane first. This works well for a
single vblk that is expanded, but fails for controllers that
require data for all planes is grouped together. Make the ppa_list
expand first expand with block, and then plane to support this
behavior.

 Before (2 blocks, 4 planes per vblk)
  idx block plane
   0      0     0
   1      1     0
   2      0     1
   3      1     1
   4      0     2
   5      1     2
   6      0     3
   7      1     3

 After
  idx block plane
   0      0     0
   1      0     1
   2      0     2
   3      0     3
   4      1     0
   5      1     1
   6      1     2
   7      1     3

Signed-off-by: Matias Bjørling <m@xxxxxxxxxxx>
---
 drivers/lightnvm/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index de5db7b..0e82798 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -279,7 +279,8 @@ int nvm_set_rqd_ppalist(struct nvm_dev *dev, struct nvm_rq *rqd,
 		for (i = 0; i < nr_ppas; i++) {
 			for (pl_idx = 0; pl_idx < plane_cnt; pl_idx++) {
 				ppas[i].g.pl = pl_idx;
-				rqd->ppa_list[(pl_idx * nr_ppas) + i] = ppas[i];
+				rqd->ppa_list[(plane_cnt * i) + pl_idx] =
+									ppas[i];
 			}
 		}
 	}
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux