Skip to content

Commit 6851a5e

Browse files
author
Boaz Harrosh
committed
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>
1 parent 9826075 commit 6851a5e

1 file changed

Lines changed: 13 additions & 23 deletions

File tree

‎fs/exofs/ore.c‎

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -427,17 +427,6 @@ static int _prepare_for_striping(struct ore_io_state *ios)
427427
int ret = 0;
428428

429429
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-
}
441430
ios->numdevs = ios->layout->mirrors_p1;
442431
return 0;
443432
}
@@ -557,7 +546,6 @@ static int _write_mirror(struct ore_io_state *ios, int cur_comp)
557546
goto out;
558547
}
559548
per_dev->or = or;
560-
per_dev->offset = master_dev->offset;
561549

562550
if (ios->pages) {
563551
struct bio *bio;
@@ -576,6 +564,7 @@ static int _write_mirror(struct ore_io_state *ios, int cur_comp)
576564
__bio_clone(bio, master_dev->bio);
577565
bio->bi_bdev = NULL;
578566
bio->bi_next = NULL;
567+
per_dev->offset = master_dev->offset;
579568
per_dev->length = master_dev->length;
580569
per_dev->bio = bio;
581570
per_dev->dev = dev;
@@ -593,7 +582,15 @@ static int _write_mirror(struct ore_io_state *ios, int cur_comp)
593582
_LLU(per_dev->offset),
594583
_LLU(per_dev->length), dev);
595584
} 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),
597594
per_dev->offset,
598595
ios->kern_buff, ios->length);
599596
if (unlikely(ret))
@@ -602,7 +599,7 @@ static int _write_mirror(struct ore_io_state *ios, int cur_comp)
602599
"length=0x%llx dev=%d\n",
603600
_LLU(_ios_obj(ios, dev)->id),
604601
_LLU(per_dev->offset),
605-
_LLU(ios->length), dev);
602+
_LLU(ios->length), per_dev->dev);
606603
} else {
607604
osd_req_set_attributes(or, _ios_obj(ios, dev));
608605
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)
668665
" dev=%d\n", _LLU(obj->id),
669666
_LLU(per_dev->offset), _LLU(per_dev->length),
670667
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;
680668
} else {
669+
BUG_ON(ios->kern_buff);
670+
681671
osd_req_get_attributes(or, obj);
682672
ORE_DBGMSG2("obj(0x%llx) get_attributes=%d dev=%d\n",
683673
_LLU(obj->id),

0 commit comments

Comments
 (0)