From 1b188024c85b135154405f78a2caef82317e550d Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Thu, 28 Jul 2005 11:07:29 +0000 Subject: [PATCH] fix --- kernel/configure.ac | 2 +- kernel/dir.c | 2 ++ kernel/file.c | 9 +++------ kernel/fuse_i.h | 1 + kernel/inode.c | 5 ++++- lib/fuse.c | 4 ++-- lib/fuse_lowlevel.c | 2 +- lib/fuse_mt.c | 2 +- util/fusermount.c | 4 ++-- 9 files changed, 17 insertions(+), 14 deletions(-) diff --git a/kernel/configure.ac b/kernel/configure.ac index 2723693..30e4a10 100644 --- a/kernel/configure.ac +++ b/kernel/configure.ac @@ -91,7 +91,7 @@ if test "$ENABLE_FUSE_MODULE" = y; then KERNELMAKE_PARAMS= KERNELCPPFLAGS= AC_MSG_CHECKING([if this is user mode linux]) - if test -f $kernelsrc/include/linux/autoconf.h && grep -q "^#define CONFIG_USERMODE 1" $kernelsrc/include/linux/autoconf.h; then + if test -f $kernelsrc/include/linux/autoconf.h && egrep -q "^#define CONFIG_(USERMODE|UML) 1" $kernelsrc/include/linux/autoconf.h; then isuml=yes KERNELMAKE_PARAMS="ARCH=um" KERNELCPPFLAGS="-D__arch_um__ -DSUBARCH=\\\"i386\\\" -D_LARGEFILE64_SOURCE -I${kernelsrc}/arch/um/include -Derrno=kernel_errno -I${kernelsrc}/arch/um/kernel/tt/include -I${kernelsrc}/arch/um/kernel/skas/include" diff --git a/kernel/dir.c b/kernel/dir.c index 99192c3..2aa16e9 100644 --- a/kernel/dir.c +++ b/kernel/dir.c @@ -581,6 +581,7 @@ static int fuse_readdir(struct file *file, void *dstbuf, filldir_t filldir) filldir); __free_page(page); + fuse_invalidate_attr(inode); /* atime changed */ return err; } @@ -614,6 +615,7 @@ static char *read_link(struct dentry *dentry) link[req->out.args[0].size] = '\0'; out: fuse_put_request(fc, req); + fuse_invalidate_attr(inode); /* atime changed */ return link; } diff --git a/kernel/file.c b/kernel/file.c index 02dc9f0..9cf7413 100644 --- a/kernel/file.c +++ b/kernel/file.c @@ -248,8 +248,7 @@ static int fuse_readpage(struct file *file, struct page *page) fuse_put_request(fc, req); if (!err) SetPageUptodate(page); - if (!(inode->i_sb->s_flags & MS_NOATIME)) - fuse_invalidate_attr(inode); + fuse_invalidate_attr(inode); /* atime changed */ out: unlock_page(page); return err; @@ -270,8 +269,6 @@ static int fuse_send_readpages(struct fuse_req *req, struct file *file, SetPageUptodate(page); unlock_page(page); } - if (!(inode->i_sb->s_flags & MS_NOATIME)) - fuse_invalidate_attr(inode); return req->out.h.error; } @@ -321,6 +318,7 @@ static int fuse_readpages(struct file *file, struct address_space *mapping, if (!err && data.req->num_pages) err = fuse_send_readpages(data.req, file, inode); fuse_put_request(fc, data.req); + fuse_invalidate_attr(inode); /* atime changed */ return err; } #else /* KERNEL_2_6 */ @@ -582,8 +580,7 @@ static ssize_t fuse_direct_io(struct file *file, const char __user *buf, i_size_write(inode, pos); *ppos = pos; } - if (write || !(inode->i_sb->s_flags & MS_NOATIME)) - fuse_invalidate_attr(inode); + fuse_invalidate_attr(inode); return res; } diff --git a/kernel/fuse_i.h b/kernel/fuse_i.h index 6b7ba16..be20e74 100644 --- a/kernel/fuse_i.h +++ b/kernel/fuse_i.h @@ -11,6 +11,7 @@ #else #include "fuse_kernel.h" #include +#include #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #error Kernel version 2.5.* not supported diff --git a/kernel/inode.c b/kernel/inode.c index e256cd7..60c5ade 100644 --- a/kernel/inode.c +++ b/kernel/inode.c @@ -540,7 +540,7 @@ static struct inode *get_root_inode(struct super_block *sb, unsigned mode) attr.ino = FUSE_ROOT_ID; return fuse_iget(sb, 1, 0, &attr); } - +#ifndef FUSE_MAINLINE #ifdef KERNEL_2_6 static struct dentry *fuse_get_dentry(struct super_block *sb, void *vobjp) { @@ -603,6 +603,7 @@ static struct export_operations fuse_export_operations = { .encode_fh = fuse_encode_fh, }; #endif +#endif static struct super_operations fuse_super_operations = { .alloc_inode = fuse_alloc_inode, @@ -630,8 +631,10 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent) sb->s_magic = FUSE_SUPER_MAGIC; sb->s_op = &fuse_super_operations; sb->s_maxbytes = MAX_LFS_FILESIZE; +#ifndef FUSE_MAINLINE #ifdef KERNEL_2_6 sb->s_export_op = &fuse_export_operations; +#endif #endif file = fget(d.fd); diff --git a/lib/fuse.c b/lib/fuse.c index 0ee4ab4..a00ef1a 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -95,7 +95,7 @@ struct node { struct fuse_dirhandle { pthread_mutex_t lock; struct fuse *fuse; - unsigned char *contents; + char *contents; int allocated; unsigned len; unsigned needlen; @@ -1231,7 +1231,7 @@ static int fill_dir_common(struct fuse_dirhandle *dh, const char *name, unsigned namelen = strlen(name); unsigned entsize; unsigned newlen; - unsigned char *newptr; + char *newptr; if (stat) stbuf = *stat; diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index 7f92d04..d875664 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -653,7 +653,7 @@ static void do_setxattr(fuse_req_t req, fuse_ino_t nodeid, struct fuse_setxattr_in *arg) { char *name = PARAM(arg); - unsigned char *value = name + strlen(name) + 1; + char *value = name + strlen(name) + 1; if (req->f->op.setxattr) req->f->op.setxattr(req, nodeid, name, value, arg->size, diff --git a/lib/fuse_mt.c b/lib/fuse_mt.c index c9d85a8..bbd0392 100644 --- a/lib/fuse_mt.c +++ b/lib/fuse_mt.c @@ -77,8 +77,8 @@ struct procdata { static void mt_generic_proc(struct fuse_ll *f, struct fuse_cmd *cmd, void *data) { - (void) f; struct procdata *pd = (struct procdata *) data; + (void) f; pd->proc(pd->f, cmd, pd->data); } diff --git a/util/fusermount.c b/util/fusermount.c index 1fe3127..9c7bbf3 100644 --- a/util/fusermount.c +++ b/util/fusermount.c @@ -824,8 +824,8 @@ static int mount_fuse(const char *mnt, const char *opts) char *dev; const char *type = "fuse"; struct stat stbuf; - char *fsname; - char *mnt_opts; + char *fsname = NULL; + char *mnt_opts = NULL; const char *real_mnt = mnt; int currdir_fd = -1; int mountpoint_fd = -1; -- 2.30.2