r=shaver
Change the read_record and write_record APIs to return 0 on success
and a negative error. Any short read/write is reported as -EIO.
It used to return the number of bytes completed, which meant that the
error checking code had to be duplicated everywhere. A short I/O in
either of these functions is always a failure.
(As a nice side effect, one of the orphan functions got this wrong, so
this gets us somewhat closer to having that infrastructure)
memcpy(buf, bh->b_data + boffs, size);
brelse(bh);
*offs += size;
- return size;
+ return 0;
}
static int fsfilt_ext3_write_record(struct file *file, void *buf, int size,
CERROR("journal_dirty_metadata() returned error %d\n", err);
goto out;
}
- err = size;
if (force_sync)
handle->h_sync = 1; /* recovery likes this */
if (bh)
brelse(bh);
journal_stop(handle);
- if (err > 0)
+ if (err == 0)
*offs += size;
return err;
}