mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[BTRFS] Applied upstream pull-requests before they are merged
This commit is contained in:
parent
3b69eee7a6
commit
0e61b570e7
2 changed files with 73 additions and 0 deletions
|
@ -4892,6 +4892,9 @@ static NTSTATUS drv_shutdown(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp) {
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
BOOL top_level;
|
BOOL top_level;
|
||||||
device_extension* Vcb = DeviceObject->DeviceExtension;
|
device_extension* Vcb = DeviceObject->DeviceExtension;
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
LIST_ENTRY *Vcble, *le;
|
||||||
|
#endif
|
||||||
|
|
||||||
FsRtlEnterFileSystem();
|
FsRtlEnterFileSystem();
|
||||||
|
|
||||||
|
@ -4909,6 +4912,7 @@ static NTSTATUS drv_shutdown(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp) {
|
||||||
shutting_down = TRUE;
|
shutting_down = TRUE;
|
||||||
KeSetEvent(&mountmgr_thread_event, 0, FALSE);
|
KeSetEvent(&mountmgr_thread_event, 0, FALSE);
|
||||||
|
|
||||||
|
#ifndef __REACTOS__
|
||||||
while (!IsListEmpty(&VcbList)) {
|
while (!IsListEmpty(&VcbList)) {
|
||||||
Vcb = CONTAINING_RECORD(VcbList.Flink, device_extension, list_entry);
|
Vcb = CONTAINING_RECORD(VcbList.Flink, device_extension, list_entry);
|
||||||
|
|
||||||
|
@ -4916,6 +4920,71 @@ static NTSTATUS drv_shutdown(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp) {
|
||||||
|
|
||||||
uninit(Vcb, TRUE);
|
uninit(Vcb, TRUE);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
Vcble = VcbList.Flink;
|
||||||
|
while (Vcble != &VcbList) {
|
||||||
|
Vcb = CONTAINING_RECORD(Vcble, device_extension, list_entry);
|
||||||
|
|
||||||
|
TRACE("shutting down Vcb %p\n", Vcb);
|
||||||
|
|
||||||
|
if (Vcb->balance.thread) {
|
||||||
|
Vcb->balance.paused = FALSE;
|
||||||
|
Vcb->balance.stopping = TRUE;
|
||||||
|
KeSetEvent(&Vcb->balance.event, 0, FALSE);
|
||||||
|
KeWaitForSingleObject(&Vcb->balance.finished, Executive, KernelMode, FALSE, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Vcb->scrub.thread) {
|
||||||
|
Vcb->scrub.paused = FALSE;
|
||||||
|
Vcb->scrub.stopping = TRUE;
|
||||||
|
KeSetEvent(&Vcb->scrub.event, 0, FALSE);
|
||||||
|
KeWaitForSingleObject(&Vcb->scrub.finished, Executive, KernelMode, FALSE, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Vcb->running_sends != 0) {
|
||||||
|
BOOL send_cancelled = FALSE;
|
||||||
|
|
||||||
|
ExAcquireResourceExclusiveLite(&Vcb->send_load_lock, TRUE);
|
||||||
|
|
||||||
|
le = Vcb->send_ops.Flink;
|
||||||
|
while (le != &Vcb->send_ops) {
|
||||||
|
send_info* send = CONTAINING_RECORD(le, send_info, list_entry);
|
||||||
|
|
||||||
|
if (!send->cancelling) {
|
||||||
|
send->cancelling = TRUE;
|
||||||
|
send_cancelled = TRUE;
|
||||||
|
send->ccb = NULL;
|
||||||
|
KeSetEvent(&send->cleared_event, 0, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
le = le->Flink;
|
||||||
|
}
|
||||||
|
|
||||||
|
ExReleaseResourceLite(&Vcb->send_load_lock);
|
||||||
|
|
||||||
|
if (send_cancelled) {
|
||||||
|
while (Vcb->running_sends != 0) {
|
||||||
|
ExAcquireResourceExclusiveLite(&Vcb->send_load_lock, TRUE);
|
||||||
|
ExReleaseResourceLite(&Vcb->send_load_lock);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ExAcquireResourceExclusiveLite(&Vcb->tree_lock, TRUE);
|
||||||
|
|
||||||
|
if (Vcb->need_write && !Vcb->readonly) {
|
||||||
|
Status = do_write(Vcb, Irp);
|
||||||
|
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
ERR("do_write returned %08x\n", Status);
|
||||||
|
}
|
||||||
|
|
||||||
|
Vcb->removing = TRUE;
|
||||||
|
|
||||||
|
ExReleaseResourceLite(&Vcb->tree_lock);
|
||||||
|
Vcble = Vcble->Flink;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
if (comfo) {
|
if (comfo) {
|
||||||
|
|
|
@ -675,7 +675,11 @@ static NTSTATUS query_directory(PIRP Irp) {
|
||||||
if (IrpSp->Parameters.QueryDirectory.FileName && IrpSp->Parameters.QueryDirectory.FileName->Length > 1) {
|
if (IrpSp->Parameters.QueryDirectory.FileName && IrpSp->Parameters.QueryDirectory.FileName->Length > 1) {
|
||||||
TRACE("QD filename: %.*S\n", IrpSp->Parameters.QueryDirectory.FileName->Length / sizeof(WCHAR), IrpSp->Parameters.QueryDirectory.FileName->Buffer);
|
TRACE("QD filename: %.*S\n", IrpSp->Parameters.QueryDirectory.FileName->Length / sizeof(WCHAR), IrpSp->Parameters.QueryDirectory.FileName->Buffer);
|
||||||
|
|
||||||
|
#ifndef __REACTOS__
|
||||||
if (IrpSp->Parameters.QueryDirectory.FileName->Buffer[0] != '*') {
|
if (IrpSp->Parameters.QueryDirectory.FileName->Buffer[0] != '*') {
|
||||||
|
#else
|
||||||
|
if (IrpSp->Parameters.QueryDirectory.FileName->Length > sizeof(WCHAR) || IrpSp->Parameters.QueryDirectory.FileName->Buffer[0] != L'*') {
|
||||||
|
#endif
|
||||||
specific_file = TRUE;
|
specific_file = TRUE;
|
||||||
|
|
||||||
if (FsRtlDoesNameContainWildCards(IrpSp->Parameters.QueryDirectory.FileName)) {
|
if (FsRtlDoesNameContainWildCards(IrpSp->Parameters.QueryDirectory.FileName)) {
|
||||||
|
|
Loading…
Reference in a new issue