Remove sync FileStream hack

This commit is contained in:
Bond_009
2021-09-25 19:44:40 +02:00
parent 2ee3e9e00f
commit f31224fa8f
23 changed files with 29 additions and 56 deletions

View File

@@ -132,7 +132,7 @@ namespace Jellyfin.Server.Infrastructure
FileAccess.Read,
FileShare.ReadWrite,
bufferSize: BufferSize,
options: (AsyncFile.UseAsyncIO ? FileOptions.Asynchronous : FileOptions.None) | FileOptions.SequentialScan);
options: FileOptions.Asynchronous | FileOptions.SequentialScan);
fileStream.Seek(offset, SeekOrigin.Begin);
await StreamCopyOperation

View File

@@ -547,7 +547,7 @@ namespace Jellyfin.Server
?? throw new InvalidOperationException($"Invalid resource path: '{ResourcePath}'");
// Copy the resource contents to the expected file path for the config file
await using Stream dst = new FileStream(configPath, FileMode.CreateNew, FileAccess.Write, FileShare.None, IODefaults.FileStreamBufferSize, AsyncFile.UseAsyncIO);
await using Stream dst = new FileStream(configPath, FileMode.CreateNew, FileAccess.Write, FileShare.None, IODefaults.FileStreamBufferSize, FileOptions.Asynchronous);
await resource.CopyToAsync(dst).ConfigureAwait(false);
}