From 6d4d06afbb8a735b06db3aee17525ea1bb033bbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 3 Sep 2016 22:07:53 +0000 Subject: [PATCH] [NTOS]: Fix comments & increase code readability by directly using InterlockedIncrement. svn path=/trunk/; revision=72556 --- reactos/ntoskrnl/io/iomgr/iofunc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/reactos/ntoskrnl/io/iomgr/iofunc.c b/reactos/ntoskrnl/io/iomgr/iofunc.c index 7fb698d30fb..758c9063698 100644 --- a/reactos/ntoskrnl/io/iomgr/iofunc.c +++ b/reactos/ntoskrnl/io/iomgr/iofunc.c @@ -384,10 +384,10 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle, _SEH2_END; } - /* If we're to dismount a volume, increaase the dismount count */ + /* If we are dismounting a volume, increaase the dismount count */ if (IoControlCode == FSCTL_DISMOUNT_VOLUME) { - InterlockedExchangeAdd((PLONG)&SharedUserData->DismountCount, 1); + InterlockedIncrement((PLONG)&SharedUserData->DismountCount); } /* Call the FSD */ @@ -418,7 +418,7 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle, /* Backup our complete context in case it exists */ if (FileObject->CompletionContext) { - CompletionInfo = *(FileObject->CompletionContext); + CompletionInfo = *(FileObject->CompletionContext); } /* If we had an event, signal it */ @@ -612,12 +612,15 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle, } /* Use deferred completion for FS I/O */ - Irp->Flags |= (!IsDevIoCtl) ? IRP_DEFER_IO_COMPLETION : 0; + if (!IsDevIoCtl) + { + Irp->Flags |= IRP_DEFER_IO_COMPLETION; + } - /* If we're to dismount a volume, increaase the dismount count */ + /* If we are dismounting a volume, increaase the dismount count */ if (IoControlCode == FSCTL_DISMOUNT_VOLUME) { - InterlockedExchangeAdd((PLONG)&SharedUserData->DismountCount, 1); + InterlockedIncrement((PLONG)&SharedUserData->DismountCount); } /* Perform the call */