New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue174 #176
Issue174 #176
Conversation
Added FlushAndPurgeOnCleanup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the excellent work. This looks very good. There are a few issues having to do with an extraneous .gitignore
file, some spaces vs tabs issues and a couple of other minor issues. Please see my comments below.
For me to accept this PR I also need you to agree to the Contributor Agreement. This gives joint copyright to your changes to both of us and also identifies you as a contributor to this project. You only need to sign this document for your first contribution, you do not need to sign it again for additional contributions.
Thanks again for your PR!
{ | ||
get { return 0 != (_VolumeParams.Flags & VolumeParams.FlushAndPurgeOnCleanup); } | ||
set { _VolumeParams.Flags |= (value ? VolumeParams.FlushAndPurgeOnCleanup : 0); } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agreed the Contributor Agreement and I was under the impression that the updated version (with my name in it) was waiting for your approval. Am I missing something there ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your changes. Everything looks in order.
Regarding the Contributor Agreement, I have not received any document on this or any other Pull Request.
The preferred way to do this would be to add your name to the Contributor Agreement in your fork and add it as a commit that will then be added to this Pull Request. When I merge this Pull Request into WinFsp your name will also be included in the Contributor Agreement document.
src/dotnet/FileSystemHost.cs
Outdated
@@ -347,6 +352,14 @@ public static Int32 SetDebugLogFile(String FileName) | |||
{ | |||
return Api.SetDebugLogFile(FileName); | |||
} | |||
/// <summary> | |||
/// Return the installed version for WinFSP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change this to read: Return the installed version of WinFsp.
(Note WinFsp vs WinFSP spelling and fullstop at end of sentence.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good otherwise although we may want to consider renaming the method to Version
. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't methods be called with an action verb ?
In any case, we can call it version. It's fine for me.
@@ -43,6 +43,7 @@ internal struct VolumeParams | |||
internal const UInt32 PassQueryDirectoryPattern = 0x00000800; | |||
internal const UInt32 AlwaysUseDoubleBuffering = 0x00001000; | |||
internal const UInt32 PassQueryDirectoryFileName = 0x00002000; | |||
internal const UInt32 FlushAndPurgeOnCleanup = 0x00004000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
src/dotnet/Interop.cs
Outdated
SecurityDescriptorBytes = MakeSecurityDescriptor(SecurityDescriptor); | ||
FspDeleteSecurityDescriptor(SecurityDescriptor, _FspSetSecurityDescriptorPtr); | ||
return SecurityDescriptorBytes; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix tabs vs spaces here. WinFsp uses 4 space indendation and no tabs. (Or perhaps the file was erroneously using tabs before?)
There should be no changes here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite sure i used spaces ... VisualStudio auto-format must have changed that... I'll correct that
src/dotnet/Interop.cs
Outdated
fixed (Byte *R = ReplaceReparseData) | ||
return _FspFileSystemCanReplaceReparsePoint( | ||
(IntPtr)C, (UIntPtr)CurrentReparseData.Length, | ||
(IntPtr)R, (UIntPtr)ReplaceReparseData.Length); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above re: spaces vs tabs.
There should be no changes here.
src/dotnet/Interop.cs
Outdated
VersionMinor = Version & 0xFFFF; | ||
return new System.Version((Int32)VersionMajor, (Int32)VersionMinor); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. I do find the VersionMajor
and VersionMinor
variables unnecessary. Perhaps we should change this to read:
internal static Version GetFspVersion()
{
UInt32 Version = 0;
FspVersion(out Version);
return new System.Version((Int32)(Version >> 16), (Int32)(Version & 0xFFFF));
}
tst/memfs-dotnet/Program.cs
Outdated
@@ -70,7 +70,7 @@ public FileInfo GetFileInfo() | |||
{ | |||
FileInfo FileInfo = MainFileNode.FileInfo; | |||
FileInfo.FileAttributes &= ~(UInt32)FileAttributes.Directory; | |||
/* named streams cannot be directories */ | |||
/* named streams cannot be directories */ | |||
FileInfo.AllocationSize = this.FileInfo.AllocationSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above re: spaces vs tabs.
There should be no changes here.
tst/memfs-dotnet/Program.cs
Outdated
@@ -255,6 +255,7 @@ public override Int32 Init(Object Host0) | |||
Host.NamedStreams = true; | |||
Host.PostCleanupWhenModifiedOnly = true; | |||
Host.PassQueryDirectoryFileName = true; | |||
Host.FlushAndPurgeOnCleanup = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would ask that we remove this line, because it changes the default behavior of WinFsp .NET file systems. Thanks to your work, It is now easy to have a file system set this property when it needs it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. It was a test that I didn't remove ...
tst/memfs-dotnet/Program.cs
Outdated
argtos(Args, ref I, ref VolumePrefix); | ||
break; | ||
default: | ||
throw new CommandLineUsageException(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above re: spaces vs tabs.
There should be no changes here.
.gitignore
Outdated
################################################################################ | ||
|
||
*.db | ||
*.opendb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This .gitignore
file is not needed. Please remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to add it because of locked file.
I was pushing via Visual Studio. I will push from command line and won't need that file anymore
Seems to me that I managed to correct all those indendation issues... |
@FrKaram thank you. This looks great. I am currently on the road so I do not have easy access to a computer, but I will try to accept this PR tonight or tomorrow. |
Well that's my first PR on an open-source project which is not a project of mine. |
@FrKaram I have finally merged this into master. Thank you again. |
dotnet: add FlushAndPurgeOnCleanup and FspVersion
Implemented elements requested in Issue 174
Add FlushAndPurgeOnCleanup option
Add GetFSPVersion
Before submitting this PR please review this checklist. Ideally all checkmarks should be checked upon submitting. (Use an x inside square brackets like so: [x])