Skip to content

Commit

Permalink
Accept -o cache_* options for backward compatibility.
Browse files Browse the repository at this point in the history
Fixes: #73.
  • Loading branch information
Nikratio committed Aug 3, 2017
1 parent 45710c8 commit 63300fd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Unreleased Changes
* Fixed a crash due to a race condition when listing
directory contents.

* For improved backwards compatibility, SSHFS now also silently
accepts the old ``-o cache_*`` options.

Release 3.0.0 (2017-07-08)
--------------------------

Expand Down
13 changes: 13 additions & 0 deletions cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,19 @@ static const struct fuse_opt cache_opts[] = {
clean_interval_secs), 0 },
{ "dcache_min_clean_interval=%u", offsetof(struct cache,
min_clean_interval_secs), 0 },

/* For backwards compatibility */
{ "cache_timeout=%u", offsetof(struct cache, stat_timeout_secs), 0 },
{ "cache_timeout=%u", offsetof(struct cache, dir_timeout_secs), 0 },
{ "cache_timeout=%u", offsetof(struct cache, link_timeout_secs), 0 },
{ "cache_stat_timeout=%u", offsetof(struct cache, stat_timeout_secs), 0 },
{ "cache_dir_timeout=%u", offsetof(struct cache, dir_timeout_secs), 0 },
{ "cache_link_timeout=%u", offsetof(struct cache, link_timeout_secs), 0 },
{ "cache_max_size=%u", offsetof(struct cache, max_size), 0 },
{ "cache_clean_interval=%u", offsetof(struct cache,
clean_interval_secs), 0 },
{ "cache_min_clean_interval=%u", offsetof(struct cache,
min_clean_interval_secs), 0 },
FUSE_OPT_END
};

Expand Down
6 changes: 6 additions & 0 deletions sshfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,13 @@ static struct fuse_opt sshfs_opts[] = {
FUSE_OPT_KEY("-p ", KEY_PORT),
FUSE_OPT_KEY("-C", KEY_COMPRESS),
FUSE_OPT_KEY("-F ", KEY_CONFIGFILE),

/* For backwards compatibility */
SSHFS_OPT("cache=yes", dir_cache, 1),
SSHFS_OPT("cache=no", dir_cache, 0),

FUSE_OPT_END

};

static struct fuse_opt workaround_opts[] = {
Expand Down

0 comments on commit 63300fd

Please sign in to comment.