From 8589b149fdcb2ff4698da8ed5e1fd6fb00dde381 Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Thu, 18 Feb 2016 20:15:46 +0100 Subject: Remove call to g_slice_set_config() It is unclear why G_SLICE_CONFIG_ALWAYS_MALLOC has been set before but doing so with the latest version of GLib (2.46.2) results in the following warning: GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed This fixes issue osxfuse/sshfs#17 --- sshfs.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sshfs.c b/sshfs.c index ce30a0f..0ce23ef 100644 --- a/sshfs.c +++ b/sshfs.c @@ -3923,9 +3923,6 @@ int main(int argc, char *argv[]) if (!realpath(*exec_path, sshfs_program_path)) { memset(sshfs_program_path, 0, PATH_MAX); } - - /* Until this gets fixed somewhere else. */ - g_slice_set_config(G_SLICE_CONFIG_ALWAYS_MALLOC, TRUE); #endif /* __APPLE__ */ g_thread_init(NULL); -- cgit v1.2.3 From 5c0dbfe3eb40100f9277e863926f2e7d7c9a5a4c Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Fri, 7 Jul 2017 23:30:14 +0200 Subject: Fall back to global I/O size on macOS The st_blksize value of struct stat represents the optimal block size for file I/O operations. FUSE for macOS will use this value when preforming read or write operations on the file. The smaller st_blksize is the more context switches are required to complete the operation. Setting st_blksize to 0 results in FUSE for macOS falling back to the global I/O size, that can be specified through the "-o iosize=..." mount-time option. Fixes osxfuse/osxfuse#389 and osxfuse/sshfs#33 --- sshfs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sshfs.c b/sshfs.c index 8cde971..2ef45d5 100644 --- a/sshfs.c +++ b/sshfs.c @@ -2000,6 +2000,9 @@ static int sshfs_getattr(const char *path, struct stat *stbuf) &buf, SSH_FXP_ATTRS, &outbuf); if (!err) { err = buf_get_attrs(&outbuf, stbuf, NULL); +#ifdef __APPLE__ + stbuf->st_blksize = 0; +#endif buf_free(&outbuf); } buf_free(&buf); @@ -3203,6 +3206,9 @@ static int sshfs_fgetattr(const char *path, struct stat *stbuf, err = sftp_request(SSH_FXP_FSTAT, &buf, SSH_FXP_ATTRS, &outbuf); if (!err) { err = buf_get_attrs(&outbuf, stbuf, NULL); +#ifdef __APPLE__ + stbuf->st_blksize = 0; +#endif buf_free(&outbuf); } buf_free(&buf); -- cgit v1.2.3 From f187961c7a6a2433c8af7e758d8185568d8006a2 Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Fri, 7 Jul 2017 23:30:17 +0200 Subject: Don't require mount point to exists on macOS By default volumes are mounted under /Volumes on macOS. Since macOS 10.12 the /Volumes directory is root-owned. In order to allow non- privileged users to mount FUSE volumes under /Volumes FUSE will create non-existent mount points automatically. Fixes osxfuse/sshfs#27 --- sshfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sshfs.c b/sshfs.c index 2ef45d5..f116633 100644 --- a/sshfs.c +++ b/sshfs.c @@ -4121,7 +4121,7 @@ int main(int argc, char *argv[]) char *mountpoint; int multithreaded; int foreground; -#if !defined(__CYGWIN__) +#if !defined(__APPLE__) && !defined(__CYGWIN__) struct stat st; #endif @@ -4135,14 +4135,14 @@ int main(int argc, char *argv[]) foreground = 1; } -#if !defined(__CYGWIN__) +#if !defined(__APPLE__) && !defined(__CYGWIN__) res = stat(mountpoint, &st); if (res == -1) { perror(mountpoint); exit(1); } sshfs.mnt_mode = st.st_mode; -#elif defined(__CYGWIN__) +#else sshfs.mnt_mode = S_IFDIR | 0755; #endif -- cgit v1.2.3