aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2011-10-31 18:16:15 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-11-02 23:56:08 -0400
commit04291b628c450ab6fdb606836585f16336662a4e (patch)
tree2b0e17d8e774c9188437fd04cc97a2bc50312bab
parenteecfc6312a24e6d0d2883de0a9a6ccf8e993f472 (diff)
pnfs-obj: move to ore 03: Remove old raid engine
Finally remove all the old raid engine, which is by now dead code. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/objlayout/objio_osd.c504
1 files changed, 0 insertions, 504 deletions
diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c
index 00b384934c32..3161da654a9b 100644
--- a/fs/nfs/objlayout/objio_osd.c
+++ b/fs/nfs/objlayout/objio_osd.c
@@ -188,48 +188,6 @@ out:
188 return err; 188 return err;
189} 189}
190 190
191#if 0
192static int _verify_data_map(struct pnfs_osd_layout *layout)
193{
194 struct pnfs_osd_data_map *data_map = &layout->olo_map;
195 u64 stripe_length;
196 u32 group_width;
197
198/* FIXME: Only raid0 for now. if not go through MDS */
199 if (data_map->odm_raid_algorithm != PNFS_OSD_RAID_0) {
200 printk(KERN_ERR "Only RAID_0 for now\n");
201 return -ENOTSUPP;
202 }
203 if (0 != (data_map->odm_num_comps % (data_map->odm_mirror_cnt + 1))) {
204 printk(KERN_ERR "Data Map wrong, num_comps=%u mirrors=%u\n",
205 data_map->odm_num_comps, data_map->odm_mirror_cnt);
206 return -EINVAL;
207 }
208
209 if (data_map->odm_group_width)
210 group_width = data_map->odm_group_width;
211 else
212 group_width = data_map->odm_num_comps /
213 (data_map->odm_mirror_cnt + 1);
214
215 stripe_length = (u64)data_map->odm_stripe_unit * group_width;
216 if (stripe_length >= (1ULL << 32)) {
217 printk(KERN_ERR "Total Stripe length(0x%llx)"
218 " >= 32bit is not supported\n", _LLU(stripe_length));
219 return -ENOTSUPP;
220 }
221
222 if (0 != (data_map->odm_stripe_unit & ~PAGE_MASK)) {
223 printk(KERN_ERR "Stripe Unit(0x%llx)"
224 " must be Multples of PAGE_SIZE(0x%lx)\n",
225 _LLU(data_map->odm_stripe_unit), PAGE_SIZE);
226 return -ENOTSUPP;
227 }
228
229 return 0;
230}
231#endif
232
233static void copy_single_comp(struct ore_components *oc, unsigned c, 191static void copy_single_comp(struct ore_components *oc, unsigned c,
234 struct pnfs_osd_object_cred *src_comp) 192 struct pnfs_osd_object_cred *src_comp)
235{ 193{
@@ -441,327 +399,6 @@ static void __on_dev_error(struct ore_io_state *ios,
441 dev_offset, dev_len, !ios->reading); 399 dev_offset, dev_len, !ios->reading);
442} 400}
443 401
444#if 0
445static void _clear_bio(struct bio *bio)
446{
447 struct bio_vec *bv;
448 unsigned i;
449
450 __bio_for_each_segment(bv, bio, i, 0) {
451 unsigned this_count = bv->bv_len;
452
453 if (likely(PAGE_SIZE == this_count))
454 clear_highpage(bv->bv_page);
455 else
456 zero_user(bv->bv_page, bv->bv_offset, this_count);
457 }
458}
459
460static int _io_check(struct objio_state *ios, bool is_write)
461{
462 enum osd_err_priority oep = OSD_ERR_PRI_NO_ERROR;
463 int lin_ret = 0;
464 int i;
465
466 for (i = 0; i < ios->numdevs; i++) {
467 struct osd_sense_info osi;
468 struct osd_request *or = ios->per_dev[i].or;
469 int ret;
470
471 if (!or)
472 continue;
473
474 ret = osd_req_decode_sense(or, &osi);
475 if (likely(!ret))
476 continue;
477
478 if (OSD_ERR_PRI_CLEAR_PAGES == osi.osd_err_pri) {
479 /* start read offset passed endof file */
480 BUG_ON(is_write);
481 _clear_bio(ios->per_dev[i].bio);
482 dprintk("%s: start read offset passed end of file "
483 "offset=0x%llx, length=0x%lx\n", __func__,
484 _LLU(ios->per_dev[i].offset),
485 ios->per_dev[i].length);
486
487 continue; /* we recovered */
488 }
489 __on_dev_error(ios, is_write, ios->oc->ods[i],
490 ios->per_dev[i].dev, osi.osd_err_pri,
491 ios->per_dev[i].offset, ios->per_dev[i].length);
492
493 if (osi.osd_err_pri >= oep) {
494 oep = osi.osd_err_pri;
495 lin_ret = ret;
496 }
497 }
498
499 return lin_ret;
500}
501
502/*
503 * Common IO state helpers.
504 */
505static void _io_free(struct objio_state *ios)
506{
507 unsigned i;
508
509 for (i = 0; i < ios->numdevs; i++) {
510 struct _objio_per_comp *per_dev = &ios->per_dev[i];
511
512 if (per_dev->or) {
513 osd_end_request(per_dev->or);
514 per_dev->or = NULL;
515 }
516
517 if (per_dev->bio) {
518 bio_put(per_dev->bio);
519 per_dev->bio = NULL;
520 }
521 }
522}
523
524struct osd_dev *_io_od(struct objio_state *ios, unsigned dev)
525{
526 unsigned min_dev = ios->oc->first_dev;
527 unsigned max_dev = min_dev + ios->oc->numdevs;
528
529 BUG_ON(dev < min_dev || max_dev <= dev);
530 return ios->oc->ods[dev - min_dev]->od;
531}
532
533struct _striping_info {
534 u64 obj_offset;
535 u64 group_length;
536 unsigned dev;
537 unsigned unit_off;
538};
539
540static void _calc_stripe_info(struct objio_state *ios, u64 file_offset,
541 struct _striping_info *si)
542{
543 u32 stripe_unit = ios->layout->stripe_unit;
544 u32 group_width = ios->layout->group_width;
545 u64 group_depth = ios->layout->group_depth;
546 u32 U = stripe_unit * group_width;
547
548 u64 T = U * group_depth;
549 u64 S = T * ios->layout->group_count;
550 u64 M = div64_u64(file_offset, S);
551
552 /*
553 G = (L - (M * S)) / T
554 H = (L - (M * S)) % T
555 */
556 u64 LmodU = file_offset - M * S;
557 u32 G = div64_u64(LmodU, T);
558 u64 H = LmodU - G * T;
559
560 u32 N = div_u64(H, U);
561
562 div_u64_rem(file_offset, stripe_unit, &si->unit_off);
563 si->obj_offset = si->unit_off + (N * stripe_unit) +
564 (M * group_depth * stripe_unit);
565
566 /* "H - (N * U)" is just "H % U" so it's bound to u32 */
567 si->dev = (u32)(H - (N * U)) / stripe_unit + G * group_width;
568 si->dev *= ios->layout->mirrors_p1;
569
570 si->group_length = T - H;
571}
572
573static int _add_stripe_unit(struct objio_state *ios, unsigned *cur_pg,
574 unsigned pgbase, struct _objio_per_comp *per_dev, int len,
575 gfp_t gfp_flags)
576{
577 unsigned pg = *cur_pg;
578 int cur_len = len;
579 struct request_queue *q =
580 osd_request_queue(_io_od(ios, per_dev->dev));
581
582 if (per_dev->bio == NULL) {
583 unsigned pages_in_stripe = ios-&