From 4eef8e74c9308dc814d02dc3632e3cf1b8823961 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 10 Nov 2004 11:17:22 +0000 Subject: [PATCH] fix --- Filesystems | 12 ++++++++++++ include/fuse.h | 10 +++++----- kernel/dev.c | 4 +++- kernel/dir.c | 14 +++++++++----- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/Filesystems b/Filesystems index 3ca82dc..4ddd427 100644 --- a/Filesystems +++ b/Filesystems @@ -199,3 +199,15 @@ Description: filesystem, and libgmail to communicate with Gmail. ============================================================================== +Name: DataDraw + +Author: Bill Cox + +Homepage: http://www.viasic.com/opensource/ + +Description: + + This is an EDA specific data structure diagramming and code + generation tool. + +============================================================================== diff --git a/include/fuse.h b/include/fuse.h index 705c4fd..a604f7a 100644 --- a/include/fuse.h +++ b/include/fuse.h @@ -27,6 +27,10 @@ #include #include +#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... * * ----------------------------------------------------------- */ diff --git a/kernel/dev.c b/kernel/dev.c index c783ead..c87d6c4 100644 --- a/kernel/dev.c +++ b/kernel/dev.c @@ -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 diff --git a/kernel/dir.c b/kernel/dir.c index 36eb3bf..bce4526 100644 --- a/kernel/dir.c +++ b/kernel/dir.c @@ -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); -- 2.30.2