Lines Matching defs:nsindex

123 	struct nd_namespace_index *nsindex[] = {
127 const int num_index = ARRAY_SIZE(nsindex);
139 memcpy(sig, nsindex[i]->sig, NSINDEX_SIG_LEN);
141 dev_dbg(dev, "nsindex%d signature invalid\n", i);
146 version = __le16_to_cpu(nsindex[i]->major) * 100
147 + __le16_to_cpu(nsindex[i]->minor);
149 labelsize = 1 << (7 + nsindex[i]->labelsize);
154 dev_dbg(dev, "nsindex%d labelsize %d invalid\n",
155 i, nsindex[i]->labelsize);
159 sum_save = __le64_to_cpu(nsindex[i]->checksum);
160 nsindex[i]->checksum = __cpu_to_le64(0);
161 sum = nd_fletcher64(nsindex[i], sizeof_namespace_index(ndd), 1);
162 nsindex[i]->checksum = __cpu_to_le64(sum_save);
164 dev_dbg(dev, "nsindex%d checksum invalid\n", i);
168 seq = __le32_to_cpu(nsindex[i]->seq);
170 dev_dbg(dev, "nsindex%d sequence: %#x invalid\n", i, seq);
175 if (__le64_to_cpu(nsindex[i]->myoff)
177 dev_dbg(dev, "nsindex%d myoff: %#llx invalid\n",
179 __le64_to_cpu(nsindex[i]->myoff));
182 if (__le64_to_cpu(nsindex[i]->otheroff)
184 dev_dbg(dev, "nsindex%d otheroff: %#llx invalid\n",
186 __le64_to_cpu(nsindex[i]->otheroff));
189 if (__le64_to_cpu(nsindex[i]->labeloff)
191 dev_dbg(dev, "nsindex%d labeloff: %#llx invalid\n",
193 __le64_to_cpu(nsindex[i]->labeloff));
197 size = __le64_to_cpu(nsindex[i]->mysize);
200 dev_dbg(dev, "nsindex%d mysize: %#llx invalid\n", i, size);
204 nslot = __le32_to_cpu(nsindex[i]->nslot);
208 dev_dbg(dev, "nsindex%d nslot: %u invalid, config_size: %#x\n",
228 seq = best_seq(__le32_to_cpu(nsindex[0]->seq),
229 __le32_to_cpu(nsindex[1]->seq));
230 if (seq == (__le32_to_cpu(nsindex[1]->seq) & NSINDEX_SEQ_MASK))
319 struct nd_namespace_index *nsindex;
321 nsindex = to_namespace_index(ndd, idx);
322 if (nsindex == NULL)
325 *free = (unsigned long *) nsindex->free;
326 *nslot = __le32_to_cpu(nsindex->nslot);
327 *nsindex_out = nsindex;
342 struct nd_namespace_index **nsindex,
345 return preamble_index(ndd, ndd->ns_current, nsindex,
350 struct nd_namespace_index **nsindex,
353 return preamble_index(ndd, ndd->ns_next, nsindex,
400 struct nd_namespace_index *nsindex;
404 if (!preamble_current(ndd, &nsindex, &free, &nslot))
437 struct nd_namespace_index *nsindex;
507 nsindex = to_current_namespace_index(ndd);
508 nd_label_copy(ndd, to_next_namespace_index(ndd), nsindex);
511 offset = __le64_to_cpu(nsindex->labeloff);
512 nslot = __le32_to_cpu(nsindex->nslot);
519 if (test_bit_le(i, nsindex->free)) {
558 struct nd_namespace_index *nsindex;
563 if (!preamble_current(ndd, &nsindex, &free, &nslot))
588 struct nd_namespace_index *nsindex;
592 if (!preamble_current(ndd, &nsindex, &free, &nslot))
611 struct nd_namespace_index *nsindex;
615 if (!preamble_next(ndd, &nsindex, &free, &nslot))
631 struct nd_namespace_index *nsindex;
635 if (!preamble_next(ndd, &nsindex, &free, &nslot))
647 struct nd_namespace_index *nsindex;
653 if (!preamble_next(ndd, &nsindex, &free, &nslot))
662 struct nd_namespace_index *nsindex;
668 nsindex = to_namespace_index(ndd, index);
672 nslot = __le32_to_cpu(nsindex->nslot);
674 memcpy(nsindex->sig, NSINDEX_SIGNATURE, NSINDEX_SIG_LEN);
675 memset(&nsindex->flags, 0, 3);
676 nsindex->labelsize = sizeof_namespace_label(ndd) >> 8;
677 nsindex->seq = __cpu_to_le32(seq);
678 offset = (unsigned long) nsindex
680 nsindex->myoff = __cpu_to_le64(offset);
681 nsindex->mysize = __cpu_to_le64(sizeof_namespace_index(ndd));
685 nsindex->otheroff = __cpu_to_le64(offset);
688 nsindex->labeloff = __cpu_to_le64(offset);
689 nsindex->nslot = __cpu_to_le32(nslot);
690 nsindex->major = __cpu_to_le16(1);
692 nsindex->minor = __cpu_to_le16(1);
694 nsindex->minor = __cpu_to_le16(2);
695 nsindex->checksum = __cpu_to_le64(0);
697 unsigned long *free = (unsigned long *) nsindex->free;
701 memset(nsindex->free, 0xff, nfree / 8);
705 checksum = nd_fletcher64(nsindex, sizeof_namespace_index(ndd), 1);
706 nsindex->checksum = __cpu_to_le64(checksum);
707 rc = nvdimm_set_config_data(ndd, __le64_to_cpu(nsindex->myoff),
708 nsindex, sizeof_namespace_index(ndd));
717 nd_label_copy(ndd, to_current_namespace_index(ndd), nsindex);
881 struct nd_namespace_index *nsindex;
891 if (!preamble_next(ndd, &nsindex, &free, &nslot))
894 cookie = nd_region_interleave_set_cookie(nd_region, nsindex);
948 nd_inc_seq(__le32_to_cpu(nsindex->seq)), 0);
971 struct nd_namespace_index *nsindex;
997 nsindex = to_namespace_index(ndd, 0);
998 memset(nsindex, 0, ndd->nsarea.config_size);
1015 struct nd_namespace_index *nsindex;
1025 if (!preamble_next(ndd, &nsindex, &free, &nslot))
1053 nd_inc_seq(__le32_to_cpu(nsindex->seq)), 0);