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
This commit is contained in:
Benjamin Fleischer 2017-07-07 23:30:14 +02:00 committed by Nikolaus Rath
parent 861d308a03
commit db149d1d87
1 changed files with 3 additions and 0 deletions

View File

@ -3150,6 +3150,9 @@ static int sshfs_getattr(const char *path, struct stat *stbuf,
}
if (!err) {
err = buf_get_attrs(&outbuf, stbuf, NULL);
#ifdef __APPLE__
stbuf->st_blksize = 0;
#endif
buf_free(&outbuf);
}
buf_free(&buf);