mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 23:40:13 +00:00
Windows: use lock conversion in cm_EndDirOp
Instead of dropping the lock for read and reacquiring for write use lock_ConvertRToW() which will make the change atomicly if it is possible or place the thread into the wait list if not. LICENSE MIT Change-Id: I5d134f045a0c935fdaaef6edf5bdf37bb0418a98 Reviewed-on: http://gerrit.openafs.org/5360 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@openafs.org> Tested-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
parent
c3e82ee98b
commit
33af0f92e9
@ -1209,8 +1209,9 @@ cm_EndDirOp(cm_dirOp_t * op)
|
||||
|
||||
switch (op->lockType) {
|
||||
case CM_DIRLOCK_READ:
|
||||
lock_ReleaseRead(&op->scp->dirlock);
|
||||
/* fall through ... */
|
||||
lock_ConvertRToW(&op->scp->dirlock);
|
||||
op->lockType = CM_DIRLOCK_WRITE;
|
||||
break;
|
||||
case CM_DIRLOCK_NONE:
|
||||
lock_ObtainWrite(&op->scp->dirlock);
|
||||
op->lockType = CM_DIRLOCK_WRITE;
|
||||
|
Loading…
Reference in New Issue
Block a user