Lines Matching refs:geo

115 				int lunid = (ch * dev->geo.num_lun) + lun;
142 int num_ch = num_lun / dev->geo.num_lun;
143 int num_ch_mod = num_lun % dev->geo.num_lun;
144 int bch = lun_begin / dev->geo.num_lun;
145 int blun = lun_begin % dev->geo.num_lun;
165 prev_num_lun = (luns_left > dev->geo.num_lun) ?
166 dev->geo.num_lun : luns_left;
172 int luns_in_chnl = (luns_left > dev->geo.num_lun) ?
173 dev->geo.num_lun : luns_left;
208 memcpy(&tgt_dev->geo, &dev->geo, sizeof(struct nvm_geo));
211 tgt_dev->geo.num_ch = num_ch;
212 tgt_dev->geo.num_lun = (lun_balanced) ? prev_num_lun : -1;
213 tgt_dev->geo.all_luns = num_lun;
214 tgt_dev->geo.all_chunks = num_lun * dev->geo.num_chk;
216 tgt_dev->geo.op = op;
218 sec_per_lun = dev->geo.clba * dev->geo.num_chk;
219 tgt_dev->geo.total_secs = num_lun * sec_per_lun;
261 static int nvm_config_check_luns(struct nvm_geo *geo, int lun_begin,
264 if (lun_begin > lun_end || lun_end >= geo->all_luns) {
266 lun_begin, lun_end, geo->all_luns - 1);
276 struct nvm_geo *geo = &dev->geo;
280 s->lun_end = geo->all_luns - 1;
283 return nvm_config_check_luns(geo, s->lun_begin, s->lun_end);
291 e->lun_end = dev->geo.all_luns - 1;
302 return nvm_config_check_luns(&dev->geo, e->lun_begin, e->lun_end);
345 if ((tt->flags & NVM_TGT_F_HOST_L2P) != (dev->geo.dom & NVM_RSP_L2P)) {
401 mdts = (dev->geo.csecs >> 9) * NVM_MAX_VLBA;
402 if (dev->geo.mdts) {
403 mdts = min_t(u32, dev->geo.mdts,
404 (dev->geo.csecs >> 9) * NVM_MAX_VLBA);
514 rmap->chnls = kcalloc(dev->geo.num_ch, sizeof(struct nvm_ch_map),
519 for (i = 0; i < dev->geo.num_ch; i++) {
522 int luns_in_chnl = dev->geo.num_lun;
556 for (i = 0; i < dev->geo.num_ch; i++)
675 struct nvm_geo *geo = &tgt_dev->geo;
679 if (geo->pln_mode == NVM_PLANE_SINGLE && nr_ppas == 1) {
693 plane_cnt = geo->pln_mode;
716 static int nvm_set_flags(struct nvm_geo *geo, struct nvm_rq *rqd)
720 if (geo->version == NVM_OCSSD_SPEC_20)
724 flags |= geo->pln_mode >> 1;
745 rqd->flags = nvm_set_flags(&tgt_dev->geo, rqd);
792 rqd->flags = nvm_set_flags(&tgt_dev->geo, rqd);
819 rqd->flags = nvm_set_flags(&dev->geo, rqd);
862 struct nvm_geo *geo = &dev->geo;
891 ppa.g.pg = geo->num_pg - 1;
892 ppa.g.pl = geo->num_pln - 1;
899 meta->wp = geo->clba;
920 for (pg = 0; pg < geo->num_pg; pg++) {
921 for (pl = 0; pl < geo->num_pln; pl++) {
929 meta->wp += geo->ws_min;
937 meta->wp += geo->ws_min;
959 struct nvm_geo *geo = &dev->geo;
962 for (blk = 0; blk < geo->num_chk; blk++) {
963 offset = blk * geo->pln_mode;
966 for (pl = 0; pl < geo->pln_mode; pl++) {
980 meta->cnlb = dev->geo.clba;
999 struct nvm_geo *geo = &dev->geo;
1011 if ((nchks % geo->num_chk) != 0)
1014 nr_blks = geo->num_chk * geo->pln_mode;
1020 for (ch = ppa.g.ch; ch < geo->num_ch; ch++) {
1021 for (lun = ppa.g.lun; lun < geo->num_lun; lun++) {
1041 meta += geo->num_chk;
1042 nchks -= geo->num_chk;
1057 if (dev->geo.version == NVM_OCSSD_SPEC_12)
1071 if (dev->geo.version == NVM_OCSSD_SPEC_20)
1095 struct nvm_geo *geo = &dev->geo;
1098 dev->lun_map = kcalloc(BITS_TO_LONGS(geo->all_luns),
1134 struct nvm_geo *geo = &dev->geo;
1142 pr_debug("ver:%u.%u nvm_vendor:%x\n", geo->major_ver_id,
1143 geo->minor_ver_id, geo->vmnt);
1152 dev->name, dev->geo.ws_min, dev->geo.ws_opt,
1153 dev->geo.num_chk, dev->geo.all_luns,
1154 dev->geo.num_ch);
1189 (NVM_MAX_VLBA * (sizeof(u64) + dev->geo.sos)));