fix
authorMiklos Szeredi <miklos@szeredi.hu>
Wed, 10 Nov 2004 11:17:22 +0000 (11:17 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Wed, 10 Nov 2004 11:17:22 +0000 (11:17 +0000)
Filesystems
include/fuse.h
kernel/dev.c
kernel/dir.c

index 3ca82dcb73a4c0d942b24814a53949e35f7158da..4ddd427b6388cc5e6d6d2f7bf19fef64b05b4aa7 100644 (file)
@@ -199,3 +199,15 @@ Description:
   filesystem, and libgmail to communicate with Gmail.
 
 ==============================================================================
+Name: DataDraw
+
+Author: Bill Cox <bill (at) viasic (dot) com>
+
+Homepage: http://www.viasic.com/opensource/
+
+Description:
+
+  This is an EDA specific data structure diagramming and code
+  generation tool.
+
+==============================================================================
index 705c4fdb6de6e7c647aa20e41834b332196132c5..a604f7aecc1e9f46f9fa47f3684df525f4b7d6c1 100644 (file)
 #include <sys/statfs.h>
 #include <utime.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* ----------------------------------------------------------- *
  * Basic FUSE API                                              *
  * ----------------------------------------------------------- */
@@ -137,12 +141,9 @@ struct fuse_context {
     uid_t uid;
     gid_t gid;
     pid_t pid;
+    void *private_data;
 };
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*
  * Main function of FUSE.
  *
@@ -271,7 +272,6 @@ int fuse_invalidate(struct fuse *f, const char *path);
  */
 int fuse_is_lib_option(const char *opt);
 
-
 /* ----------------------------------------------------------- *
  * Advanced API for event handling, don't worry about this...  *
  * ----------------------------------------------------------- */
index c783ead3e8da4c582ce0a54ead19e04cc7d898f0..c87d6c48ebf3bb2da0c5687fdbfd8b5c8a7bbe8c 100644 (file)
@@ -78,12 +78,14 @@ static void request_wait_answer(struct fuse_req *req, int interruptible)
                return;
 
        /* Request interrupted... Wait for it to be unlocked */
-       if (req->locked) {
+       while (req->locked) {
                req->interrupted = 1;
                spin_unlock(&fuse_lock);
                wait_event(req->waitq, !req->locked);
                spin_lock(&fuse_lock);
        }
+       if (req->finished)
+               return;
        
        /* Operations which modify the filesystem cannot safely be
           restarted, because it is uncertain whether the operation has
index 36eb3bf3c62e4ce4c4b40194922a64f7eb3415af..bce45267b8c9cb34198ea7136159001f07e72ab2 100644 (file)
@@ -72,12 +72,17 @@ static void fuse_init_inode(struct inode *inode, struct fuse_attr *attr)
                inode->i_op = &fuse_symlink_inode_operations;
        }
        else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode) || 
-                S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)){
+                S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) {
                inode->i_op = &fuse_file_inode_operations;
                init_special_inode(inode, inode->i_mode,
                                   new_decode_dev(attr->rdev));
-       } else
+       } else {
+               /* Don't let user create weird files */
                printk("fuse_init_inode: bad file type: %o\n", inode->i_mode);
+               inode->i_mode = S_IFREG;
+               inode->i_op = &fuse_file_inode_operations;
+               fuse_init_file_inode(inode);
+       }
 }
 
 struct inode *fuse_iget(struct super_block *sb, ino_t ino, int generation,
@@ -220,7 +225,7 @@ static int lookup_new_entry(struct fuse_conn *fc, struct fuse_req *req,
        if ((inode->i_mode ^ mode) & S_IFMT) {
                iput(inode);
                printk("fuse_mknod: inode has wrong type\n");
-               return -EINVAL;
+               return -EPROTO;
        }
 
        entry->d_time = time_to_jiffies(outarg->entry_valid,
@@ -537,7 +542,7 @@ static int _fuse_permission(struct inode *inode, int mask)
 
                /* FIXME: Need some mechanism to revoke permissions:
                   currently if the filesystem suddenly changes the
-                  file mode, we will not be informed abot that, and
+                  file mode, we will not be informed about it, and
                   continue to allow access to the file/directory.
                   
                   This is actually not so grave, since the user can
@@ -780,7 +785,6 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr)
                        send_sig(SIGXFSZ, current, 0);
                        return -EFBIG;
                }
-               //fuse_sync_inode(inode);
        }
 
        req = fuse_get_request(fc);