From: Andrew Deason Date: Wed, 1 Aug 2018 23:38:51 +0000 (-0500) Subject: DARWIN: Use tb->code_raw for BOP_MOVE X-Git-Tag: openafs-devel-1_9_0~294 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=34fd532e35b6f373304effaa16c9c65062b12cd9 DARWIN: Use tb->code_raw for BOP_MOVE Currently, BOP_MOVE communicates its error code to the requestor via the 'retval' field in struct afs_uspc_param, and we assume ptr_parm[0] of the given brequest is for a struct afs_uspc_param. But this is unnecessary, since struct brequest already has fields for error codes; namely, code_raw and code_checkcode. To avoid afs_BackgroundDaemon needing to interpret ptr_parm[0] in this way (and assuming the type of the pointer's target), change BOP_MOVE to just use the code_raw field for error codes, instead of interpreting ptr_parm[0]. This makes it easier to add more AFS_NEW_BKG background operations that do not pass a struct afs_uspc_param in the brequest parameters. Change-Id: I90a564468862142777159fbb78234744840b59fb Reviewed-on: https://gerrit.openafs.org/13280 Reviewed-by: Mark Vitale Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- diff --git a/src/afs/DARWIN/osi_vnodeops.c b/src/afs/DARWIN/osi_vnodeops.c index 28c0e0a..a32ae29 100644 --- a/src/afs/DARWIN/osi_vnodeops.c +++ b/src/afs/DARWIN/osi_vnodeops.c @@ -1535,7 +1535,7 @@ afs_vop_rename(ap) afs_osi_Sleep(tb); } /* if we succeeded, clear the error. otherwise, EXDEV */ - if (mvReq.retval == 0) + if (tb->code_raw == 0) error = 0; afs_BRelease(tb); diff --git a/src/afs/afs_daemons.c b/src/afs/afs_daemons.c index 3d42b3c..861c93f 100644 --- a/src/afs/afs_daemons.c +++ b/src/afs/afs_daemons.c @@ -1012,8 +1012,7 @@ afs_BackgroundDaemon(void) for (i = 0; i < NBRS; i++, tb++) { if (tb->ts == uspc->ts) { /* copy the userspace status back in */ - ((struct afs_uspc_param *) tb->ptr_parm[0])->retval = - uspc->retval; + tb->code_raw = tb->code_checkcode = uspc->retval; /* mark it valid and notify our caller */ tb->flags |= BUVALID; if (tb->flags & BUWAIT) {