From 12e5c98d0606df60ee198de0f394f0c5d4c7caaa Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Mon, 16 Oct 2006 09:06:26 +0000 Subject: [PATCH] cleanups + new release candidate --- ChangeLog | 8 ++++++++ configure.in | 2 +- kernel/configure.ac | 2 +- kernel/dev.c | 8 ++++---- kernel/dir.c | 39 ++++++++++++++++++++++----------------- kernel/file.c | 8 ++++---- kernel/fuse_i.h | 11 ----------- kernel/inode.c | 7 ++----- 8 files changed, 42 insertions(+), 43 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e86b3b..31fb416 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-10-16 Miklos Szeredi + + * Released 2.6.0-rc3 + +2006-10-15 Miklos Szeredi + + * kernel: cleanups + 2006-10-13 Miklos Szeredi * kernel: Fix compilation on patched 2.6.18 (fc6) and 2.6.19. diff --git a/configure.in b/configure.in index ec02ea4..1361670 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -AC_INIT(fuse, 2.6.0-rc2) +AC_INIT(fuse, 2.6.0-rc3) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE AM_CONFIG_HEADER(include/config.h) diff --git a/kernel/configure.ac b/kernel/configure.ac index bf4c8cd..c99cb52 100644 --- a/kernel/configure.ac +++ b/kernel/configure.ac @@ -1,4 +1,4 @@ -AC_INIT(fuse-kernel, 2.6.0-rc2) +AC_INIT(fuse-kernel, 2.6.0-rc3) AC_CONFIG_HEADERS([config.h]) AC_PROG_INSTALL diff --git a/kernel/dev.c b/kernel/dev.c index c96d0cc..252fe5c 100644 --- a/kernel/dev.c +++ b/kernel/dev.c @@ -1074,10 +1074,10 @@ struct file_operations fuse_dev_operations = { .write = fuse_dev_write, .writev = fuse_dev_writev, #else - .read = do_sync_read, - .aio_read = fuse_dev_read, - .write = do_sync_write, - .aio_write = fuse_dev_write, + .read = do_sync_read, + .aio_read = fuse_dev_read, + .write = do_sync_write, + .aio_write = fuse_dev_write, #endif .poll = fuse_dev_poll, .release = fuse_dev_release, diff --git a/kernel/dir.c b/kernel/dir.c index b45d514..b7305a2 100644 --- a/kernel/dir.c +++ b/kernel/dir.c @@ -196,6 +196,20 @@ static int valid_mode(int m) S_ISBLK(m) || S_ISFIFO(m) || S_ISSOCK(m); } +static struct dentry *fuse_d_add_directory(struct dentry *entry, + struct inode *inode) +{ + struct dentry *alias = d_find_alias(inode); + if (alias && !(alias->d_flags & DCACHE_DISCONNECTED)) { + fuse_invalidate_entry(alias); + dput(alias); + if (!list_empty(&inode->i_dentry)) + return ERR_PTR(-EBUSY); + } else + dput(alias); + return d_splice_alias(inode, entry); +} + static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry, struct nameidata *nd) { @@ -233,21 +247,13 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry, return ERR_PTR(err); if (inode && S_ISDIR(inode->i_mode)) { - struct dentry *alias; mutex_lock(&fc->inst_mutex); - alias = d_find_alias(inode); - if (alias && !(alias->d_flags & DCACHE_DISCONNECTED)) { - fuse_invalidate_entry(alias); - dput(alias); - if (!list_empty(&inode->i_dentry)) { - mutex_unlock(&fc->inst_mutex); - iput(inode); - return ERR_PTR(-EBUSY); - } - } else - dput(alias); - newent = d_splice_alias(inode, entry); + newent = fuse_d_add_directory(entry, inode); mutex_unlock(&fc->inst_mutex); + if (IS_ERR(newent)) { + iput(inode); + return newent; + } } else newent = d_splice_alias(inode, entry); @@ -418,8 +424,7 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req, mutex_unlock(&fc->inst_mutex); dput(alias); iput(inode); - fuse_invalidate_entry(entry); - return 0; + return -EBUSY; } d_instantiate(entry, inode); mutex_unlock(&fc->inst_mutex); @@ -1036,6 +1041,8 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr) if (attr->ia_valid & ATTR_SIZE) { unsigned long limit; is_truncate = 1; + if (IS_SWAPFILE(inode)) + return -ETXTBSY; #ifdef KERNEL_2_6_10_PLUS limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur; #else @@ -1045,8 +1052,6 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr) send_sig(SIGXFSZ, current, 0); return -EFBIG; } - if (IS_SWAPFILE(inode)) - return -ETXTBSY; } req = fuse_get_req(fc); diff --git a/kernel/file.c b/kernel/file.c index 0470069..6f941ad 100644 --- a/kernel/file.c +++ b/kernel/file.c @@ -853,10 +853,10 @@ static struct file_operations fuse_file_operations = { .read = generic_file_read, .write = generic_file_write, #else - .read = do_sync_read, - .aio_read = generic_file_aio_read, - .write = do_sync_write, - .aio_write = generic_file_aio_write, + .read = do_sync_read, + .aio_read = generic_file_aio_read, + .write = do_sync_write, + .aio_write = generic_file_aio_write, #endif .mmap = fuse_file_mmap, .open = fuse_open, diff --git a/kernel/fuse_i.h b/kernel/fuse_i.h index 22f7514..f5b26f2 100644 --- a/kernel/fuse_i.h +++ b/kernel/fuse_i.h @@ -71,17 +71,6 @@ #define inc_nlink(inode) (inode)->i_nlink++ #endif -#ifndef BUG_ON -#define BUG_ON(x) -#endif -#ifndef container_of -#define container_of(ptr, type, member) ({ \ - const typeof( ((type *)0)->member ) *__mptr = (ptr); \ - (type *)( (char *)__mptr - offsetof(type,member) );}) -#endif -#ifndef __user -#define __user -#endif /** Max number of pages that can be used in a single read request */ #define FUSE_MAX_PAGES_PER_REQ 32 diff --git a/kernel/inode.c b/kernel/inode.c index d70141b..2b6d0a3 100644 --- a/kernel/inode.c +++ b/kernel/inode.c @@ -107,11 +107,8 @@ static void fuse_clear_inode(struct inode *inode) if (inode->i_sb->s_flags & MS_ACTIVE) { struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_inode *fi = get_fuse_inode(inode); - if (fi->nlookup) { - fuse_send_forget(fc, fi->forget_req, fi->nodeid, - fi->nlookup); - fi->forget_req = NULL; - } + fuse_send_forget(fc, fi->forget_req, fi->nodeid, fi->nlookup); + fi->forget_req = NULL; } } -- 2.30.2