Skip to content
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

Merged
merged 12 commits into from Jul 5, 2018
Merged

Issue174 #176

merged 12 commits into from Jul 5, 2018

Conversation

FrKaram
Copy link
Contributor

@FrKaram FrKaram commented Jun 30, 2018

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])

  • Contributing: You MUST read and be willing to accept the CONTRIBUTOR AGREEMENT. The agreement gives joint copyright interests in your contributions to you and the original WinFsp author. If you have already accepted the CONTRIBUTOR AGREEMENT you do not need to do so again.
  • Topic branch: Avoid creating the PR off the master branch of your fork. Consider creating a topic branch and request a pull from that. This allows you to add commits to the master branch of your fork without affecting this PR.
  • No tabs: Consistently use SPACES everywhere. NO TABS, unless the file format requires it (e.g. Makefile).
  • Style: Follow the same code style as the rest of the project.
  • Tests: Include tests to the extent that it is possible, especially if you add a new feature.
  • Quality: Your design and code should be of high quality and something that you are proud of.

Copy link
Collaborator

@billziss-gh billziss-gh left a 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); }
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Contributor Author

@FrKaram FrKaram Jul 1, 2018

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 ?

Copy link
Collaborator

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.

@@ -347,6 +352,14 @@ public static Int32 SetDebugLogFile(String FileName)
{
return Api.SetDebugLogFile(FileName);
}
/// <summary>
/// Return the installed version for WinFSP
Copy link
Collaborator

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.)

Copy link
Collaborator

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?

Copy link
Contributor Author

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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

SecurityDescriptorBytes = MakeSecurityDescriptor(SecurityDescriptor);
FspDeleteSecurityDescriptor(SecurityDescriptor, _FspSetSecurityDescriptorPtr);
return SecurityDescriptorBytes;
}
}
Copy link
Collaborator

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.

Copy link
Contributor Author

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

fixed (Byte *R = ReplaceReparseData)
return _FspFileSystemCanReplaceReparsePoint(
(IntPtr)C, (UIntPtr)CurrentReparseData.Length,
(IntPtr)R, (UIntPtr)ReplaceReparseData.Length);
}
Copy link
Collaborator

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.

VersionMinor = Version & 0xFFFF;
return new System.Version((Int32)VersionMajor, (Int32)VersionMinor);
}

Copy link
Collaborator

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));
    }

@@ -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;
Copy link
Collaborator

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.

@@ -255,6 +255,7 @@ public override Int32 Init(Object Host0)
Host.NamedStreams = true;
Host.PostCleanupWhenModifiedOnly = true;
Host.PassQueryDirectoryFileName = true;
Host.FlushAndPurgeOnCleanup = true;
Copy link
Collaborator

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.

Copy link
Contributor Author

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 ...

argtos(Args, ref I, ref VolumePrefix);
break;
default:
throw new CommandLineUsageException();
}
Copy link
Collaborator

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
Copy link
Collaborator

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.

Copy link
Contributor Author

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

@FrKaram
Copy link
Contributor Author

FrKaram commented Jul 1, 2018

Seems to me that I managed to correct all those indendation issues...
The only remaining changes are the "real" ones

@billziss-gh
Copy link
Collaborator

@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.

@FrKaram
Copy link
Contributor Author

FrKaram commented Jul 3, 2018

Well that's my first PR on an open-source project which is not a project of mine.
That's great ! :-)

@billziss-gh billziss-gh merged commit 6ffddf3 into winfsp:master Jul 5, 2018
@billziss-gh
Copy link
Collaborator

@FrKaram I have finally merged this into master. Thank you again.

Noire001 pushed a commit to Noire001/winfsp that referenced this pull request Sep 25, 2022
dotnet: add FlushAndPurgeOnCleanup and FspVersion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants