mirror of
https://github.com/reactos/reactos.git
synced 2025-06-01 15:38:37 +00:00
[BTRFS] Upgrade to 1.0.2
CORE-14655
This commit is contained in:
parent
47b9db9d02
commit
c7806a6b29
13 changed files with 35 additions and 29 deletions
|
@ -1984,8 +1984,6 @@ static NTSTATUS balance_data_chunk(device_extension* Vcb, chunk* c, BOOL* change
|
||||||
c, NULL, NULL, 0, FALSE, NormalPagePriority);
|
c, NULL, NULL, 0, FALSE, NormalPagePriority);
|
||||||
if (!NT_SUCCESS(Status)) {
|
if (!NT_SUCCESS(Status)) {
|
||||||
ERR("read_data returned %08x\n", Status);
|
ERR("read_data returned %08x\n", Status);
|
||||||
ExFreePool(csum);
|
|
||||||
ExFreePool(bmparr);
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1993,8 +1991,6 @@ static NTSTATUS balance_data_chunk(device_extension* Vcb, chunk* c, BOOL* change
|
||||||
NULL, newchunk, FALSE, 0, NormalPagePriority);
|
NULL, newchunk, FALSE, 0, NormalPagePriority);
|
||||||
if (!NT_SUCCESS(Status)) {
|
if (!NT_SUCCESS(Status)) {
|
||||||
ERR("write_data_complete returned %08x\n", Status);
|
ERR("write_data_complete returned %08x\n", Status);
|
||||||
ExFreePool(csum);
|
|
||||||
ExFreePool(bmparr);
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -562,7 +562,7 @@ typedef struct {
|
||||||
#define BTRFS_SEND_TLV_CLONE_OFFSET 23
|
#define BTRFS_SEND_TLV_CLONE_OFFSET 23
|
||||||
#define BTRFS_SEND_TLV_CLONE_LENGTH 24
|
#define BTRFS_SEND_TLV_CLONE_LENGTH 24
|
||||||
|
|
||||||
#define BTRFS_SEND_MAGIC "btrfs-stream\0"
|
#define BTRFS_SEND_MAGIC "btrfs-stream"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT8 magic[13];
|
UINT8 magic[13];
|
||||||
|
|
|
@ -53,8 +53,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,0,1,0
|
FILEVERSION 1,0,2,0
|
||||||
PRODUCTVERSION 1,0,1,0
|
PRODUCTVERSION 1,0,2,0
|
||||||
FILEFLAGSMASK 0x17L
|
FILEFLAGSMASK 0x17L
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -70,12 +70,12 @@ BEGIN
|
||||||
BLOCK "080904b0"
|
BLOCK "080904b0"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "FileDescription", "WinBtrfs"
|
VALUE "FileDescription", "WinBtrfs"
|
||||||
VALUE "FileVersion", "1.0.1"
|
VALUE "FileVersion", "1.0.2"
|
||||||
VALUE "InternalName", "btrfs"
|
VALUE "InternalName", "btrfs"
|
||||||
VALUE "LegalCopyright", "Copyright (c) Mark Harmstone 2016-17"
|
VALUE "LegalCopyright", "Copyright (c) Mark Harmstone 2016-18"
|
||||||
VALUE "OriginalFilename", "btrfs.sys"
|
VALUE "OriginalFilename", "btrfs.sys"
|
||||||
VALUE "ProductName", "WinBtrfs"
|
VALUE "ProductName", "WinBtrfs"
|
||||||
VALUE "ProductVersion", "1.0.1"
|
VALUE "ProductVersion", "1.0.2"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
|
@ -427,12 +427,7 @@ typedef struct _root {
|
||||||
} root;
|
} root;
|
||||||
|
|
||||||
enum batch_operation {
|
enum batch_operation {
|
||||||
Batch_Insert,
|
|
||||||
Batch_Delete,
|
Batch_Delete,
|
||||||
Batch_SetXattr,
|
|
||||||
Batch_DirItem,
|
|
||||||
Batch_InodeRef,
|
|
||||||
Batch_InodeExtRef,
|
|
||||||
Batch_DeleteInode,
|
Batch_DeleteInode,
|
||||||
Batch_DeleteDirItem,
|
Batch_DeleteDirItem,
|
||||||
Batch_DeleteInodeRef,
|
Batch_DeleteInodeRef,
|
||||||
|
@ -440,6 +435,11 @@ enum batch_operation {
|
||||||
Batch_DeleteXattr,
|
Batch_DeleteXattr,
|
||||||
Batch_DeleteExtentData,
|
Batch_DeleteExtentData,
|
||||||
Batch_DeleteFreeSpace,
|
Batch_DeleteFreeSpace,
|
||||||
|
Batch_Insert,
|
||||||
|
Batch_SetXattr,
|
||||||
|
Batch_DirItem,
|
||||||
|
Batch_InodeRef,
|
||||||
|
Batch_InodeExtRef,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -37,12 +37,14 @@ NTSTATUS add_calc_job(device_extension* Vcb, UINT8* data, UINT32 sectors, UINT32
|
||||||
KeInitializeEvent(&cj->event, NotificationEvent, FALSE);
|
KeInitializeEvent(&cj->event, NotificationEvent, FALSE);
|
||||||
|
|
||||||
ExAcquireResourceExclusiveLite(&Vcb->calcthreads.lock, TRUE);
|
ExAcquireResourceExclusiveLite(&Vcb->calcthreads.lock, TRUE);
|
||||||
|
|
||||||
InsertTailList(&Vcb->calcthreads.job_list, &cj->list_entry);
|
InsertTailList(&Vcb->calcthreads.job_list, &cj->list_entry);
|
||||||
ExReleaseResourceLite(&Vcb->calcthreads.lock);
|
|
||||||
|
|
||||||
KeSetEvent(&Vcb->calcthreads.event, 0, FALSE);
|
KeSetEvent(&Vcb->calcthreads.event, 0, FALSE);
|
||||||
KeClearEvent(&Vcb->calcthreads.event);
|
KeClearEvent(&Vcb->calcthreads.event);
|
||||||
|
|
||||||
|
ExReleaseResourceLite(&Vcb->calcthreads.lock);
|
||||||
|
|
||||||
*pcj = cj;
|
*pcj = cj;
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
|
@ -3103,7 +3103,7 @@ static NTSTATUS open_file(PDEVICE_OBJECT DeviceObject, _Requires_lock_held_(_Cur
|
||||||
allowed |= DELETE;
|
allowed |= DELETE;
|
||||||
|
|
||||||
if (fileref->fcb != Vcb->dummy_fcb && !is_subvol_readonly(fileref->fcb->subvol, Irp) && !Vcb->readonly) {
|
if (fileref->fcb != Vcb->dummy_fcb && !is_subvol_readonly(fileref->fcb->subvol, Irp) && !Vcb->readonly) {
|
||||||
allowed |= WRITE_OWNER | WRITE_DAC | FILE_WRITE_EA | FILE_WRITE_ATTRIBUTES;
|
allowed |= DELETE | WRITE_OWNER | WRITE_DAC | FILE_WRITE_EA | FILE_WRITE_ATTRIBUTES;
|
||||||
|
|
||||||
if (!fileref->fcb->ads && fileref->fcb->type == BTRFS_TYPE_DIRECTORY)
|
if (!fileref->fcb->ads && fileref->fcb->type == BTRFS_TYPE_DIRECTORY)
|
||||||
allowed |= FILE_ADD_SUBDIRECTORY | FILE_ADD_FILE | FILE_DELETE_CHILD;
|
allowed |= FILE_ADD_SUBDIRECTORY | FILE_ADD_FILE | FILE_DELETE_CHILD;
|
||||||
|
|
|
@ -2064,6 +2064,9 @@ static NTSTATUS set_end_of_file_information(device_extension* Vcb, PIRP Irp, PFI
|
||||||
ERR("error - extend_file failed\n");
|
ERR("error - extend_file failed\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
} else if ((UINT64)feofi->EndOfFile.QuadPart == fcb->inode_item.st_size && advance_only) {
|
||||||
|
Status = STATUS_SUCCESS;
|
||||||
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
ccfs.AllocationSize = fcb->Header.AllocationSize;
|
ccfs.AllocationSize = fcb->Header.AllocationSize;
|
||||||
|
|
|
@ -4254,8 +4254,9 @@ NTSTATUS insert_tree_item_batch(LIST_ENTRY* batchlist, device_extension* Vcb, ro
|
||||||
le = br->items.Blink;
|
le = br->items.Blink;
|
||||||
while (le != &br->items) {
|
while (le != &br->items) {
|
||||||
batch_item* bi2 = CONTAINING_RECORD(le, batch_item, list_entry);
|
batch_item* bi2 = CONTAINING_RECORD(le, batch_item, list_entry);
|
||||||
|
int cmp = keycmp(bi2->key, bi->key);
|
||||||
|
|
||||||
if (keycmp(bi2->key, bi->key) != 1) {
|
if (cmp == -1 || (cmp == 0 && bi->operation >= bi2->operation)) {
|
||||||
InsertHeadList(&bi2->list_entry, &bi->list_entry);
|
InsertHeadList(&bi2->list_entry, &bi->list_entry);
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5065,7 +5065,7 @@ NTSTATUS fsctl_request(PDEVICE_OBJECT DeviceObject, PIRP* Pirp, UINT32 type) {
|
||||||
Status = STATUS_INVALID_DEVICE_REQUEST;
|
Status = STATUS_INVALID_DEVICE_REQUEST;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if WIN32_WINNT >= 0x0600
|
#if _WIN32_WINNT >= 0x0600
|
||||||
case FSCTL_MAKE_MEDIA_COMPATIBLE:
|
case FSCTL_MAKE_MEDIA_COMPATIBLE:
|
||||||
WARN("STUB: FSCTL_MAKE_MEDIA_COMPATIBLE\n");
|
WARN("STUB: FSCTL_MAKE_MEDIA_COMPATIBLE\n");
|
||||||
Status = STATUS_INVALID_DEVICE_REQUEST;
|
Status = STATUS_INVALID_DEVICE_REQUEST;
|
||||||
|
|
|
@ -2093,7 +2093,6 @@ NTSTATUS read_data(_In_ device_extension* Vcb, _In_ UINT64 addr, _In_ UINT32 len
|
||||||
if (!dummy_mdl) {
|
if (!dummy_mdl) {
|
||||||
ERR("IoAllocateMdl failed\n");
|
ERR("IoAllocateMdl failed\n");
|
||||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||||
ExFreePool(dummypage);
|
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2347,7 +2346,6 @@ NTSTATUS read_data(_In_ device_extension* Vcb, _In_ UINT64 addr, _In_ UINT32 len
|
||||||
if (!dummy_mdl) {
|
if (!dummy_mdl) {
|
||||||
ERR("IoAllocateMdl failed\n");
|
ERR("IoAllocateMdl failed\n");
|
||||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||||
ExFreePool(dummypage);
|
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -923,21 +923,27 @@ void read_registry(PUNICODE_STRING regpath, BOOL refresh) {
|
||||||
ERR("LogFile was type %u, length %u\n", kvfi->Type, kvfi->DataLength);
|
ERR("LogFile was type %u, length %u\n", kvfi->Type, kvfi->DataLength);
|
||||||
|
|
||||||
Status = ZwDeleteValueKey(h, &us);
|
Status = ZwDeleteValueKey(h, &us);
|
||||||
if (!NT_SUCCESS(Status)) {
|
if (!NT_SUCCESS(Status))
|
||||||
ERR("ZwDeleteValueKey returned %08x\n", Status);
|
ERR("ZwDeleteValueKey returned %08x\n", Status);
|
||||||
}
|
|
||||||
|
log_file.Length = 0;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
ERR("ZwQueryValueKey returned %08\n", Status);
|
||||||
|
log_file.Length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExFreePool(kvfi);
|
ExFreePool(kvfi);
|
||||||
} else if (Status == STATUS_OBJECT_NAME_NOT_FOUND) {
|
} else if (Status == STATUS_OBJECT_NAME_NOT_FOUND) {
|
||||||
Status = ZwSetValueKey(h, &us, 0, REG_SZ, def_log_file, (ULONG)(wcslen(def_log_file) + 1) * sizeof(WCHAR));
|
Status = ZwSetValueKey(h, &us, 0, REG_SZ, def_log_file, (ULONG)(wcslen(def_log_file) + 1) * sizeof(WCHAR));
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status)) {
|
if (!NT_SUCCESS(Status))
|
||||||
ERR("ZwSetValueKey returned %08x\n", Status);
|
ERR("ZwSetValueKey returned %08x\n", Status);
|
||||||
}
|
|
||||||
|
log_file.Length = 0;
|
||||||
} else {
|
} else {
|
||||||
ERR("ZwQueryValueKey returned %08x\n", Status);
|
ERR("ZwQueryValueKey returned %08x\n", Status);
|
||||||
|
log_file.Length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (log_file.Length == 0) {
|
if (log_file.Length == 0) {
|
||||||
|
|
|
@ -2113,10 +2113,10 @@ static void scrub_raid6_stripe(device_extension* Vcb, chunk* c, scrub_context_ra
|
||||||
}
|
}
|
||||||
|
|
||||||
do_xor(scratch, &context->stripes[parity2].buf[(num * c->chunk_item->stripe_length) + (i * Vcb->superblock.sector_size)], len);
|
do_xor(scratch, &context->stripes[parity2].buf[(num * c->chunk_item->stripe_length) + (i * Vcb->superblock.sector_size)], len);
|
||||||
}
|
|
||||||
|
|
||||||
if (bad_stripe_num != 0)
|
if (bad_stripe_num != 0)
|
||||||
galois_divpower(scratch, (UINT8)bad_stripe_num, len);
|
galois_divpower(scratch, (UINT8)bad_stripe_num, len);
|
||||||
|
}
|
||||||
|
|
||||||
if (RtlCheckBit(&context->is_tree, bad_off1)) {
|
if (RtlCheckBit(&context->is_tree, bad_off1)) {
|
||||||
tree_header *th1 = NULL, *th2 = NULL;
|
tree_header *th1 = NULL, *th2 = NULL;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
The following FSD are shared with: https://github.com/maharmstone/btrfs.
|
The following FSD are shared with: https://github.com/maharmstone/btrfs.
|
||||||
|
|
||||||
reactos/drivers/filesystems/btrfs # Synced to 1.0.1
|
reactos/drivers/filesystems/btrfs # Synced to 1.0.2
|
||||||
reactos/dll/shellext/shellbtrfs # Synced to 1.0.1
|
reactos/dll/shellext/shellbtrfs # Synced to 1.0.1
|
||||||
reactos/sdk/lib/fslib/btrfslib # Synced to 1.0.1
|
reactos/sdk/lib/fslib/btrfslib # Synced to 1.0.1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue