Skip to content

Commit

Permalink
Limit write requests to 64kB
Browse files Browse the repository at this point in the history
  • Loading branch information
szmi committed Apr 22, 2008
1 parent b246ad3 commit 4b88fc4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* Allow the '-ossh_command=CMD' command to contain parameters.
Escape charater is backslash.

* Limit write requests to 64kB.

2008-04-21 Miklos Szeredi <miklos@szeredi.hu>

* Fix incorrect disk usage reported by 'du' for files of size 4GB
Expand Down
7 changes: 7 additions & 0 deletions sshfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ struct sshfs {
int no_check_root;
int detect_uid;
unsigned max_read;
unsigned max_write;
unsigned ssh_ver;
int sync_write;
int sync_read;
Expand Down Expand Up @@ -280,6 +281,7 @@ static struct fuse_opt sshfs_opts[] = {
SSHFS_OPT("ssh_command=%s", ssh_command, 0),
SSHFS_OPT("sftp_server=%s", sftp_server, 0),
SSHFS_OPT("max_read=%u", max_read, 0),
SSHFS_OPT("max_write=%u", max_write, 0),
SSHFS_OPT("ssh_protocol=%u", ssh_ver, 0),
SSHFS_OPT("-1", ssh_ver, 1),
SSHFS_OPT("workaround=%s", workarounds, 0),
Expand Down Expand Up @@ -2995,6 +2997,7 @@ int main(int argc, char *argv[])

sshfs.blksize = 4096;
sshfs.max_read = 65536;
sshfs.max_write = 65536;
sshfs.nodelay_workaround = 1;
sshfs.nodelaysrv_workaround = 0;
sshfs.rename_workaround = 0;
Expand Down Expand Up @@ -3087,11 +3090,15 @@ int main(int argc, char *argv[])

if (sshfs.max_read > 65536)
sshfs.max_read = 65536;
if (sshfs.max_write > 65536)
sshfs.max_write = 65536;

if (fuse_is_lib_option("ac_attr_timeout="))
fuse_opt_insert_arg(&args, 1, "-oauto_cache,ac_attr_timeout=0");
tmp = g_strdup_printf("-omax_read=%u", sshfs.max_read);
fuse_opt_insert_arg(&args, 1, tmp);
tmp = g_strdup_printf("-omax_write=%u", sshfs.max_write);
fuse_opt_insert_arg(&args, 1, tmp);
g_free(tmp);
#if FUSE_VERSION >= 27
libver = fuse_version();
Expand Down

0 comments on commit 4b88fc4

Please sign in to comment.