Lines Matching defs:nsindex
115 struct nd_namespace_index *nsindex[] = {
119 const int num_index = ARRAY_SIZE(nsindex);
131 memcpy(sig, nsindex[i]->sig, NSINDEX_SIG_LEN);
133 dev_dbg(dev, "nsindex%d signature invalid\n", i);
138 version = __le16_to_cpu(nsindex[i]->major) * 100
139 + __le16_to_cpu(nsindex[i]->minor);
141 labelsize = 1 << (7 + nsindex[i]->labelsize);
146 dev_dbg(dev, "nsindex%d labelsize %d invalid\n",
147 i, nsindex[i]->labelsize);
151 sum_save = __le64_to_cpu(nsindex[i]->checksum);
152 nsindex[i]->checksum = __cpu_to_le64(0);
153 sum = nd_fletcher64(nsindex[i], sizeof_namespace_index(ndd), 1);
154 nsindex[i]->checksum = __cpu_to_le64(sum_save);
156 dev_dbg(dev, "nsindex%d checksum invalid\n", i);
160 seq = __le32_to_cpu(nsindex[i]->seq);
162 dev_dbg(dev, "nsindex%d sequence: %#x invalid\n", i, seq);
167 if (__le64_to_cpu(nsindex[i]->myoff)
169 dev_dbg(dev, "nsindex%d myoff: %#llx invalid\n",
171 __le64_to_cpu(nsindex[i]->myoff));
174 if (__le64_to_cpu(nsindex[i]->otheroff)
176 dev_dbg(dev, "nsindex%d otheroff: %#llx invalid\n",
178 __le64_to_cpu(nsindex[i]->otheroff));
181 if (__le64_to_cpu(nsindex[i]->labeloff)
183 dev_dbg(dev, "nsindex%d labeloff: %#llx invalid\n",
185 __le64_to_cpu(nsindex[i]->labeloff));
189 size = __le64_to_cpu(nsindex[i]->mysize);
192 dev_dbg(dev, "nsindex%d mysize: %#llx invalid\n", i, size);
196 nslot = __le32_to_cpu(nsindex[i]->nslot);
200 dev_dbg(dev, "nsindex%d nslot: %u invalid, config_size: %#x\n",
220 seq = best_seq(__le32_to_cpu(nsindex[0]->seq),
221 __le32_to_cpu(nsindex[1]->seq));
222 if (seq == (__le32_to_cpu(nsindex[1]->seq) & NSINDEX_SEQ_MASK))
311 struct nd_namespace_index *nsindex;
313 nsindex = to_namespace_index(ndd, idx);
314 if (nsindex == NULL)
317 *free = (unsigned long *) nsindex->free;
318 *nslot = __le32_to_cpu(nsindex->nslot);
319 *nsindex_out = nsindex;
334 struct nd_namespace_index **nsindex,
337 return preamble_index(ndd, ndd->ns_current, nsindex,
342 struct nd_namespace_index **nsindex,
345 return preamble_index(ndd, ndd->ns_next, nsindex,
376 struct nd_namespace_index *nsindex;
380 if (!preamble_current(ndd, &nsindex, &free, &nslot))
416 struct nd_namespace_index *nsindex;
486 nsindex = to_current_namespace_index(ndd);
487 nd_label_copy(ndd, to_next_namespace_index(ndd), nsindex);
490 offset = __le64_to_cpu(nsindex->labeloff);
491 nslot = __le32_to_cpu(nsindex->nslot);
498 if (test_bit_le(i, nsindex->free)) {
537 struct nd_namespace_index *nsindex;
542 if (!preamble_current(ndd, &nsindex, &free, &nslot))
567 struct nd_namespace_index *nsindex;
571 if (!preamble_current(ndd, &nsindex, &free, &nslot))
590 struct nd_namespace_index *nsindex;
594 if (!preamble_next(ndd, &nsindex, &free, &nslot))
610 struct nd_namespace_index *nsindex;
614 if (!preamble_next(ndd, &nsindex, &free, &nslot))
626 struct nd_namespace_index *nsindex;
632 if (!preamble_next(ndd, &nsindex, &free, &nslot))
641 struct nd_namespace_index *nsindex;
647 nsindex = to_namespace_index(ndd, index);
651 nslot = __le32_to_cpu(nsindex->nslot);
653 memcpy(nsindex->sig, NSINDEX_SIGNATURE, NSINDEX_SIG_LEN);
654 memset(&nsindex->flags, 0, 3);
655 nsindex->labelsize = sizeof_namespace_label(ndd) >> 8;
656 nsindex->seq = __cpu_to_le32(seq);
657 offset = (unsigned long) nsindex
659 nsindex->myoff = __cpu_to_le64(offset);
660 nsindex->mysize = __cpu_to_le64(sizeof_namespace_index(ndd));
664 nsindex->otheroff = __cpu_to_le64(offset);
667 nsindex->labeloff = __cpu_to_le64(offset);
668 nsindex->nslot = __cpu_to_le32(nslot);
669 nsindex->major = __cpu_to_le16(1);
671 nsindex->minor = __cpu_to_le16(1);
673 nsindex->minor = __cpu_to_le16(2);
674 nsindex->checksum = __cpu_to_le64(0);
676 unsigned long *free = (unsigned long *) nsindex->free;
680 memset(nsindex->free, 0xff, nfree / 8);
684 checksum = nd_fletcher64(nsindex, sizeof_namespace_index(ndd), 1);
685 nsindex->checksum = __cpu_to_le64(checksum);
686 rc = nvdimm_set_config_data(ndd, __le64_to_cpu(nsindex->myoff),
687 nsindex, sizeof_namespace_index(ndd));
696 nd_label_copy(ndd, to_current_namespace_index(ndd), nsindex);
767 struct nd_namespace_index *nsindex;
777 if (!preamble_next(ndd, &nsindex, &free, &nslot))
780 cookie = nd_region_interleave_set_cookie(nd_region, nsindex);
845 nd_inc_seq(__le32_to_cpu(nsindex->seq)), 0);
907 struct nd_namespace_index *nsindex;
916 if (!preamble_next(ndd, &nsindex, &free, &nslot))
1081 nd_inc_seq(__le32_to_cpu(nsindex->seq)), 0);
1156 nd_label_copy(ndd, nsindex, to_current_namespace_index(ndd));
1168 struct nd_namespace_index *nsindex;
1194 nsindex = to_namespace_index(ndd, 0);
1195 memset(nsindex, 0, ndd->nsarea.config_size);
1212 struct nd_namespace_index *nsindex;
1223 if (!preamble_next(ndd, &nsindex, &free, &nslot))
1252 nd_inc_seq(__le32_to_cpu(nsindex->seq)), 0);