Skip to content

Commit

Permalink
[C#] Remove dependency on Mono.Posix.NETStandard (#327)
Browse files Browse the repository at this point in the history
* Remove dependency on Mono.Posix. It was used only to disable file read caching on non-Windows. This "feature" does not justify adding another dependency, as it has issues with Xamarin apps.
  • Loading branch information
badrishc authored Sep 11, 2020
1 parent 7dd5ba8 commit 9223b1c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 22 deletions.
19 changes: 0 additions & 19 deletions cs/src/core/Device/ManagedLocalStorageDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@

using System;
using System.Buffers;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;

#if DOTNETCORE
using Mono.Unix.Native;
#endif

namespace FASTER.core
{
/// <summary>
Expand Down Expand Up @@ -333,13 +328,6 @@ private Stream CreateReadHandle(int segmentId)
GetSegmentName(segmentId), FileMode.OpenOrCreate,
FileAccess.Read, FileShare.ReadWrite, 512, fo);

#if DOTNETCORE
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Syscall.fcntl((int)logReadHandle.SafeFileHandle.DangerousGetHandle(), FcntlCommand.F_NOCACHE, 1);
}
#endif

return logReadHandle;
}

Expand All @@ -356,13 +344,6 @@ private Stream CreateWriteHandle(int segmentId)
GetSegmentName(segmentId), FileMode.OpenOrCreate,
FileAccess.Write, FileShare.ReadWrite, 512, fo);

#if DOTNETCORE
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Syscall.fcntl((int)logWriteHandle.SafeFileHandle.DangerousGetHandle(), FcntlCommand.F_NOCACHE, 1);
}
#endif

if (preallocateFile && segmentSize != -1)
SetFileSize(logWriteHandle, segmentSize);

Expand Down
1 change: 0 additions & 1 deletion cs/src/core/FASTER.core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net461'">
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0" />
<PackageReference Include="System.Interactive.Async" Version="4.1.1" />
</ItemGroup>
</Project>
2 changes: 0 additions & 2 deletions cs/src/core/FASTER.core.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@
<dependency id="System.Memory" version="4.5.4" />
<dependency id="System.Threading.Tasks.Extensions" version="4.5.4" />
<dependency id="System.Interactive.Async" version="4.1.1" />
<dependency id="Mono.Posix.NETStandard" version="1.0.0" />
</group>
<group targetFramework="netstandard2.1">
<dependency id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" />
<dependency id="System.Interactive.Async" version="4.1.1" />
<dependency id="Mono.Posix.NETStandard" version="1.0.0" />
</group>
</dependencies>
</metadata>
Expand Down

0 comments on commit 9223b1c

Please sign in to comment.