remove unneeded member drc_err of dmu_recv_cookie_t
The member drc_err of dmu_recv_cookie_t is used only locally in receive_read, so we can replace it with a local variable. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Matthew Ahrens <mahrens@delphix.com> Closes #10319
This commit is contained in:
parent
c87f958668
commit
8b240f14f9
|
@ -73,7 +73,6 @@ typedef struct dmu_recv_cookie {
|
||||||
struct receive_record_arg *drc_next_rrd;
|
struct receive_record_arg *drc_next_rrd;
|
||||||
zio_cksum_t drc_cksum;
|
zio_cksum_t drc_cksum;
|
||||||
zio_cksum_t drc_prev_cksum;
|
zio_cksum_t drc_prev_cksum;
|
||||||
int drc_err;
|
|
||||||
/* Sorted list of objects not to issue prefetches for. */
|
/* Sorted list of objects not to issue prefetches for. */
|
||||||
objlist_t *drc_ignore_objlist;
|
objlist_t *drc_ignore_objlist;
|
||||||
} dmu_recv_cookie_t;
|
} dmu_recv_cookie_t;
|
||||||
|
|
|
@ -1217,10 +1217,8 @@ receive_read(dmu_recv_cookie_t *drc, int len, void *buf)
|
||||||
|
|
||||||
while (done < len) {
|
while (done < len) {
|
||||||
ssize_t resid;
|
ssize_t resid;
|
||||||
zfs_file_t *fp;
|
zfs_file_t *fp = drc->drc_fp;
|
||||||
|
int err = zfs_file_read(fp, (char *)buf + done,
|
||||||
fp = drc->drc_fp;
|
|
||||||
drc->drc_err = zfs_file_read(fp, (char *)buf + done,
|
|
||||||
len - done, &resid);
|
len - done, &resid);
|
||||||
if (resid == len - done) {
|
if (resid == len - done) {
|
||||||
/*
|
/*
|
||||||
|
@ -1228,12 +1226,12 @@ receive_read(dmu_recv_cookie_t *drc, int len, void *buf)
|
||||||
* that the receive was interrupted and can
|
* that the receive was interrupted and can
|
||||||
* potentially be resumed.
|
* potentially be resumed.
|
||||||
*/
|
*/
|
||||||
drc->drc_err = SET_ERROR(ZFS_ERR_STREAM_TRUNCATED);
|
err = SET_ERROR(ZFS_ERR_STREAM_TRUNCATED);
|
||||||
}
|
}
|
||||||
drc->drc_voff += len - done - resid;
|
drc->drc_voff += len - done - resid;
|
||||||
done = len - resid;
|
done = len - resid;
|
||||||
if (drc->drc_err != 0)
|
if (err != 0)
|
||||||
return (drc->drc_err);
|
return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
drc->drc_bytes_read += len;
|
drc->drc_bytes_read += len;
|
||||||
|
|
Loading…
Reference in New Issue