cleanups + new release candidate fuse_2_6_0_rc3
authorMiklos Szeredi <miklos@szeredi.hu>
Mon, 16 Oct 2006 09:06:26 +0000 (09:06 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Mon, 16 Oct 2006 09:06:26 +0000 (09:06 +0000)
ChangeLog
configure.in
kernel/configure.ac
kernel/dev.c
kernel/dir.c
kernel/file.c
kernel/fuse_i.h
kernel/inode.c

index 5e86b3b3394d2525084da3c54af3df9a762b44a3..31fb4161d7c815638a771bc2b96e1805c35f7b5f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-10-16  Miklos Szeredi <miklos@szeredi.hu>
+
+       * Released 2.6.0-rc3
+
+2006-10-15  Miklos Szeredi <miklos@szeredi.hu>
+
+       * kernel: cleanups
+
 2006-10-13  Miklos Szeredi <miklos@szeredi.hu>
 
        * kernel: Fix compilation on patched 2.6.18 (fc6) and 2.6.19.
index ec02ea4e74a75eceef18f41e7a693aaf2c3fcb36..1361670260a07304b130a6cdfd985111e2c3d0fb 100644 (file)
@@ -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)
index bf4c8cdb9d8da3fe79eb78efe88df5ca0c1cd6ef..c99cb523003572ed8075ada572b97d3c6d558c11 100644 (file)
@@ -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
index c96d0cc8e6b34f4d40fb8d8a225856170d0ae1b3..252fe5c1790a94999197b7ebf382f8456207a52e 100644 (file)
@@ -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,
index b45d5140cb84724ec5751656981c9b3083a0cdba..b7305a238bb712bbeadd8f37824c6bb69113c52c 100644 (file)
@@ -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);
index 04700694cf5d01bbe0f7d18664710f31a75d41c8..6f941ada73542ccd1917ec8f6923dcffc0bcf3f9 100644 (file)
@@ -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,
index 22f75149c598fadffb0ec8b066b70b61e4ff10b4..f5b26f24da990e85c0ca35709e8c8581e6e37573 100644 (file)
 #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
 
index d70141b541704ec5cb396a22636a00d85bf2c2e9..2b6d0a371e9ea5072844e6b641a8008612063a60 100644 (file)
@@ -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;
        }
 }