X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;ds=inline;f=fs%2Fcoda%2Finode.c;h=830f51abb97138d20d8dc07c8bc9ffb5e325659e;hb=57ac827c9b17f2cc2f0f86c4fd43c3597c40253c;hp=b64659fa82d0e6c94ffcf93d81a2cfb1fd70686a;hpb=e18b890bb0881bbab6f4f1a6cd20d9c60d66b003;p=safe%2Fjmp%2Flinux-2.6 diff --git a/fs/coda/inode.c b/fs/coda/inode.c index b64659f..830f51a 100644 --- a/fs/coda/inode.c +++ b/fs/coda/inode.c @@ -58,21 +58,19 @@ static void coda_destroy_inode(struct inode *inode) kmem_cache_free(coda_inode_cachep, ITOC(inode)); } -static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags) +static void init_once(void *foo) { struct coda_inode_info *ei = (struct coda_inode_info *) foo; - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == - SLAB_CTOR_CONSTRUCTOR) - inode_init_once(&ei->vfs_inode); + inode_init_once(&ei->vfs_inode); } - + int coda_init_inodecache(void) { coda_inode_cachep = kmem_cache_create("coda_inode_cache", sizeof(struct coda_inode_info), 0, SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, - init_once, NULL); + init_once); if (coda_inode_cachep == NULL) return -ENOMEM; return 0; @@ -85,12 +83,12 @@ void coda_destroy_inodecache(void) static int coda_remount(struct super_block *sb, int *flags, char *data) { - *flags |= MS_NODIRATIME; + *flags |= MS_NOATIME; return 0; } /* exported operations */ -static struct super_operations coda_super_operations = +static const struct super_operations coda_super_operations = { .alloc_inode = coda_alloc_inode, .destroy_inode = coda_destroy_inode, @@ -119,7 +117,7 @@ static int get_device_index(struct coda_mount_data *data) file = fget(data->fd); inode = NULL; if(file) - inode = file->f_dentry->d_inode; + inode = file->f_path.dentry->d_inode; if(!inode || !S_ISCHR(inode->i_mode) || imajor(inode) != CODA_PSDEV_MAJOR) { @@ -143,11 +141,10 @@ static int get_device_index(struct coda_mount_data *data) static int coda_fill_super(struct super_block *sb, void *data, int silent) { - struct inode *root = NULL; - struct coda_sb_info *sbi = NULL; + struct inode *root = NULL; struct venus_comm *vc = NULL; struct CodaFid fid; - int error; + int error; int idx; idx = get_device_index((struct coda_mount_data *) data); @@ -169,21 +166,14 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent) return -EBUSY; } - sbi = kmalloc(sizeof(struct coda_sb_info), GFP_KERNEL); - if(!sbi) { - return -ENOMEM; - } - vc->vc_sb = sb; - sbi->sbi_vcomm = vc; - - sb->s_fs_info = sbi; - sb->s_flags |= MS_NODIRATIME; /* probably even noatime */ - sb->s_blocksize = 1024; /* XXXXX what do we put here?? */ - sb->s_blocksize_bits = 10; - sb->s_magic = CODA_SUPER_MAGIC; - sb->s_op = &coda_super_operations; + sb->s_fs_info = vc; + sb->s_flags |= MS_NOATIME; + sb->s_blocksize = 4096; /* XXXXX what do we put here?? */ + sb->s_blocksize_bits = 12; + sb->s_magic = CODA_SUPER_MAGIC; + sb->s_op = &coda_super_operations; /* get root fid from Venus: this needs the root inode */ error = venus_rootfid(sb, &fid); @@ -209,26 +199,20 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent) return 0; error: - if (sbi) { - kfree(sbi); - if(vc) - vc->vc_sb = NULL; - } if (root) - iput(root); + iput(root); + if (vc) + vc->vc_sb = NULL; - return -EINVAL; + return -EINVAL; } static void coda_put_super(struct super_block *sb) { - struct coda_sb_info *sbi; - - sbi = coda_sbp(sb); - sbi->sbi_vcomm->vc_sb = NULL; + coda_vcp(sb)->vc_sb = NULL; + sb->s_fs_info = NULL; printk("Coda: Bye bye.\n"); - kfree(sbi); } static void coda_clear_inode(struct inode *inode) @@ -271,7 +255,7 @@ int coda_setattr(struct dentry *de, struct iattr *iattr) return error; } -struct inode_operations coda_file_inode_operations = { +const struct inode_operations coda_file_inode_operations = { .permission = coda_permission, .getattr = coda_getattr, .setattr = coda_setattr, @@ -298,7 +282,7 @@ static int coda_statfs(struct dentry *dentry, struct kstatfs *buf) /* and fill in the rest */ buf->f_type = CODA_SUPER_MAGIC; - buf->f_bsize = 1024; + buf->f_bsize = 4096; buf->f_namelen = CODA_MAXNAMLEN; return 0;