aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exofs
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2011-08-24 21:10:49 -0400
committerBoaz Harrosh <bharrosh@panasas.com>2011-10-14 12:53:55 -0400
commit6851a5e5c12b35f8bb8986d0ff16ca9be4cf2c09 (patch)
tree7c9a96e87d7789a830512240473e30ffc671a386 /fs/exofs
parent98260754046eee4cc7d75751a4a20182ade39f58 (diff)
ore: Remove check for ios->kern_buff in _prepare_for_striping to later
Move the check and preparation of the ios->kern_buff case to later inside _write_mirror(). Since read was never used with ios->kern_buff its support is removed instead of fixed. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Diffstat (limited to 'fs/exofs')
-rw-r--r--fs/exofs/ore.c36
1 files changed, 13 insertions, 23 deletions
diff --git a/fs/exofs/ore.c b/fs/exofs/ore.c
index 7e02d33b5e5c..d0f8db5e46c5 100644
--- a/fs/exofs/ore.c
+++ b/fs/exofs/ore.c
@@ -427,17 +427,6 @@ static int _prepare_for_striping(struct ore_io_state *ios)
427 int ret = 0; 427 int ret = 0;
428 428
429 if (!ios->pages) { 429 if (!ios->pages) {
430 if (ios->kern_buff) {
431 struct ore_per_dev_state *per_dev = &ios->per_dev[0];
432
433 per_dev->offset = si->obj_offset;
434 per_dev->dev = si->dev;
435
436 /* no cross device without page array */
437 BUG_ON((ios->layout->group_width > 1) &&
438 (si->unit_off + ios->length >
439 ios->layout->stripe_unit));
440 }
441 ios->numdevs = ios->layout->mirrors_p1; 430 ios->numdevs = ios->layout->mirrors_p1;
442 return 0; 431 return 0;
443 } 432 }
@@ -557,7 +546,6 @@ static int _write_mirror(struct ore_io_state *ios, int cur_comp)
557 goto out; 546 goto out;
558 } 547 }
559 per_dev->or = or; 548 per_dev->or = or;
560 per_dev->offset = master_dev->offset;
561 549
562 if (ios->pages) { 550 if (ios->pages) {
563 struct bio *bio; 551 struct bio *bio;
@@ -576,6 +564,7 @@ static int _write_mirror(struct ore_io_state *ios, int cur_comp)
576 __bio_clone(bio, master_dev->bio); 564 __bio_clone(bio, master_dev->bio);
577 bio->bi_bdev = NULL; 565 bio->bi_bdev = NULL;
578 bio->bi_next = NULL; 566 bio->bi_next = NULL;
567 per_dev->offset = master_dev->offset;
579 per_dev->length = master_dev->length; 568 per_dev->length = master_dev->length;
580 per_dev->bio = bio; 569 per_dev->bio = bio;
581 per_dev->dev = dev; 570 per_dev->dev = dev;
@@ -593,7 +582,15 @@ static int _write_mirror(struct ore_io_state *ios, int cur_comp)
593 _LLU(per_dev->offset), 582 _LLU(per_dev->offset),
594 _LLU(per_dev->length), dev); 583 _LLU(per_dev->length), dev);
595 } else if (ios->kern_buff) { 584 } else if (ios->kern_buff) {
596 ret = osd_req_write_kern(or, _ios_obj(ios, dev), 585 per_dev->offset = ios->si.obj_offset;
586 per_dev->dev = ios->si.dev + dev;
587
588 /* no cross device without page array */
589 BUG_ON((ios->layout->group_width > 1) &&
590 (ios->si.unit_off + ios->length >
591 ios->layout->stripe_unit));
592
593 ret = osd_req_write_kern(or, _ios_obj(ios, per_dev->dev),
597 per_dev->offset, 594 per_dev->offset,
598 ios->kern_buff, ios->length); 595 ios->kern_buff, ios->length);
599 if (unlikely(ret)) 596 if (unlikely(ret))
@@ -602,7 +599,7 @@ static int _write_mirror(struct ore_io_state *ios, int cur_comp)
602 "length=0x%llx dev=%d\n", 599 "length=0x%llx dev=%d\n",
603 _LLU(_ios_obj(ios, dev)->id), 600 _LLU(_ios_obj(ios, dev)->id),
604 _LLU(per_dev->offset), 601 _LLU(per_dev->offset),
605 _LLU(ios->length), dev); 602 _LLU(ios->length), per_dev->dev);
606 } else { 603 } else {
607 osd_req_set_attributes(or, _ios_obj(ios, dev)); 604 osd_req_set_attributes(or, _ios_obj(ios, dev));
608 ORE_DBGMSG2("obj(0x%llx) set_attributes=%d dev=%d\n", 605 ORE_DBGMSG2("obj(0x%llx) set_attributes=%d dev=%d\n",
@@ -668,16 +665,9 @@ static int _read_mirror(struct ore_io_state *ios, unsigned cur_comp)
668 " dev=%d\n", _LLU(obj->id), 665 " dev=%d\n", _LLU(obj->id),
669 _LLU(per_dev->offset), _LLU(per_dev->length), 666 _LLU(per_dev->offset), _LLU(per_dev->length),
670 first_dev); 667 first_dev);
671 } else if (ios->kern_buff) {
672 int ret = osd_req_read_kern(or, obj, per_dev->offset,
673 ios->kern_buff, ios->length);
674 ORE_DBGMSG2("read_kern(0x%llx) offset=0x%llx "
675 "length=0x%llx dev=%d ret=>%d\n",
676 _LLU(obj->id), _LLU(per_dev->offset),
677 _LLU(ios->length), first_dev, ret);
678 if (unlikely(ret))
679 return ret;
680 } else { 668 } else {
669 BUG_ON(ios->kern_buff);
670
681 osd_req_get_attributes(or, obj); 671 osd_req_get_attributes(or, obj);
682 ORE_DBGMSG2("obj(0x%llx) get_attributes=%d dev=%d\n", 672 ORE_DBGMSG2("obj(0x%llx) get_attributes=%d dev=%d\n",
683 _LLU(obj->id), 673 _LLU(obj->id),