Compare commits

..

24 Commits

Author SHA1 Message Date
Miklos Szeredi 666119d285 fix 2006-03-09 20:03:16 +00:00
Miklos Szeredi f3e8d58bd7 new release 2006-03-09 19:43:13 +00:00
Miklos Szeredi 326ff7f97e fix 2006-03-09 11:25:15 +00:00
Miklos Szeredi 7f4eaea507 fix 2006-03-08 14:32:16 +00:00
Miklos Szeredi 57fc3f4b6a fix 2006-02-24 11:42:40 +00:00
Miklos Szeredi b436754a11 fix 2006-02-23 21:31:41 +00:00
Miklos Szeredi e277fe1ca2 fix 2006-02-23 16:20:55 +00:00
Miklos Szeredi c9c9e9dfbd fix 2006-02-22 16:23:42 +00:00
Miklos Szeredi 3cfb3a6dab new release 2006-02-20 12:11:23 +00:00
Miklos Szeredi 790bb8dd36 fix 2006-02-20 11:44:36 +00:00
Miklos Szeredi accc218cdb revert making rename workaround on by default 2006-02-20 11:32:45 +00:00
Miklos Szeredi 8468900705 fix 2006-02-16 17:02:25 +00:00
Miklos Szeredi b60a970602 fix 2006-02-16 11:51:27 +00:00
Miklos Szeredi 27c1b7b09d fix 2006-02-02 12:07:14 +00:00
Miklos Szeredi 6f0233e11e fix 2006-02-01 15:50:44 +00:00
Miklos Szeredi 89da93d07e fix 2006-01-31 18:34:38 +00:00
Miklos Szeredi cb4239036a fix 2006-01-30 11:05:40 +00:00
Miklos Szeredi 40393a4b0b fix 2006-01-30 09:47:02 +00:00
Miklos Szeredi a6e0d2ddd9 fix 2006-01-27 16:30:55 +00:00
Miklos Szeredi 1cb9aba6ea fix 2006-01-27 12:49:14 +00:00
Miklos Szeredi 3883b4eb0c fix 2006-01-25 14:47:07 +00:00
Miklos Szeredi f1f738d5b8 fix 2006-01-23 17:03:25 +00:00
Miklos Szeredi d2a3ed327e fix 2006-01-20 16:29:23 +00:00
Miklos Szeredi cd6a924cdc fix 2006-01-18 14:05:48 +00:00
10 changed files with 794 additions and 204 deletions
+92
View File
@@ -1,3 +1,95 @@
2006-03-09 Miklos Szeredi <miklos@szeredi.hu>
* Released 1.6
2006-03-09 Miklos Szeredi <miklos@szeredi.hu>
* Fix segfault if remote host is down and reconnection is enabled
2006-03-08 Miklos Szeredi <miklos@szeredi.hu>
* Fix bug in symlink transformation. Reported by Ralf Hoffmann
2006-02-24 Miklos Szeredi <miklos@szeredi.hu>
* Add workaround for broken truncate on old sftp servers. Can be
enabled with '-oworkaround=truncate'. Patch from Joseph M Link
2006-02-23 Miklos Szeredi <miklos@szeredi.hu>
* Avoid double memcpy on writes. Patch by Joseph M Link
* More memory copy avoidance
2006-02-22 Miklos Szeredi <miklos@szeredi.hu>
* Add -fPIC to the comile flags of sshnodelay.so. Reported by
Anthony Kolasny
2006-02-20 Miklos Szeredi <miklos@szeredi.hu>
* Released 1.5
2006-02-19 Miklos Szeredi <miklos@szeredi.hu>
* Fix compilation with old FUSE versions. Report by Kurt George
Gjerde
2006-02-16 Miklos Szeredi <miklos@szeredi.hu>
* Block TERM/INT/HUP/QUIT signals in sshfs reading thread, so they
will always be received by the FUSE main thread. Fixes the
"double ^C" problem seen on FreeBSD.
* Use 'auto_cache' option if available, so that file cache is not
thrown away on each open. This should make repeated reading of a
file much much faster.
2006-01-31 Miklos Szeredi <miklos@szeredi.hu>
* Fix problems with nodelay workaround on FreeBSD.
2006-01-30 Miklos Szeredi <miklos@szeredi.hu>
* Fix data consitency bug if readahead is enabled and writes are
intermixed with reads. Solution is far from optimal, since it
will prevent readahead in the above situation. If used with FUSE
>= 2.6.0 with Linux-2.6.X, readahead will be done by the kernel,
and hence there will be no performance penalty. Bug reported and
test program written by Wolfgang Köbler. Further testing on
FreeBSD by Csaba Henk
2006-01-29 Miklos Szeredi <miklos@szeredi.hu>
* Add '-olarge_read' option for Linux-2.4.*. This should
generally improve download performance
2006-01-27 Miklos Szeredi <miklos@szeredi.hu>
* Add workaround (enabled by default) for ssh clients not setting
TCP_NODELAY on the network connection. Currently this is all
known versions of openssh. This may improve download speed in
some circumstances
* Make it possible to idividually disable workarounds with a "no"
prefix
* Change '-otransform_symlinks' not to prefix with the mountpoint
(which is fragile wrt. moving/binding the mount). Rather convert
absolute symlinks to relative if possible. Does not yet work if
base path is itself relative
2006-01-25 Miklos Szeredi <miklos@szeredi.hu>
* Use TCP_NODELAY socket option for direct connection. This may
improve download speed in some circumstances
2006-01-20 Miklos Szeredi <miklos@szeredi.hu>
* Update to fuse API 2.6
* Don't do readahead in sshfs if it's done in kernel
2006-01-14 Miklos Szeredi <miklos@szeredi.hu>
* Released 1.4
+20 -3
View File
@@ -2,9 +2,26 @@
bin_PROGRAMS = sshfs
sshfs_SOURCES = sshfs.c cache.c cache.h
if FUSE_OPT_COMPAT
compat_sources = compat/fuse_opt.c compat/fuse_opt.h
sshfs_SOURCES += compat/fuse_opt.c compat/fuse_opt.h
endif
sshfs_SOURCES = sshfs.c cache.c cache.h $(compat_sources)
sshfs_CPPFLAGS = -DFUSE_USE_VERSION=25
sshfs_LDADD = $(SSHFS_LIBS)
sshfs_CFLAGS = $(SSHFS_CFLAGS)
sshfs_CPPFLAGS = -D_REENTRANT -DFUSE_USE_VERSION=26 -DLIBDIR=\"$(libdir)\"
EXTRA_DIST = sshnodelay.c
CLEANFILES = sshnodelay.so
all-local: sshnodelay.so
install-exec-local: sshnodelay.so
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
$(INSTALL) -m 755 sshnodelay.so "$(DESTDIR)$(libdir)/sshnodelay.so"
uninstall-local:
rm -f "$(DESTDIR)$(libdir)/sshnodelay.so"
sshnodelay.so:
$(CC) -Wall -W -s --shared -fPIC $(sshnodelay_libs) sshnodelay.c -o sshnodelay.so
+19
View File
@@ -1,3 +1,22 @@
What is new in 1.6
------------------
* Workaround for missing truncate operation on old sftp servers
* Bug fixes
What is new in 1.5
------------------
* Improvements to read performance. Now both read and write
throughput should be very close to 'scp'
* If used with FUSE 2.6.0 or later, then perform better data caching.
This should show dramatic speed improvements when a file is opened
more than once
* Bug fixes
What is new in 1.4
------------------
+2 -2
View File
@@ -101,7 +101,7 @@ static void cache_purge_parent(const char *path)
}
}
static void cache_invalidate(const char *path)
void cache_invalidate(const char *path)
{
pthread_mutex_lock(&cache.lock);
cache_purge(path);
@@ -137,7 +137,7 @@ static struct node *cache_get(const char *path)
return node;
}
static void cache_add_attr(const char *path, const struct stat *stbuf)
void cache_add_attr(const char *path, const struct stat *stbuf)
{
struct node *node;
time_t now;
+2
View File
@@ -24,3 +24,5 @@ struct fuse_cache_operations {
struct fuse_operations *cache_init(struct fuse_cache_operations *oper);
int cache_parse_options(struct fuse_args *args);
void cache_add_attr(const char *path, const struct stat *stbuf);
void cache_invalidate(const char *path);
+30 -25
View File
@@ -62,6 +62,21 @@ int fuse_opt_add_arg(struct fuse_args *args, const char *arg)
return 0;
}
int fuse_opt_insert_arg(struct fuse_args *args, int pos, const char *arg)
{
assert(pos <= args->argc);
if (fuse_opt_add_arg(args, arg) == -1)
return -1;
if (pos != args->argc - 1) {
char *newarg = args->argv[args->argc - 1];
memmove(&args->argv[pos + 1], &args->argv[pos],
sizeof(char *) * (args->argc - pos - 1));
args->argv[pos] = newarg;
}
return 0;
}
static int next_arg(struct fuse_opt_context *ctx, const char *opt)
{
if (ctx->argctr + 1 >= ctx->argc) {
@@ -102,25 +117,13 @@ static int add_opt(struct fuse_opt_context *ctx, const char *opt)
return fuse_opt_add_opt(&ctx->opts, opt);
}
static int insert_arg(struct fuse_opt_context *ctx, int pos, const char *arg)
{
assert(pos <= ctx->outargs.argc);
if (add_arg(ctx, arg) == -1)
return -1;
if (pos != ctx->outargs.argc - 1) {
char *newarg = ctx->outargs.argv[ctx->outargs.argc - 1];
memmove(&ctx->outargs.argv[pos + 1], &ctx->outargs.argv[pos],
sizeof(char *) * (ctx->outargs.argc - pos - 1));
ctx->outargs.argv[pos] = newarg;
}
return 0;
}
static int call_proc(struct fuse_opt_context *ctx, const char *arg, int key,
int iso)
{
if (ctx->proc) {
if (key == FUSE_OPT_KEY_DISCARD)
return 0;
if (key != FUSE_OPT_KEY_KEEP && ctx->proc) {
int res = ctx->proc(ctx->data, arg, key, &ctx->outargs);
if (res == -1 || !res)
return res;
@@ -155,8 +158,8 @@ static int match_template(const char *t, const char *arg, unsigned *sepp)
static const struct fuse_opt *find_opt(const struct fuse_opt *opt,
const char *arg, unsigned *sepp)
{
for (; opt && opt->template; opt++)
if (match_template(opt->template, arg, sepp))
for (; opt && opt->templ; opt++)
if (match_template(opt->templ, arg, sepp))
return opt;
return NULL;
}
@@ -195,11 +198,11 @@ static int process_opt(struct fuse_opt_context *ctx,
return -1;
} else {
void *var = ctx->data + opt->offset;
if (sep && opt->template[sep + 1]) {
if (sep && opt->templ[sep + 1]) {
const char *param = arg + sep;
if (opt->template[sep] == '=')
if (opt->templ[sep] == '=')
param ++;
if (process_opt_param(var, opt->template + sep + 1,
if (process_opt_param(var, opt->templ + sep + 1,
param, arg) == -1)
return -1;
} else
@@ -239,7 +242,7 @@ static int process_gopt(struct fuse_opt_context *ctx, const char *arg, int iso)
if (opt) {
for (; opt; opt = find_opt(opt + 1, arg, &sep)) {
int res;
if (sep && opt->template[sep] == ' ' && !arg[sep])
if (sep && opt->templ[sep] == ' ' && !arg[sep])
res = process_opt_sep_arg(ctx, opt, sep, arg, iso);
else
res = process_opt(ctx, opt, sep, arg, iso);
@@ -321,12 +324,14 @@ static int opt_parse(struct fuse_opt_context *ctx)
return -1;
if (ctx->opts) {
if (insert_arg(ctx, 1, "-o") == -1 ||
insert_arg(ctx, 2, ctx->opts) == -1)
if (fuse_opt_insert_arg(&ctx->outargs, 1, "-o") == -1 ||
fuse_opt_insert_arg(&ctx->outargs, 2, ctx->opts) == -1)
return -1;
}
if (ctx->nonopt && ctx->nonopt == ctx->outargs.argc)
if (ctx->nonopt && ctx->nonopt == ctx->outargs.argc) {
free(ctx->outargs.argv[ctx->outargs.argc - 1]);
ctx->outargs.argv[--ctx->outargs.argc] = NULL;
}
return 0;
}
+36 -5
View File
@@ -72,7 +72,7 @@ extern "C" {
*/
struct fuse_opt {
/** Matching template and optional parameter formatting */
const char *template;
const char *templ;
/**
* Offset of variable within 'data' parameter of fuse_opt_parse()
@@ -82,7 +82,7 @@ struct fuse_opt {
/**
* Value to set the variable to, or to be passed as 'key' to the
* processing function. Ignored if template a format
* processing function. Ignored if template has a format
*/
int value;
};
@@ -91,13 +91,13 @@ struct fuse_opt {
* Key option. In case of a match, the processing function will be
* called with the specified key.
*/
#define FUSE_OPT_KEY(template, key) { template, -1U, key }
#define FUSE_OPT_KEY(templ, key) { templ, -1U, key }
/**
* Last option. An array of 'struct fuse_opt' must end with a NULL
* template value
*/
#define FUSE_OPT_END { .template = NULL }
#define FUSE_OPT_END { .templ = NULL }
/**
* Argument list
@@ -120,7 +120,7 @@ struct fuse_args {
/**
* Key value passed to the processing function if an option did not
* match any templated
* match any template
*/
#define FUSE_OPT_KEY_OPT -1
@@ -132,6 +132,22 @@ struct fuse_args {
*/
#define FUSE_OPT_KEY_NONOPT -2
/**
* Special key value for options to keep
*
* Argument is not passed to processing function, but behave as if the
* processing function returned 1
*/
#define FUSE_OPT_KEY_KEEP -3
/**
* Special key value for options to discard
*
* Argument is not passed to processing function, but behave as if the
* processing function returned zero
*/
#define FUSE_OPT_KEY_DISCARD -4
/**
* Processing function
*
@@ -201,6 +217,21 @@ int fuse_opt_add_opt(char **opts, const char *opt);
*/
int fuse_opt_add_arg(struct fuse_args *args, const char *arg);
/**
* Add an argument at the specified position in a NULL terminated
* argument vector
*
* Adds the argument to the N-th position. This is useful for adding
* options at the beggining of the array which must not come after the
* special '--' option.
*
* @param args is the structure containing the current argument list
* @param pos is the position at which to add the argument
* @param arg is the new argument to add
* @return -1 on allocation error, 0 on success
*/
int fuse_opt_insert_arg(struct fuse_args *args, int pos, const char *arg);
/**
* Free the contents of argument list
*
+8 -3
View File
@@ -1,12 +1,17 @@
AC_INIT(sshfs-fuse, 1.4)
AC_INIT(sshfs-fuse, 1.6)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
CFLAGS="$CFLAGS -Wall -W"
LIBS=
AC_SEARCH_LIBS(dlsym, [dl])
sshnodelay_libs=$LIBS
AC_SUBST(sshnodelay_libs)
LIBS=
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
PKG_CHECK_MODULES(SSHFS, [fuse >= 2.2 glib-2.0])
CFLAGS="$CFLAGS -Wall -W -D_REENTRANT $SSHFS_CFLAGS"
LIBS="$SSHFS_LIBS"
have_fuse_opt_parse=no
AC_CHECK_FUNC([fuse_opt_parse], [have_fuse_opt_parse=yes])
if test "$have_fuse_opt_parse" = no; then
+567 -166
View File
File diff suppressed because it is too large Load Diff
+18
View File
@@ -0,0 +1,18 @@
#define _GNU_SOURCE
#include <dlfcn.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
int connect(int sock, const struct sockaddr *addr, socklen_t addrlen)
{
int (*next_connect)(int, const struct sockaddr *, socklen_t) =
dlsym(RTLD_NEXT, "connect");
int res = next_connect(sock, addr, addrlen);
if (!res && addr->sa_family == AF_INET) {
int opt = 1;
setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
}
return res;
}