Lines Matching refs:sp2d

72 	struct __stripe_pages_2d *sp2d;  in _sp2d_alloc()  local
76 struct __stripe_pages_2d sp2d; in _sp2d_alloc() member
108 sp2d = &_aab->__asp2d.sp2d; in _sp2d_alloc()
109 *psp2d = sp2d; /* From here Just call _sp2d_free */ in _sp2d_alloc()
127 sp2d->_1p_stripes[i].alloc = true; in _sp2d_alloc()
130 sp2d->_1p_stripes[i].pages = __a1pa->pages; in _sp2d_alloc()
131 sp2d->_1p_stripes[i].scribble = __a1pa->scribble ; in _sp2d_alloc()
132 sp2d->_1p_stripes[i].page_is_read = __a1pa->page_is_read; in _sp2d_alloc()
136 sp2d->parity = parity; in _sp2d_alloc()
137 sp2d->data_devs = data_devs; in _sp2d_alloc()
138 sp2d->pages_in_unit = pages_in_unit; in _sp2d_alloc()
142 static void _sp2d_reset(struct __stripe_pages_2d *sp2d, in _sp2d_reset() argument
145 unsigned data_devs = sp2d->data_devs; in _sp2d_reset()
146 unsigned group_width = data_devs + sp2d->parity; in _sp2d_reset()
149 if (!sp2d->needed) in _sp2d_reset()
152 for (p = 0; p < sp2d->pages_in_unit; p++) { in _sp2d_reset()
153 struct __1_page_stripe *_1ps = &sp2d->_1p_stripes[p]; in _sp2d_reset()
172 sp2d->needed = false; in _sp2d_reset()
175 static void _sp2d_free(struct __stripe_pages_2d *sp2d) in _sp2d_free() argument
179 if (!sp2d) in _sp2d_free()
182 for (i = 0; i < sp2d->pages_in_unit; ++i) { in _sp2d_free()
183 if (sp2d->_1p_stripes[i].alloc) in _sp2d_free()
184 kfree(sp2d->_1p_stripes[i].pages); in _sp2d_free()
187 kfree(sp2d); in _sp2d_free()
190 static unsigned _sp2d_min_pg(struct __stripe_pages_2d *sp2d) in _sp2d_min_pg() argument
194 for (p = 0; p < sp2d->pages_in_unit; p++) { in _sp2d_min_pg()
195 struct __1_page_stripe *_1ps = &sp2d->_1p_stripes[p]; in _sp2d_min_pg()
204 static unsigned _sp2d_max_pg(struct __stripe_pages_2d *sp2d) in _sp2d_max_pg() argument
208 for (p = sp2d->pages_in_unit - 1; p >= 0; --p) { in _sp2d_max_pg()
209 struct __1_page_stripe *_1ps = &sp2d->_1p_stripes[p]; in _sp2d_max_pg()
218 static void _gen_xor_unit(struct __stripe_pages_2d *sp2d) in _gen_xor_unit() argument
221 for (p = 0; p < sp2d->pages_in_unit; p++) { in _gen_xor_unit()
222 struct __1_page_stripe *_1ps = &sp2d->_1p_stripes[p]; in _gen_xor_unit()
234 _1ps->tx = async_xor(_1ps->pages[sp2d->data_devs], _1ps->pages, in _gen_xor_unit()
235 0, sp2d->data_devs, PAGE_SIZE, in _gen_xor_unit()
239 for (p = 0; p < sp2d->pages_in_unit; p++) { in _gen_xor_unit()
240 struct __1_page_stripe *_1ps = &sp2d->_1p_stripes[p]; in _gen_xor_unit()
249 void _ore_add_stripe_page(struct __stripe_pages_2d *sp2d, in _ore_add_stripe_page() argument
254 sp2d->needed = true; in _ore_add_stripe_page()
256 _1ps = &sp2d->_1p_stripes[si->cur_pg]; in _ore_add_stripe_page()
260 si->cur_pg = (si->cur_pg + 1) % sp2d->pages_in_unit; in _ore_add_stripe_page()
320 unsigned sgs_per_dev = ios->sp2d->pages_in_unit + 2; in _alloc_read_4_write()
355 ios->sp2d->pages_in_unit); in _add_to_r4w()
358 ios->sp2d->pages_in_unit); in _add_to_r4w()
410 page = ios->sp2d->_1p_stripes[p].pages[c]; in _add_to_r4w_last_page()
467 struct __stripe_pages_2d *sp2d = ios->sp2d; in _read_4_write_first_stripe() local
469 unsigned c, p, min_p = sp2d->pages_in_unit, max_p = -1; in _read_4_write_first_stripe()
474 min_p = _sp2d_min_pg(sp2d); in _read_4_write_first_stripe()
475 max_p = _sp2d_max_pg(sp2d); in _read_4_write_first_stripe()
485 struct __1_page_stripe *_1ps = &sp2d->_1p_stripes[p]; in _read_4_write_first_stripe()
510 offset += (sp2d->pages_in_unit - p) * PAGE_SIZE; in _read_4_write_first_stripe()
520 struct __stripe_pages_2d *sp2d = ios->sp2d; in _read_4_write_last_stripe() local
524 unsigned c, p, min_p = sp2d->pages_in_unit, max_p = -1; in _read_4_write_last_stripe()
541 if (min_p == sp2d->pages_in_unit) { in _read_4_write_last_stripe()
543 min_p = _sp2d_min_pg(sp2d); in _read_4_write_last_stripe()
544 max_p = _sp2d_max_pg(sp2d); in _read_4_write_last_stripe()
551 struct __1_page_stripe *_1ps = &sp2d->_1p_stripes[p]; in _read_4_write_last_stripe()
571 if (p == (sp2d->pages_in_unit - 1)) { in _read_4_write_last_stripe()
633 struct __stripe_pages_2d *sp2d = ios->sp2d; in _ore_add_parity_unit() local
640 si->cur_pg = _sp2d_min_pg(sp2d); in _ore_add_parity_unit()
641 num_pages = _sp2d_max_pg(sp2d) + 1 - si->cur_pg; in _ore_add_parity_unit()
644 si->cur_comp = sp2d->data_devs; in _ore_add_parity_unit()
665 BUG_ON(si->cur_comp != sp2d->data_devs); in _ore_add_parity_unit()
666 BUG_ON(si->cur_pg + num_pages > sp2d->pages_in_unit); in _ore_add_parity_unit()
674 _gen_xor_unit(sp2d); in _ore_add_parity_unit()
675 _sp2d_reset(sp2d, ios->r4w, ios->private); in _ore_add_parity_unit()
687 layout->parity, &ios->sp2d)) { in _ore_post_alloc_raid_stuff()
696 if (ios->sp2d) { /* writing and raid */ in _ore_free_raid_stuff()
708 _sp2d_reset(ios->sp2d, ios->r4w, ios->private); in _ore_free_raid_stuff()
709 _sp2d_free(ios->sp2d); in _ore_free_raid_stuff()