Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269235
b: refs/heads/master
c: 4b46c9f
h: refs/heads/master
i:
  269233: e1ab3f4
  269231: f5bc087
v: v3
  • Loading branch information
Boaz Harrosh committed Oct 14, 2011
1 parent 04ed9d7 commit 612baed
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5a51c0c7e9a913649aa65d8233470682bcbb7694
refs/heads/master: 4b46c9f5cf69505f0bc708995b88b0cc60317ffd
14 changes: 4 additions & 10 deletions trunk/fs/exofs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,19 +194,16 @@ static void update_write_page(struct page *page, int ret)
static int __readpages_done(struct page_collect *pcol)
{
int i;
u64 resid;
u64 good_bytes;
u64 length = 0;
int ret = ore_check_io(pcol->ios, &resid);
int ret = ore_check_io(pcol->ios, NULL);

if (likely(!ret)) {
good_bytes = pcol->length;
ret = PAGE_WAS_NOT_IN_IO;
} else {
good_bytes = pcol->length - resid;
good_bytes = 0;
}
if (good_bytes > pcol->ios->length)
good_bytes = pcol->ios->length;

EXOFS_DBGMSG2("readpages_done(0x%lx) good_bytes=0x%llx"
" length=0x%lx nr_pages=%u\n",
Expand Down Expand Up @@ -519,21 +516,18 @@ static void writepages_done(struct ore_io_state *ios, void *p)
{
struct page_collect *pcol = p;
int i;
u64 resid;
u64 good_bytes;
u64 length = 0;
int ret = ore_check_io(ios, &resid);
int ret = ore_check_io(ios, NULL);

atomic_dec(&pcol->sbi->s_curr_pending);

if (likely(!ret)) {
good_bytes = pcol->length;
ret = PAGE_WAS_NOT_IN_IO;
} else {
good_bytes = pcol->length - resid;
good_bytes = 0;
}
if (good_bytes > pcol->ios->length)
good_bytes = pcol->ios->length;

EXOFS_DBGMSG2("writepages_done(0x%lx) good_bytes=0x%llx"
" length=0x%lx nr_pages=%u\n",
Expand Down
29 changes: 16 additions & 13 deletions trunk/fs/exofs/ore.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,16 @@ static void _clear_bio(struct bio *bio)
}
}

int ore_check_io(struct ore_io_state *ios, u64 *resid)
int ore_check_io(struct ore_io_state *ios, ore_on_dev_error on_dev_error)
{
enum osd_err_priority acumulated_osd_err = 0;
int acumulated_lin_err = 0;
int i;

for (i = 0; i < ios->numdevs; i++) {
struct osd_sense_info osi;
struct osd_request *or = ios->per_dev[i].or;
struct ore_per_dev_state *per_dev = &ios->per_dev[i];
struct osd_request *or = per_dev->or;
int ret;

if (unlikely(!or))
Expand All @@ -337,29 +338,31 @@ int ore_check_io(struct ore_io_state *ios, u64 *resid)

if (OSD_ERR_PRI_CLEAR_PAGES == osi.osd_err_pri) {
/* start read offset passed endof file */
_clear_bio(ios->per_dev[i].bio);
_clear_bio(per_dev->bio);
ORE_DBGMSG("start read offset passed end of file "
"offset=0x%llx, length=0x%llx\n",
_LLU(ios->per_dev[i].offset),
_LLU(ios->per_dev[i].length));
_LLU(per_dev->offset),
_LLU(per_dev->length));

continue; /* we recovered */
}

if (on_dev_error) {
u64 residual = ios->reading ?
or->in.residual : or->out.residual;
u64 offset = (ios->offset + ios->length) - residual;
struct ore_dev *od = ios->oc->ods[
per_dev->dev - ios->oc->first_dev];

on_dev_error(ios, od, per_dev->dev, osi.osd_err_pri,
offset, residual);
}
if (osi.osd_err_pri >= acumulated_osd_err) {
acumulated_osd_err = osi.osd_err_pri;
acumulated_lin_err = ret;
}
}

/* TODO: raid specific residual calculations */
if (resid) {
if (likely(!acumulated_lin_err))
*resid = 0;
else
*resid = ios->length;
}

return acumulated_lin_err;
}
EXPORT_SYMBOL(ore_check_io);
Expand Down
5 changes: 4 additions & 1 deletion trunk/include/scsi/osd_ore.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ int ore_get_io_state(struct ore_layout *layout, struct ore_components *comps,
struct ore_io_state **ios);
void ore_put_io_state(struct ore_io_state *ios);

int ore_check_io(struct ore_io_state *ios, u64 *resid);
typedef void (*ore_on_dev_error)(struct ore_io_state *ios, struct ore_dev *od,
unsigned dev_index, enum osd_err_priority oep,
u64 dev_offset, u64 dev_len);
int ore_check_io(struct ore_io_state *ios, ore_on_dev_error rep);

int ore_create(struct ore_io_state *ios);
int ore_remove(struct ore_io_state *ios);
Expand Down

0 comments on commit 612baed

Please sign in to comment.