diff options
author | 2001-11-06 12:03:23 +0000 | |
---|---|---|
committer | 2001-11-06 12:03:23 +0000 | |
commit | a181e61ca0119b8c3fd2daa4b8d23add2cda3ed0 (patch) | |
tree | 57176d5ca8f96008180eac92518791ef22add726 /kernel/inode.c | |
parent | 5e183482b09cec20f54ccb44e767a7fab51833e9 (diff) |
bugfixes
Diffstat (limited to 'kernel/inode.c')
-rw-r--r-- | kernel/inode.c | 72 |
1 files changed, 11 insertions, 61 deletions
diff --git a/kernel/inode.c b/kernel/inode.c index ed4f760..77e8469 100644 --- a/kernel/inode.c +++ b/kernel/inode.c @@ -21,70 +21,22 @@ static void fuse_read_inode(struct inode *inode) /* No op */ } -static void send_forget(struct fuse_conn *fc, unsigned long *forget, - unsigned int numforget) +static void fuse_clear_inode(struct inode *inode) { + struct fuse_conn *fc = INO_FC(inode); struct fuse_in in = FUSE_IN_INIT; + struct fuse_forget_in arg; + + arg.version = inode->i_version; in.h.opcode = FUSE_FORGET; - in.h.ino = 0; - in.argsize = numforget * sizeof(unsigned long); - in.arg = forget; + in.h.ino = inode->i_ino; + in.argsize = sizeof(arg); + in.arg = &arg; request_send(fc, &in, NULL); } -static int alloc_cleared(struct fuse_conn *fc) -{ - unsigned long *tmp; - - spin_unlock(&fuse_lock); - tmp = kmalloc(sizeof(unsigned long) * MAX_CLEARED, GFP_NOFS); - spin_lock(&fuse_lock); - - if(!fc->file || fc->cleared != NULL) - kfree(tmp); - else if(!tmp) - printk("fuse_clear_inode: Cannot allocate memory\n"); - else - fc->cleared = tmp; - - return fc->cleared != NULL; -} - -static unsigned long *add_cleared(struct fuse_conn *fc, unsigned long ino) -{ - if(!fc->file || (!fc->cleared && !alloc_cleared(fc))) - return NULL; - - fc->cleared[fc->numcleared] = ino; - fc->numcleared ++; - - if(fc->numcleared == MAX_CLEARED) { - unsigned long *tmp = fc->cleared; - fc->cleared = NULL; - fc->numcleared = 0; - return tmp; - } - - return NULL; -} - -static void fuse_clear_inode(struct inode *inode) -{ - struct fuse_conn *fc = INO_FC(inode); - unsigned long *forget; - - spin_lock(&fuse_lock); - forget = add_cleared(fc, inode->i_ino); - spin_unlock(&fuse_lock); - - if(forget) { - send_forget(fc, forget, MAX_CLEARED); - kfree(forget); - } -} - static void fuse_put_super(struct super_block *sb) { struct fuse_conn *fc = sb->u.generic_sbp; @@ -143,7 +95,7 @@ static struct inode *get_root_inode(struct super_block *sb) memset(&attr, 0, sizeof(attr)); attr.mode = S_IFDIR; - return fuse_iget(sb, 1, &attr); + return fuse_iget(sb, 1, &attr, 0); } static struct super_block *fuse_read_super(struct super_block *sb, @@ -169,8 +121,7 @@ static struct super_block *fuse_read_super(struct super_block *sb, goto err; if(fc->sb != NULL) { - printk("fuse_read_super: connection %i already mounted\n", - fc->id); + printk("fuse_read_super: connection already mounted\n"); goto err; } @@ -213,6 +164,5 @@ void fuse_fs_cleanup() * Local Variables: * indent-tabs-mode: t * c-basic-offset: 8 - * End: - */ + * End: */ |