mirror of
https://github.com/reactos/reactos.git
synced 2025-06-08 19:00:42 +00:00
[BTRFS]
Import three fixes from my local GitHub repository: - Don't attempt to remove Vcb from list twice on shutdown - Properly add CCB to root_file - Init cache for root_file so that cache uninit on shutdown isn't problematic This fixes BTRFS in ReactOS. These fixes have already been submitted upstream (https://github.com/maharmstone/btrfs/pull/23). CORE-11674 svn path=/trunk/; revision=72024
This commit is contained in:
parent
7695f39c11
commit
b139d1b07b
1 changed files with 17 additions and 0 deletions
|
@ -1935,7 +1935,9 @@ void STDCALL uninit(device_extension* Vcb, BOOL flush) {
|
||||||
LIST_ENTRY* le;
|
LIST_ENTRY* le;
|
||||||
LARGE_INTEGER time;
|
LARGE_INTEGER time;
|
||||||
|
|
||||||
|
#ifndef __REACTOS__
|
||||||
RemoveEntryList(&Vcb->list_entry);
|
RemoveEntryList(&Vcb->list_entry);
|
||||||
|
#endif
|
||||||
|
|
||||||
Status = registry_mark_volume_unmounted(&Vcb->superblock.uuid);
|
Status = registry_mark_volume_unmounted(&Vcb->superblock.uuid);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
|
@ -3762,12 +3764,27 @@ static NTSTATUS STDCALL mount_vol(PDEVICE_OBJECT DeviceObject, PIRP Irp) {
|
||||||
|
|
||||||
Vcb->root_file = IoCreateStreamFileObject(NULL, DeviceToMount);
|
Vcb->root_file = IoCreateStreamFileObject(NULL, DeviceToMount);
|
||||||
Vcb->root_file->FsContext = root_fcb;
|
Vcb->root_file->FsContext = root_fcb;
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
Vcb->root_file->SectionObjectPointer = &root_fcb->nonpaged->segment_object;
|
||||||
|
Vcb->root_file->Vpb = DeviceObject->Vpb;
|
||||||
|
#endif
|
||||||
|
|
||||||
RtlZeroMemory(root_ccb, sizeof(ccb));
|
RtlZeroMemory(root_ccb, sizeof(ccb));
|
||||||
root_ccb->NodeType = BTRFS_NODE_TYPE_CCB;
|
root_ccb->NodeType = BTRFS_NODE_TYPE_CCB;
|
||||||
root_ccb->NodeSize = sizeof(ccb);
|
root_ccb->NodeSize = sizeof(ccb);
|
||||||
|
|
||||||
|
#ifndef __REACTOS__
|
||||||
Vcb->root_file->FsContext = root_ccb;
|
Vcb->root_file->FsContext = root_ccb;
|
||||||
|
#else
|
||||||
|
Vcb->root_file->FsContext2 = root_ccb;
|
||||||
|
|
||||||
|
_SEH2_TRY {
|
||||||
|
CcInitializeCacheMap(Vcb->root_file, (PCC_FILE_SIZES)(&root_fcb->Header.AllocationSize), FALSE, cache_callbacks, Vcb->root_file);
|
||||||
|
} _SEH2_EXCEPT (EXCEPTION_EXECUTE_HANDLER) {
|
||||||
|
Status = _SEH2_GetExceptionCode();
|
||||||
|
goto exit;
|
||||||
|
} _SEH2_END;
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0; i < Vcb->superblock.num_devices; i++) {
|
for (i = 0; i < Vcb->superblock.num_devices; i++) {
|
||||||
Status = find_disk_holes(Vcb, &Vcb->devices[i]);
|
Status = find_disk_holes(Vcb, &Vcb->devices[i]);
|
||||||
|
|
Loading…
Reference in a new issue