Lines Matching full:nr

25 	unsigned nr;  in bch2_sb_journal_validate()  local
29 nr = bch2_nr_journal_buckets(journal); in bch2_sb_journal_validate()
30 if (!nr) in bch2_sb_journal_validate()
33 b = kmalloc_array(nr, sizeof(u64), GFP_KERNEL); in bch2_sb_journal_validate()
37 for (i = 0; i < nr; i++) in bch2_sb_journal_validate()
40 sort(b, nr, sizeof(u64), u64_cmp, NULL); in bch2_sb_journal_validate()
53 if (b[nr - 1] >= le64_to_cpu(m.nbuckets)) { in bch2_sb_journal_validate()
55 b[nr - 1], le64_to_cpu(m.nbuckets)); in bch2_sb_journal_validate()
59 for (i = 0; i + 1 < nr; i++) in bch2_sb_journal_validate()
75 unsigned i, nr = bch2_nr_journal_buckets(journal); in bch2_sb_journal_to_text() local
78 for (i = 0; i < nr; i++) in bch2_sb_journal_to_text()
108 unsigned nr; in bch2_sb_journal_v2_validate() local
112 nr = bch2_sb_field_journal_v2_nr_entries(journal); in bch2_sb_journal_v2_validate()
113 if (!nr) in bch2_sb_journal_v2_validate()
116 b = kmalloc_array(nr, sizeof(*b), GFP_KERNEL); in bch2_sb_journal_v2_validate()
120 for (i = 0; i < nr; i++) { in bch2_sb_journal_v2_validate()
122 b[i].end = b[i].start + le64_to_cpu(journal->d[i].nr); in bch2_sb_journal_v2_validate()
125 prt_printf(err, "journal buckets entry with bad nr: %llu+%llu", in bch2_sb_journal_v2_validate()
127 le64_to_cpu(journal->d[i].nr)); in bch2_sb_journal_v2_validate()
131 sum += le64_to_cpu(journal->d[i].nr); in bch2_sb_journal_v2_validate()
134 sort(b, nr, sizeof(*b), u64_range_cmp, NULL); in bch2_sb_journal_v2_validate()
147 if (b[nr - 1].end > le64_to_cpu(m.nbuckets)) { in bch2_sb_journal_v2_validate()
149 b[nr - 1].end - 1, le64_to_cpu(m.nbuckets)); in bch2_sb_journal_v2_validate()
153 for (i = 0; i + 1 < nr; i++) { in bch2_sb_journal_v2_validate()
176 unsigned i, nr = bch2_sb_field_journal_v2_nr_entries(journal); in bch2_sb_journal_v2_to_text() local
179 for (i = 0; i < nr; i++) in bch2_sb_journal_v2_to_text()
182 le64_to_cpu(journal->d[i].start) + le64_to_cpu(journal->d[i].nr)); in bch2_sb_journal_v2_to_text()
192 u64 *buckets, unsigned nr) in bch2_journal_buckets_to_sb() argument
200 if (!nr) { in bch2_journal_buckets_to_sb()
206 for (i = 0; i + 1 < nr; i++) in bch2_journal_buckets_to_sb()
218 j->d[dst].nr = cpu_to_le64(1); in bch2_journal_buckets_to_sb()
220 for (i = 1; i < nr; i++) { in bch2_journal_buckets_to_sb()
222 le64_add_cpu(&j->d[dst].nr, 1); in bch2_journal_buckets_to_sb()
226 j->d[dst].nr = cpu_to_le64(1); in bch2_journal_buckets_to_sb()