Lines Matching refs:bre
27 struct badrange_entry *bre, u64 addr, u64 length) in append_badrange_entry() argument
30 bre->start = addr; in append_badrange_entry()
31 bre->length = length; in append_badrange_entry()
32 list_add_tail(&bre->list, &badrange->list); in append_badrange_entry()
38 struct badrange_entry *bre; in alloc_and_append_badrange_entry() local
40 bre = kzalloc(sizeof(*bre), flags); in alloc_and_append_badrange_entry()
41 if (!bre) in alloc_and_append_badrange_entry()
44 append_badrange_entry(badrange, bre, addr, length); in alloc_and_append_badrange_entry()
50 struct badrange_entry *bre, *bre_new; in add_badrange() local
68 list_for_each_entry(bre, &badrange->list, list) in add_badrange()
69 if (bre->start == addr) { in add_badrange()
71 if (bre->length != length) in add_badrange()
72 bre->length = length; in add_badrange()
106 struct badrange_entry *bre, *next; in badrange_forget() local
118 list_for_each_entry_safe(bre, next, badrange_list, list) { in badrange_forget()
119 u64 bre_end = bre->start + bre->length - 1; in badrange_forget()
124 if (bre->start > clr_end) in badrange_forget()
127 if ((bre->start >= start) && (bre_end <= clr_end)) { in badrange_forget()
128 list_del(&bre->list); in badrange_forget()
129 kfree(bre); in badrange_forget()
133 if ((start <= bre->start) && (clr_end > bre->start)) { in badrange_forget()
134 bre->length -= clr_end - bre->start + 1; in badrange_forget()
135 bre->start = clr_end + 1; in badrange_forget()
139 if ((bre->start < start) && (bre_end <= clr_end)) { in badrange_forget()
141 bre->length = start - bre->start; in badrange_forget()
149 if ((bre->start < start) && (bre_end > clr_end)) { in badrange_forget()
157 bre->length = start - bre->start; in badrange_forget()
216 struct badrange_entry *bre; in badblocks_populate() local
221 list_for_each_entry(bre, &badrange->list, list) { in badblocks_populate()
222 u64 bre_end = bre->start + bre->length - 1; in badblocks_populate()
227 if (bre->start > range->end) in badblocks_populate()
230 if (bre->start >= range->start) { in badblocks_populate()
231 u64 start = bre->start; in badblocks_populate()
235 len = bre->length; in badblocks_populate()
238 - bre->start; in badblocks_populate()
246 if (bre->start < range->start) { in badblocks_populate()
250 len = bre->start + bre->length - range->start; in badblocks_populate()