summaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2020-05-14 12:10:29 -0700
committerGitHub <[email protected]>2020-05-14 12:10:29 -0700
commit8b240f14f93822129ab9fb0674fc27f6353b0a2d (patch)
treeb1e5b36fd26ff0b2e1e571d239a7c2a33ce421fe /module/zfs
parentc87f9586687d53bc7c3f2e8887841267a3960269 (diff)
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 <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #10319
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/dmu_recv.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/module/zfs/dmu_recv.c b/module/zfs/dmu_recv.c
index aaeaa4c34..ed52b25e6 100644
--- a/module/zfs/dmu_recv.c
+++ b/module/zfs/dmu_recv.c
@@ -1217,10 +1217,8 @@ 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) {
/*
@@ -1228,12 +1226,12 @@ receive_read(dmu_recv_cookie_t *drc, int len, void *buf)
* 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;