From 4b2bef463b46effc57a87f3c7a9cbc5a70602668 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 9 Jan 2002 12:23:27 +0000 Subject: [PATCH] fixes --- ChangeLog | 9 +++++++++ kernel/dir.c | 3 +-- lib/fuse.c | 5 +++-- python/Makefile | 2 +- python/_fusemodule.c | 7 ++++--- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index f00aae0..032bdd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-01-09 Miklos Szeredi + + * Revaidate all path components not just the last, this means a + very small performance penalty for being more up-to-date. + +2002-01-08 Miklos Szeredi + + * Update and fix python interface + 2002-01-07 Mark Glines * Added statfs() support to kernel, lib, examples, and perl! diff --git a/kernel/dir.c b/kernel/dir.c index 7068d37..2ebd2a1 100644 --- a/kernel/dir.c +++ b/kernel/dir.c @@ -601,8 +601,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, int flags) return 0; /* Must not revaidate too soon, since kernel revalidate logic is broken, and could return ENOENT */ - else if(!(flags & LOOKUP_CONTINUE) && - time_after(jiffies, entry->d_time + FUSE_REVALIDATE_TIME)) + else if(time_after(jiffies, entry->d_time + FUSE_REVALIDATE_TIME)) return 0; else return 1; diff --git a/lib/fuse.c b/lib/fuse.c index 88f3eae..63dadf5 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -548,7 +548,7 @@ static void do_readlink(struct fuse *f, struct fuse_in_header *in) free(path); } link[PATH_MAX] = '\0'; - send_reply(f, in, res, link, !res ? strlen(link) : 0); + send_reply(f, in, res, link, res == 0 ? strlen(link) : 0); } static void do_getdir(struct fuse *f, struct fuse_in_header *in) @@ -812,8 +812,9 @@ static void do_statfs(struct fuse *f, struct fuse_in_header *in) res = -ENOSYS; if(f->op.statfs) res = f->op.statfs(&sbuf); - if(!res) + if(res == 0) convert_statfs(&sbuf,&arg.st); + send_reply(f, in, res, &arg, sizeof(arg)); } diff --git a/python/Makefile b/python/Makefile index 8b7ea80..12393e7 100644 --- a/python/Makefile +++ b/python/Makefile @@ -1,5 +1,5 @@ _fusemodule.so: _fusemodule.c - gcc -g3 -I/usr/include/python1.5 _fusemodule.c -Wl,-shared -o _fusemodule.so -Wimplicit -lfuse && python -c 'import _fuse' + gcc -g3 -I/usr/include/python2.1 _fusemodule.c -Wl,-shared -o _fusemodule.so -Wimplicit -lfuse && python -c 'import _fuse' clean: rm -f _fusemodule.so *.pyc *.pyo diff --git a/python/_fusemodule.c b/python/_fusemodule.c index d4dd0ff..6956be2 100644 --- a/python/_fusemodule.c +++ b/python/_fusemodule.c @@ -279,7 +279,9 @@ Fuse_main(PyObject *self, PyObject *args, PyObject *kw) "mkdir", "unlink", "rmdir", "symlink", "rename", "link", "chmod", "chown", "truncate", "utime", "open", "read", "write", "flags", "multithreaded", NULL}; - + + memset(&op, 0, sizeof(op)); + if (!PyArg_ParseTupleAndKeywords(args, kw, "|OOOOOOOOOOOOOOOOOii", kwlist, &getattr_cb, &readlink_cb, &getdir_cb, &mknod_cb, &mkdir_cb, &unlink_cb, &rmdir_cb, &symlink_cb, &rename_cb, @@ -307,8 +309,7 @@ Fuse_main(PyObject *self, PyObject *args, PyObject *kw) DO_ONE_ATTR(read); DO_ONE_ATTR(write); - fuse = fuse_new(0, flags); - fuse_set_operations(fuse, &op); + fuse = fuse_new(0, flags, &op); if(multithreaded) pyfuse_loop_mt(fuse); else -- 2.30.2