From 1d31064e0f8d4d914469cb04ed66aaccee077695 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 12 Sep 2019 11:18:05 +0000 Subject: [PATCH] sshfs: fix issue preventing use of global I/O size on macOS Following-up on [1], there was another instance where blksize was set to a non-zero value, thus making it impossible to configure global I/O size on macOS, and using [2] the hard-wired value of 4096 bytes instead, resulting in uniformly poor performance [3]. With this patch, setting I/O size [4] to a reasonable large value, will result in much improved performance, e.g.: -o iosize=1048576 [1] https://github.com/osxfuse/sshfs/commit/5c0dbfe3eb40100f9277e863926f2e7d7c9a5a4c [2] https://github.com/libfuse/sshfs/blob/4c21d696e9d46bebae0a936e2aec72326c5954ea/sshfs.c#L812 [3] https://github.com/libfuse/sshfs/issues/11#issuecomment-339407557 [4] https://github.com/osxfuse/osxfuse/wiki/Mount-options#iosize Closes #44173. Signed-off-by: FX Coudert --- Formula/sshfs.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Formula/sshfs.rb b/Formula/sshfs.rb index bcae29590421e..9eeae599ce46e 100644 --- a/Formula/sshfs.rb +++ b/Formula/sshfs.rb @@ -3,7 +3,7 @@ class Sshfs < Formula homepage "https://osxfuse.github.io/" url "https://github.com/libfuse/sshfs/releases/download/sshfs-2.10/sshfs-2.10.tar.gz" sha256 "70845dde2d70606aa207db5edfe878e266f9c193f1956dd10ba1b7e9a3c8d101" - revision 1 + revision 2 bottle do cellar :any @@ -19,6 +19,16 @@ class Sshfs < Formula depends_on "glib" depends_on :osxfuse + # Apply patch that clears one remaining roadblock that prevented setting + # a custom I/O buffer size on macOS. With this patch in place, it's + # recommended to use e.g. `-o iosize=1048576` (or other, reasonable value) + # when lauching `sshfs`, for improved performance. + # See also: https://github.com/libfuse/sshfs/issues/11 + patch do + url "https://github.com/libfuse/sshfs/commit/667cf34622e2e873db776791df275c7a582d6295.diff?full_index=1" + sha256 "6a121d58a94cf0efebbfa217d62aa4d9915a8e6573ae2c086170ff9d9fc09456" + end + def install system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" system "make", "install"