aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/relayfs/inode.c46
1 files changed, 1 insertions, 45 deletions
diff --git a/fs/relayfs/inode.c b/fs/relayfs/inode.c
index 7f6d2c8e91c2..b4c3e0466e98 100644
--- a/fs/relayfs/inode.c
+++ b/fs/relayfs/inode.c
@@ -26,7 +26,6 @@
26 26
27static struct vfsmount * relayfs_mount; 27static struct vfsmount * relayfs_mount;
28static int relayfs_mount_count; 28static int relayfs_mount_count;
29static kmem_cache_t * relayfs_inode_cachep;
30 29
31static struct backing_dev_info relayfs_backing_dev_info = { 30static struct backing_dev_info relayfs_backing_dev_info = {
32 .ra_pages = 0, /* No readahead */ 31 .ra_pages = 0, /* No readahead */
@@ -499,34 +498,6 @@ out:
499 return ret; 498 return ret;
500} 499}
501 500
502/**
503 * relayfs alloc_inode() implementation
504 */
505static struct inode *relayfs_alloc_inode(struct super_block *sb)
506{
507 struct relayfs_inode_info *p = kmem_cache_alloc(relayfs_inode_cachep, SLAB_KERNEL);
508 if (!p)
509 return NULL;
510 p->data = NULL;
511
512 return &p->vfs_inode;
513}
514
515/**
516 * relayfs destroy_inode() implementation
517 */
518static void relayfs_destroy_inode(struct inode *inode)
519{
520 kmem_cache_free(relayfs_inode_cachep, RELAYFS_I(inode));
521}
522
523static void init_once(void *p, kmem_cache_t *cachep, unsigned long flags)
524{
525 struct relayfs_inode_info *i = p;
526 if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) == SLAB_CTOR_CONSTRUCTOR)
527 inode_init_once(&i->vfs_inode);
528}
529
530struct file_operations relayfs_file_operations = { 501struct file_operations relayfs_file_operations = {
531 .open = relayfs_open, 502 .open = relayfs_open,
532 .poll = relayfs_poll, 503 .poll = relayfs_poll,
@@ -539,8 +510,6 @@ struct file_operations relayfs_file_operations = {
539static struct super_operations relayfs_ops = { 510static struct super_operations relayfs_ops = {
540 .statfs = simple_statfs, 511 .statfs = simple_statfs,
541 .drop_inode = generic_delete_inode, 512 .drop_inode = generic_delete_inode,
542 .alloc_inode = relayfs_alloc_inode,
543 .destroy_inode = relayfs_destroy_inode,
544}; 513};
545 514
546static int relayfs_fill_super(struct super_block * sb, void * data, int silent) 515static int relayfs_fill_super(struct super_block * sb, void * data, int silent)
@@ -584,25 +553,12 @@ static struct file_system_type relayfs_fs_type = {
584 553
585static int __init init_relayfs_fs(void) 554static int __init init_relayfs_fs(void)
586{ 555{
587 int err; 556 return register_filesystem(&relayfs_fs_type);
588
589 relayfs_inode_cachep = kmem_cache_create("relayfs_inode_cache",
590 sizeof(struct relayfs_inode_info), 0,
591 0, init_once, NULL);
592 if (!relayfs_inode_cachep)
593 return -ENOMEM;
594
595 err = register_filesystem(&relayfs_fs_type);
596 if (err)
597 kmem_cache_destroy(relayfs_inode_cachep);
598
599 return err;
600} 557}
601 558
602static void __exit exit_relayfs_fs(void) 559static void __exit exit_relayfs_fs(void)
603{ 560{
604 unregister_filesystem(&relayfs_fs_type); 561 unregister_filesystem(&relayfs_fs_type);
605 kmem_cache_destroy(relayfs_inode_cachep);
606} 562}
607 563
608module_init(init_relayfs_fs) 564module_init(init_relayfs_fs)