diff options
-rw-r--r-- | kernel/dev.c | 32 | ||||
-rw-r--r-- | kernel/dir.c | 52 | ||||
-rw-r--r-- | kernel/file.c | 87 | ||||
-rw-r--r-- | kernel/fuse_i.h | 19 | ||||
-rw-r--r-- | kernel/inode.c | 22 | ||||
-rw-r--r-- | kernel/util.c | 6 |
6 files changed, 110 insertions, 108 deletions
diff --git a/kernel/dev.c b/kernel/dev.c index 70a0013..48cf44a 100644 --- a/kernel/dev.c +++ b/kernel/dev.c @@ -68,7 +68,7 @@ static int get_unique(struct fuse_conn *fc) void fuse_reset_request(struct fuse_req *req) { int preallocated = req->preallocated; - + memset(req, 0, sizeof(*req)); INIT_LIST_HEAD(&req->list); init_waitqueue_head(&req->waitq); @@ -141,11 +141,11 @@ void request_send(struct fuse_conn *fc, struct fuse_req *req) { req->isreply = 1; req->end = NULL; - + spin_lock(&fuse_lock); req->out.h.error = -ENOTCONN; if (fc->file) { - req->in.h.unique = get_unique(fc); + req->in.h.unique = get_unique(fc); list_add_tail(&req->list, &fc->pending); wake_up(&fc->waitq); request_wait_answer(req); @@ -169,12 +169,12 @@ void request_send_noreply(struct fuse_conn *fc, struct fuse_req *req) } } -void request_send_async(struct fuse_conn *fc, struct fuse_req *req, +void request_send_async(struct fuse_conn *fc, struct fuse_req *req, fuse_reqend_t end) { req->end = end; req->isreply = 1; - + spin_lock(&fuse_lock); if (fc->file) { req->in.h.unique = get_unique(fc); @@ -239,7 +239,7 @@ static inline int copy_in_one(struct fuse_req *req, size_t argsize, printk("fuse_dev_read: buffer too small\n"); return -EINVAL; } - if (islast && req->in.argpages) + if (islast && req->in.argpages) return copy_in_pages(req, argsize, buf); else if (argsize && copy_to_user(buf, val, argsize)) return -EFAULT; @@ -254,7 +254,7 @@ static int copy_in_args(struct fuse_req *req, char __user *buf, size_t nbytes) struct fuse_in *in = &req->in; size_t orignbytes = nbytes; unsigned argsize; - + argsize = sizeof(in->h); err = copy_in_one(req, argsize, &in->h, 0, buf, nbytes); if (err) @@ -266,7 +266,7 @@ static int copy_in_args(struct fuse_req *req, char __user *buf, size_t nbytes) for (i = 0; i < in->numargs; i++) { struct fuse_in_arg *arg = &in->args[i]; int islast = (i == in->numargs - 1); - err = copy_in_one(req, arg->size, arg->value, islast, buf, + err = copy_in_one(req, arg->size, arg->value, islast, buf, nbytes); if (err) return err; @@ -407,7 +407,7 @@ static int copy_out_args(struct fuse_req *req, const char __user *buf, buf += sizeof(struct fuse_out_header); nbytes -= sizeof(struct fuse_out_header); - + if (!out->h.error) { for (i = 0; i < out->numargs; i++) { struct fuse_out_arg *arg = &out->args[i]; @@ -482,7 +482,7 @@ static int fuse_user_request(struct fuse_conn *fc, const char __user *buf, if (copy_from_user(&uh, buf, sizeof(struct fuse_user_header))) return -EFAULT; - + switch (uh.opcode) { case FUSE_INVALIDATE: err = fuse_invalidate(fc, &uh); @@ -493,7 +493,7 @@ static int fuse_user_request(struct fuse_conn *fc, const char __user *buf, } return err; } - + static ssize_t fuse_dev_write(struct file *file, const char __user *buf, size_t nbytes, loff_t *off) { @@ -501,7 +501,7 @@ static ssize_t fuse_dev_write(struct file *file, const char __user *buf, struct fuse_conn *fc = fuse_get_conn(file); struct fuse_req *req; struct fuse_out_header oh; - + if (!fc) return -ENODEV; @@ -512,7 +512,7 @@ static ssize_t fuse_dev_write(struct file *file, const char __user *buf, if (!oh.unique) { err = fuse_user_request(fc, buf, nbytes); goto out; - } + } if (oh.error <= -1000 || oh.error > 0) { printk("fuse_dev_write: bad error value\n"); @@ -537,7 +537,7 @@ static ssize_t fuse_dev_write(struct file *file, const char __user *buf, /* fget() needs to be done in this context */ if (req->in.h.opcode == FUSE_GETDIR && !oh.error) process_getdir(req); - } + } req->finished = 1; /* Unlocks fuse_lock: */ request_end(fc, req); @@ -652,7 +652,7 @@ static void fuse_version_clean(void) subsystem_unregister(&fuse_subsys); #ifndef HAVE_FS_SUBSYS subsystem_unregister(&fs_subsys); -#endif +#endif } #else static struct proc_dir_entry *proc_fs_fuse; @@ -709,7 +709,7 @@ int __init fuse_dev_init(void) 0, 0, NULL, NULL); if (!fuse_req_cachep) goto out_version_clean; - + err = misc_register(&fuse_miscdevice); if (err) diff --git a/kernel/dir.c b/kernel/dir.c index a56f513..1c76c53 100644 --- a/kernel/dir.c +++ b/kernel/dir.c @@ -74,7 +74,7 @@ static void fuse_init_inode(struct inode *inode, struct fuse_attr *attr) else if (S_ISLNK(inode->i_mode)) { inode->i_op = &fuse_symlink_inode_operations; } - else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode) || + else if (S_ISCHR(inode->i_mode) || S_ISBLK(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, @@ -175,7 +175,7 @@ struct inode *fuse_ilookup(struct super_block *sb, ino_t ino, unsigned long node #endif static int fuse_send_lookup(struct fuse_conn *fc, struct fuse_req *req, - struct inode *dir, struct dentry *entry, + struct inode *dir, struct dentry *entry, struct fuse_entry_out *outarg, int *version) { req->in.h.opcode = FUSE_LOOKUP; @@ -203,7 +203,7 @@ static int fuse_do_lookup(struct inode *dir, struct dentry *entry, req = fuse_get_request(fc); if (!req) return -ERESTARTSYS; - + err = fuse_send_lookup(fc, req, dir, entry, outarg, version); fuse_put_request(fc, req); return err; @@ -215,7 +215,7 @@ static inline unsigned long time_to_jiffies(unsigned long sec, /* prevent wrapping of jiffies */ if (sec + 1 >= LONG_MAX / HZ) return 0; - + return jiffies + sec * HZ + nsec / (1000000000 / HZ); } @@ -243,7 +243,7 @@ static int fuse_lookup_iget(struct inode *dir, struct dentry *entry, fuse_send_forget(fc, req, outarg.nodeid, version); return -ENOMEM; } - } + } fuse_put_request(fc, req); if (err && err != -ENOENT) return err; @@ -273,7 +273,7 @@ static int lookup_new_entry(struct fuse_conn *fc, struct fuse_req *req, { struct inode *inode; struct fuse_inode *fi; - inode = fuse_iget(dir->i_sb, outarg->nodeid, outarg->generation, + inode = fuse_iget(dir->i_sb, outarg->nodeid, outarg->generation, &outarg->attr, version); if (!inode) { fuse_send_forget(fc, req, outarg->nodeid, version); @@ -382,7 +382,7 @@ static int fuse_symlink(struct inode *dir, struct dentry *entry, struct fuse_entry_out outarg; unsigned len = strlen(link) + 1; int err; - + if (len > FUSE_SYMLINK_MAX) return -ENAMETOOLONG; @@ -415,7 +415,7 @@ static int fuse_unlink(struct inode *dir, struct dentry *entry) struct fuse_conn *fc = get_fuse_conn(dir); struct fuse_req *req = fuse_get_request(fc); int err; - + if (!req) return -ERESTARTSYS; @@ -428,7 +428,7 @@ static int fuse_unlink(struct inode *dir, struct dentry *entry) err = req->out.h.error; if (!err) { struct inode *inode = entry->d_inode; - + /* Set nlink to zero so the inode can be cleared, if the inode does have more links this will be discovered at the next lookup/getattr */ @@ -445,7 +445,7 @@ static int fuse_rmdir(struct inode *dir, struct dentry *entry) struct fuse_conn *fc = get_fuse_conn(dir); struct fuse_req *req = fuse_get_request(fc); int err; - + if (!req) return -ERESTARTSYS; @@ -550,7 +550,7 @@ int fuse_do_getattr(struct inode *inode) req->out.args[0].size = sizeof(arg); req->out.args[0].value = &arg; request_send(fc, req); - err = req->out.h.error; + err = req->out.h.error; if (!err) { struct fuse_inode *fi = get_fuse_inode(inode); change_attributes(inode, &arg.attr); @@ -612,7 +612,7 @@ static int fuse_permission(struct inode *inode, int mask, struct nameidata *nd) currently if the filesystem suddenly changes the 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 simply keep access to the file/directory anyway by keeping it open... */ @@ -669,7 +669,7 @@ static int fuse_checkdir(struct file *cfile, struct file *file) fput(cfile); return -EPROTO; } - + file->private_data = cfile; return 0; } @@ -691,7 +691,7 @@ static int fuse_getdir(struct file *file) req->out.args[0].size = sizeof(struct fuse_getdir_out); req->out.args[0].value = &outarg; request_send(fc, req); - err = req->out.h.error; + err = req->out.h.error; if (!err) err = fuse_checkdir(outarg.file, file); fuse_put_request(fc, req); @@ -715,11 +715,11 @@ static int fuse_readdir(struct file *file, void *dstbuf, filldir_t filldir) buf = (char *) __get_free_page(GFP_KERNEL); if (!buf) return -ENOMEM; - + ret = kernel_read(cfile, file->f_pos, buf, PAGE_SIZE); if (ret < 0) printk("fuse_readdir: failed to read container file\n"); - else + else ret = parse_dirfile(buf, ret, file, dstbuf, filldir); free_page((unsigned long) buf); @@ -807,9 +807,9 @@ static unsigned iattr_to_fattr(struct iattr *iattr, struct fuse_attr *fattr) { unsigned ivalid = iattr->ia_valid; unsigned fvalid = 0; - + memset(fattr, 0, sizeof(*fattr)); - + if (ivalid & ATTR_MODE) fvalid |= FATTR_MODE, fattr->mode = iattr->ia_mode; if (ivalid & ATTR_UID) @@ -843,7 +843,7 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr) struct fuse_attr_out outarg; int err; int is_truncate = 0; - + if (fc->flags & FUSE_DEFAULT_PERMISSIONS) { err = inode_change_ok(inode, attr); if (err) @@ -898,7 +898,7 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr) outarg.attr_valid_nsec); } else if (is_truncate) up_write(&fi->write_sem); - + return err; } @@ -912,15 +912,15 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd) struct fuse_entry_out outarg; int version; int ret; - + ret = fuse_do_lookup(entry->d_parent->d_inode, entry, &outarg, &version); if (ret) return 0; - + if (outarg.nodeid != get_node_id(inode)) return 0; - + change_attributes(inode, &outarg.attr); inode->i_version = version; entry->d_time = time_to_jiffies(outarg.entry_valid, @@ -939,7 +939,7 @@ static int fuse_getattr(struct vfsmount *mnt, struct dentry *entry, int err = fuse_revalidate(entry); if (!err) generic_fillattr(inode, stat); - + return err; } @@ -1146,7 +1146,7 @@ static int fuse_removexattr(struct dentry *entry, const char *name) struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_req *req; int err; - + if (fc->no_removexattr) return -EOPNOTSUPP; @@ -1243,6 +1243,6 @@ static struct dentry_operations fuse_dentry_operations = { #ifdef KERNEL_2_6 .d_revalidate = fuse_dentry_revalidate, #else - .d_revalidate = fuse_dentry_revalidate_2_4, + .d_revalidate = fuse_dentry_revalidate_2_4, #endif }; diff --git a/kernel/file.c b/kernel/file.c index 8992d0b..bb1da5a 100644 --- a/kernel/file.c +++ b/kernel/file.c @@ -12,6 +12,7 @@ #include <linux/slab.h> #include <linux/kernel.h> #include <linux/module.h> +#include <linux/rmap.h> #ifdef KERNEL_2_6 #include <linux/writeback.h> #include <linux/moduleparam.h> @@ -120,7 +121,7 @@ static int fuse_release(struct inode *inode, struct file *file) struct fuse_file *ff = file->private_data; struct fuse_req *req = ff->release_req; struct fuse_release_in inarg; - + down(&inode->i_sem); if (file->f_mode & FMODE_WRITE) fuse_sync_inode(inode); @@ -157,7 +158,7 @@ static int fuse_flush(struct file *file) struct fuse_req *req = ff->release_req; struct fuse_flush_in inarg; int err; - + if (fc->no_flush) return 0; @@ -189,7 +190,7 @@ static int fuse_fsync(struct file *file, struct dentry *de, int datasync) struct fuse_req *req; struct fuse_fsync_in inarg; int err; - + if (fc->no_fsync) return 0; @@ -245,10 +246,10 @@ static int fuse_readpage(struct file *file, struct page *page) struct inode *inode = page->mapping->host; struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_req *req = fuse_get_request_nonint(fc); - loff_t pos = (loff_t) page->index << PAGE_SHIFT; + loff_t pos = (loff_t) page->index << PAGE_CACHE_SHIFT; int err; - - fuse_read_init(req, file, inode, pos, PAGE_SIZE); + + fuse_read_init(req, file, inode, pos, PAGE_CACHE_SIZE); req->out.page_zeroing = 1; req->num_pages = 1; req->pages[0] = page; @@ -278,8 +279,8 @@ static void fuse_send_readpages(struct fuse_req *req, struct file *file, struct inode *inode) { struct fuse_conn *fc = get_fuse_conn(inode); - loff_t pos = (loff_t) req->pages[0]->index << PAGE_SHIFT; - size_t count = req->num_pages << PAGE_SHIFT; + loff_t pos = (loff_t) req->pages[0]->index << PAGE_CACHE_SHIFT; + size_t count = req->num_pages << PAGE_CACHE_SHIFT; fuse_read_init(req, file, inode, pos, count); req->out.page_zeroing = 1; request_send_async(fc, req, read_pages_end); @@ -297,10 +298,10 @@ static int fuse_readpages_fill(void *_data, struct page *page) struct fuse_req *req = data->req; struct inode *inode = data->inode; struct fuse_conn *fc = get_fuse_conn(inode); - - if (req->num_pages && + + if (req->num_pages && (req->num_pages == FUSE_MAX_PAGES_PER_REQ || - (req->num_pages + 1) * PAGE_SIZE > fc->max_read || + (req->num_pages + 1) * PAGE_CACHE_SIZE > fc->max_read || req->pages[req->num_pages - 1]->index + 1 != page->index)) { struct fuse_conn *fc = get_fuse_conn(page->mapping->host); fuse_send_readpages(req, data->file, inode); @@ -321,7 +322,7 @@ static int fuse_readpages(struct file *file, struct address_space *mapping, data.req = fuse_get_request_nonint(fc); data.file = file; data.inode = inode; - + read_cache_pages(mapping, pages, fuse_readpages_fill, &data); if (data.req->num_pages) fuse_send_readpages(data.req, file, inode); @@ -334,7 +335,7 @@ static int fuse_readpages(struct file *file, struct address_space *mapping, #define FUSE_BLOCK_SHIFT 16 #define FUSE_BLOCK_SIZE (1UL << FUSE_BLOCK_SHIFT) #define FUSE_BLOCK_MASK (~(FUSE_BLOCK_SIZE-1)) -#if (1UL << (FUSE_BLOCK_SHIFT - PAGE_SHIFT)) > FUSE_MAX_PAGES_PER_REQ +#if (1UL << (FUSE_BLOCK_SHIFT - PAGE_CACHE_SHIFT)) > FUSE_MAX_PAGES_PER_REQ #error FUSE_BLOCK_SHIFT too large #endif @@ -375,11 +376,11 @@ static void fuse_file_read_block(struct fuse_req *req, struct file *file, unlock_page(page); page_cache_release(page); page = NULL; - } + } req->pages[req->num_pages++] = page; } - pos = (loff_t) start << PAGE_SHIFT; - count = req->num_pages << PAGE_SHIFT; + pos = (loff_t) start << PAGE_CACHE_SHIFT; + count = req->num_pages << PAGE_CACHE_SHIFT; fuse_read_init(req, file, inode, pos, count); request_send(fc, req); err = req->out.h.error; @@ -393,7 +394,7 @@ static void fuse_file_read_block(struct fuse_req *req, struct file *file, page_cache_release(page); } } -} +} static int fuse_file_bigread(struct file *file, struct inode *inode, loff_t pos, size_t count) @@ -409,15 +410,15 @@ static int fuse_file_bigread(struct file *file, struct inode *inode, if (end <= pos) return 0; - starti = (pos & FUSE_BLOCK_MASK) >> PAGE_SHIFT; - endi = (end + PAGE_SIZE - 1) >> PAGE_SHIFT; - + starti = (pos & FUSE_BLOCK_MASK) >> PAGE_CACHE_SHIFT; + endi = (end + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; + req = fuse_get_request(fc); if (!req) return -ERESTARTSYS; - + for (; starti < endi; starti = nexti) { - nexti = starti + (FUSE_BLOCK_SIZE >> PAGE_SHIFT); + nexti = starti + (FUSE_BLOCK_SIZE >> PAGE_CACHE_SHIFT); nexti = min(nexti, endi); if (!fuse_is_block_uptodate(inode, starti, nexti)) { fuse_file_read_block(req, file, inode, starti, nexti); @@ -461,12 +462,12 @@ static int get_write_count(struct inode *inode, struct page *page) unsigned long end_index; loff_t size = i_size_read(inode); int count; - - end_index = size >> PAGE_SHIFT; + + end_index = size >> PAGE_CACHE_SHIFT; if (page->index < end_index) - count = PAGE_SIZE; + count = PAGE_CACHE_SIZE; else { - count = size & (PAGE_SIZE - 1); + count = size & (PAGE_CACHE_SIZE - 1); if (page->index > end_index || count == 0) return 0; } @@ -522,7 +523,7 @@ static int fuse_writepage(struct page *page, struct writeback_control *wbc) down_read(&fi->write_sem); if (locked) { unsigned count = get_write_count(inode, page); - loff_t pos = (loff_t) page->index << PAGE_SHIFT; + loff_t pos = (loff_t) page->index << PAGE_CACHE_SHIFT; err = 0; if (count) { struct fuse_file *ff = get_write_file(fi); @@ -564,7 +565,7 @@ static int fuse_writepage(struct page *page) err = 0; if (count) { struct fuse_file *ff = get_write_file(fi); - loff_t pos = ((loff_t) page->index << PAGE_SHIFT); + loff_t pos = ((loff_t) page->index << PAGE_CACHE_SHIFT); fuse_write_init(req, ff, inode, pos, count, 1); req->num_pages = 1; @@ -599,7 +600,7 @@ static int fuse_commit_write(struct file *file, struct page *page, struct fuse_file *ff = file->private_data; struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_req *req = fuse_get_request(fc); - loff_t pos = ((loff_t) page->index << PAGE_SHIFT) + offset; + loff_t pos = ((loff_t) page->index << PAGE_CACHE_SHIFT) + offset; if (!req) return -ERESTARTSYS; @@ -615,8 +616,8 @@ static int fuse_commit_write(struct file *file, struct page *page, pos += count; if (pos > i_size_read(inode)) i_size_write(inode, pos); - - if (offset == 0 && to == PAGE_SIZE) { + + if (offset == 0 && to == PAGE_CACHE_SIZE) { #ifdef KERNEL_2_6 clear_page_dirty(page); #else @@ -735,12 +736,11 @@ static ssize_t fuse_file_read(struct file *file, char __user *buf, { struct inode *inode = file->f_dentry->d_inode; struct fuse_conn *fc = get_fuse_conn(inode); - ssize_t res; if (fc->flags & FUSE_DIRECT_IO) - res = fuse_direct_io(file, buf, count, ppos, 0); - else { + return fuse_direct_io(file, buf, count, ppos, 0); #ifndef KERNEL_2_6 + else { if (fc->flags & FUSE_LARGE_READ) { down(&inode->i_sem); res = fuse_file_bigread(file, inode, *ppos, count); @@ -748,18 +748,21 @@ static ssize_t fuse_file_read(struct file *file, char __user *buf, if (res) return res; } -#endif - res = generic_file_read(file, buf, count, ppos); + return generic_file_read(file, buf, count, ppos); } - return res; -} +#else + else + return generic_file_read(file, buf, count, ppos); +#endif + +} static ssize_t fuse_file_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct inode *inode = file->f_dentry->d_inode; struct fuse_conn *fc = get_fuse_conn(inode); - + if (fc->flags & FUSE_DIRECT_IO) { ssize_t res; down(&inode->i_sem); @@ -767,10 +770,10 @@ static ssize_t fuse_file_write(struct file *file, const char __user *buf, up(&inode->i_sem); return res; } - else + else return generic_file_write(file, buf, count, ppos); } - + static int fuse_file_mmap(struct file *file, struct vm_area_struct *vma) { struct inode *inode = file->f_dentry->d_inode; @@ -779,7 +782,7 @@ static int fuse_file_mmap(struct file *file, struct vm_area_struct *vma) if (fc->flags & FUSE_DIRECT_IO) return -ENODEV; else { - if ((vma->vm_flags & (VM_WRITE | VM_SHARED)) == + if ((vma->vm_flags & (VM_WRITE | VM_SHARED)) == (VM_WRITE | VM_SHARED)) { struct fuse_inode *fi = get_fuse_inode(inode); struct fuse_file *ff = file->private_data; diff --git a/kernel/fuse_i.h b/kernel/fuse_i.h index 0597621..580ff77 100644 --- a/kernel/fuse_i.h +++ b/kernel/fuse_i.h @@ -37,7 +37,7 @@ # define i_size_read(inode) ((inode)->i_size) # define i_size_write(inode, size) do { (inode)->i_size = size; } while(0) # endif -#endif +#endif #endif /* FUSE_MAINLINE */ #include <linux/fs.h> #include <linux/wait.h> @@ -125,7 +125,7 @@ struct fuse_in_arg { struct fuse_in { /** The request header */ struct fuse_in_header h; - + /** True if the data for the last argument is in req->pages */ unsigned argpages:1; @@ -191,7 +191,6 @@ struct fuse_req { struct { struct fuse_write_in in; struct fuse_write_out out; - } write; struct fuse_read_in read_in; struct fuse_forget_in forget_in; @@ -217,7 +216,7 @@ struct fuse_req { struct fuse_conn { /** The superblock of the mounted filesystem */ struct super_block *sb; - + /** The opened client device */ struct file *file; @@ -250,10 +249,10 @@ struct fuse_conn { /** The list of unused requests */ struct list_head unused_list; - + /** The next unique request id */ int reqctr; - + /** Is fsync not implemented by fs? */ unsigned no_fsync : 1; @@ -319,7 +318,7 @@ extern struct file_operations fuse_dev_operations; * This is the single global spinlock which protects FUSE's structures * * The following data is protected by this lock: - * + * * - the private_data field of the device file * - the s_fs_info field of the super block * - unused_list, pending, processing lists in fuse_conn @@ -369,7 +368,7 @@ int fuse_dev_init(void); void fuse_dev_cleanup(void); /** - * Initialize the fuse filesystem + * Initialize the fuse filesystem */ int fuse_fs_init(void); @@ -378,7 +377,7 @@ int fuse_fs_init(void); */ void fuse_fs_cleanup(void); -/** +/** * Allocate a request */ struct fuse_req *fuse_request_alloc(void); @@ -426,7 +425,7 @@ void request_send_noreply(struct fuse_conn *fc, struct fuse_req *req); /** * Send asynchronous request */ -void request_send_async(struct fuse_conn *fc, struct fuse_req *req, +void request_send_async(struct fuse_conn *fc, struct fuse_req *req, fuse_reqend_t end); /** diff --git a/kernel/inode.c b/kernel/inode.c index e0a3902..5887605 100644 --- a/kernel/inode.c +++ b/kernel/inode.c @@ -42,7 +42,7 @@ MODULE_PARM_DESC(user_allow_other, "Allow non root user to specify the \"allow_o #define FS_SAFE 0 #endif #ifndef MAX_LFS_FILESIZE -#define MAX_LFS_FILESIZE (((u64)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1) +#define MAX_LFS_FILESIZE (((u64)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1) #endif struct fuse_mount_data { int fd; @@ -173,7 +173,7 @@ enum { OPT_FD, OPT_ROOTMODE, OPT_UID, - OPT_DEFAULT_PERMISSIONS, + OPT_DEFAULT_PERMISSIONS, OPT_ALLOW_OTHER, OPT_ALLOW_ROOT, OPT_KERNEL_CACHE, @@ -182,7 +182,7 @@ enum { #endif OPT_DIRECT_IO, OPT_MAX_READ, - OPT_ERR + OPT_ERR }; static match_table_t tokens = { @@ -214,7 +214,7 @@ static int parse_fuse_opt(char *opt, struct fuse_mount_data *d) substring_t args[MAX_OPT_ARGS]; if (!*p) continue; - + token = match_token(p, tokens, args); switch (token) { case OPT_FD: @@ -228,13 +228,13 @@ static int parse_fuse_opt(char *opt, struct fuse_mount_data *d) return 0; d->rootmode = value; break; - + case OPT_UID: if (match_int(&args[0], &value)) return 0; d->uid = value; break; - + case OPT_DEFAULT_PERMISSIONS: d->flags |= FUSE_DEFAULT_PERMISSIONS; break; @@ -251,7 +251,7 @@ static int parse_fuse_opt(char *opt, struct fuse_mount_data *d) d->flags |= FUSE_KERNEL_CACHE; break; -#ifndef FUSE_MAINLINE +#ifndef FUSE_MAINLINE case OPT_LARGE_READ: #ifndef KERNEL_2_6 d->flags |= FUSE_LARGE_READ; @@ -265,7 +265,7 @@ static int parse_fuse_opt(char *opt, struct fuse_mount_data *d) } #endif break; -#endif +#endif case OPT_DIRECT_IO: d->flags |= FUSE_DIRECT_IO; break; @@ -432,7 +432,7 @@ static int fuse_encode_fh(struct dentry *dentry, __u32 *fh, int *max_len, struct inode *inode = dentry->d_inode; int len = *max_len; int type = 1; - + if (len < 2 || (connectable && len < 4)) return 255; @@ -472,7 +472,7 @@ static struct super_operations fuse_super_operations = { }; static int fuse_read_super(struct super_block *sb, void *data, int silent) -{ +{ struct fuse_conn *fc; struct inode *root; struct fuse_mount_data d; @@ -512,7 +512,7 @@ static int fuse_read_super(struct super_block *sb, void *data, int silent) fc->bdi.ra_pages = fc->max_read / PAGE_CACHE_SIZE; #endif fc->max_write = FUSE_MAX_IN / 2; - + *get_fuse_conn_super_p(sb) = fc; root = get_root_inode(sb, d.rootmode); diff --git a/kernel/util.c b/kernel/util.c index 003f8b2..8dca167 100644 --- a/kernel/util.c +++ b/kernel/util.c @@ -33,11 +33,11 @@ int __init fuse_init(void) res = fuse_fs_init(); if (res) goto err; - + res = fuse_dev_init(); if (res) goto err_fs_cleanup; - + return 0; err_fs_cleanup: @@ -49,7 +49,7 @@ int __init fuse_init(void) void __exit fuse_exit(void) { printk(KERN_DEBUG "fuse exit\n"); - + fuse_fs_cleanup(); fuse_dev_cleanup(); } |