Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unneeded member drc_err of dmu_recv_cookie_t #10319

Merged
merged 1 commit into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion include/sys/dmu_recv.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ typedef struct dmu_recv_cookie {
struct receive_record_arg *drc_next_rrd;
zio_cksum_t drc_cksum;
zio_cksum_t drc_prev_cksum;
int drc_err;
/* Sorted list of objects not to issue prefetches for. */
objlist_t *drc_ignore_objlist;
} dmu_recv_cookie_t;
Expand Down
12 changes: 5 additions & 7 deletions module/zfs/dmu_recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1217,23 +1217,21 @@ receive_read(dmu_recv_cookie_t *drc, int len, void *buf)

while (done < len) {
ssize_t resid;
zfs_file_t *fp;

fp = drc->drc_fp;
drc->drc_err = zfs_file_read(fp, (char *)buf + done,
zfs_file_t *fp = drc->drc_fp;
int err = zfs_file_read(fp, (char *)buf + done,
len - done, &resid);
if (resid == len - done) {
/*
* Note: ECKSUM or ZFS_ERR_STREAM_TRUNCATED indicates
* that the receive was interrupted and can
* 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;
done = len - resid;
if (drc->drc_err != 0)
return (drc->drc_err);
if (err != 0)
return (err);
}

drc->drc_bytes_read += len;
Expand Down