From 382a6675daa30e29f86c7f10ff4f7d55a93c77d0 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Sun, 12 Jun 2016 16:47:40 -0700 Subject: [PATCH] dll: fuse: testing --- src/dll/fuse/fuse_intf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dll/fuse/fuse_intf.c b/src/dll/fuse/fuse_intf.c index 9ad08eff..6872c770 100644 --- a/src/dll/fuse/fuse_intf.c +++ b/src/dll/fuse/fuse_intf.c @@ -205,9 +205,9 @@ static NTSTATUS fsp_fuse_intf_GetFileInfoEx(FSP_FILE_SYSTEM *FileSystem, (UINT64)f->VolumeParams.SectorsPerAllocationUnit; FileInfo->FileAttributes = (stbuf.st_mode & 0040000) ? FILE_ATTRIBUTE_DIRECTORY : 0; FileInfo->ReparseTag = 0; - FileInfo->AllocationSize = - (stbuf.st_size + AllocationUnit - 1) / AllocationUnit * AllocationUnit; FileInfo->FileSize = stbuf.st_size; + FileInfo->AllocationSize = + (FileInfo->FileSize + AllocationUnit - 1) / AllocationUnit * AllocationUnit; FileInfo->CreationTime = Int32x32To64(stbuf.st_birthtim.tv_sec, 10000000) + 116444736000000000 + stbuf.st_birthtim.tv_nsec / 100; @@ -961,7 +961,7 @@ static NTSTATUS fsp_fuse_intf_SetFileSizeCommon(FSP_FILE_SYSTEM *FileSystem, * FUSE 2.8 does not support allocation size. However if the new AllocationSize * is less than the current FileSize we must truncate the file. */ - if (0 == f->ops.ftruncate) + if (0 != f->ops.ftruncate) { err = f->ops.ftruncate(filedesc->PosixPath, NewFileSize, &fi); Result = fsp_fuse_ntstatus_from_errno(f->env, err); @@ -976,9 +976,9 @@ static NTSTATUS fsp_fuse_intf_SetFileSizeCommon(FSP_FILE_SYSTEM *FileSystem, AllocationUnit = (UINT64)f->VolumeParams.SectorSize * (UINT64)f->VolumeParams.SectorsPerAllocationUnit; - FileInfo->AllocationSize = - (NewFileSize + AllocationUnit - 1) / AllocationUnit * AllocationUnit; FileInfoBuf.FileSize = NewFileSize; + FileInfoBuf.AllocationSize = + (FileInfoBuf.FileSize + AllocationUnit - 1) / AllocationUnit * AllocationUnit; } memcpy(FileInfo, &FileInfoBuf, sizeof FileInfoBuf);