*
*/
-/*
- * Changes
+/* Changes
*
* 08 Mar 2004
* Created.
#include <asm/uaccess.h>
#include <linux/rcfs.h>
+#include <linux/ckrm.h>
#include <linux/ckrm_rc.h>
#include <linux/ckrm_ce.h>
return container_of(inode, struct rcfs_inode_info, vfs_inode);
}
-EXPORT_SYMBOL_GPL(RCFS_I);
+EXPORT_SYMBOL(RCFS_I);
static struct inode *rcfs_alloc_inode(struct super_block *sb)
{
}
sb->s_root = root;
- /* Link inode and core class */
+ // Link inode and core class
rootri = RCFS_I(inode);
rootri->name = kmalloc(strlen(RCFS_ROOT) + 1, GFP_KERNEL);
if (!rootri->name) {
rcfs_rootde = root;
rcfs_rootri = rootri;
- /* register metatypes */
+ // register metatypes
for (i = 0; i < CKRM_MAX_CLASSTYPES; i++) {
clstype = ckrm_classtypes[i];
if (clstype == NULL)
printk(KERN_DEBUG "A non null classtype\n");
if ((rc = rcfs_register_classtype(clstype)))
- continue; /* could return with an error too */
+ continue; // could return with an error too
}
- /*
- * do post-mount initializations needed by CE
- * this is distinct from CE registration done on rcfs module load
- */
+ // do post-mount initializations needed by CE
+ // this is distinct from CE registration done on rcfs module load
if (rcfs_engine_regd) {
if (rcfs_eng_callbacks.mnt)
if ((rc = (*rcfs_eng_callbacks.mnt) ())) {
printk(KERN_ERR "Error in CE mnt %d\n", rc);
}
}
- /*
- * Following comment handled by code above; keep nonetheless if it
- * can be done better
- *
- * register CE's with rcfs
- * check if CE loaded
- * call rcfs_register_engine for each classtype
- * AND rcfs_mkroot (preferably subsume latter in former)
- */
+ // Following comment handled by code above; keep nonetheless if it
+ // can be done better
+ //
+ // register CE's with rcfs
+ // check if CE loaded
+ // call rcfs_register_engine for each classtype
+ // AND rcfs_mkroot (preferably subsume latter in former)
+
return 0;
}
rcfs_mounted--;
for (i = 0; i < CKRM_MAX_CLASSTYPES; i++) {
+
clstype = ckrm_classtypes[i];
if (clstype == NULL || clstype->rootde == NULL)
continue;
if ((rc = rcfs_deregister_classtype(clstype))) {
printk(KERN_ERR "Error removing classtype %s\n",
clstype->name);
+ // return ; // can also choose to stop here
}
}
- /*
- * do pre-umount shutdown needed by CE
- * this is distinct from CE deregistration done on rcfs module unload
- */
+ // do pre-umount shutdown needed by CE
+ // this is distinct from CE deregistration done on rcfs module unload
if (rcfs_engine_regd) {
if (rcfs_eng_callbacks.umnt)
if ((rc = (*rcfs_eng_callbacks.umnt) ())) {
printk(KERN_ERR "Error in CE umnt %d\n", rc);
- /* TODO: return ; until error handling improves */
+ // return ; until error handling improves
}
}
- /*
- * Following comment handled by code above; keep nonetheless if it
- * can be done better
- *
- * deregister CE with rcfs
- * Check if loaded
- * if ce is in one directory /rcfs/ce,
- * rcfs_deregister_engine for all classtypes within above
- * codebase
- * followed by
- * rcfs_rmroot here
- * if ce in multiple (per-classtype) directories
- * call rbce_deregister_engine within ckrm_deregister_classtype
- *
- * following will automatically clear rcfs root entry including its
- * rcfs_inode_info
- */
+ // Following comment handled by code above; keep nonetheless if it
+ // can be done better
+ //
+ // deregister CE with rcfs
+ // Check if loaded
+ // if ce is in one directory /rcfs/ce,
+ // rcfs_deregister_engine for all classtypes within above
+ // codebase
+ // followed by
+ // rcfs_rmroot here
+ // if ce in multiple (per-classtype) directories
+ // call rbce_deregister_engine within ckrm_deregister_classtype
+
+ // following will automatically clear rcfs root entry including its
+ // rcfs_inode_info
generic_shutdown_super(sb);
+
+ // printk(KERN_ERR "Removed all entries\n");
}
static struct file_system_type rcfs_fs_type = {
ret = register_filesystem(&rcfs_fs_type);
if (ret)
goto init_register_err;
+
ret = rcfs_init_inodecache();
if (ret)
goto init_cache_err;
+
rcfs_fn = my_rcfs_fn;
- /*
- * Due to tight coupling of this module with ckrm
- * do not allow this module to be removed.
- */
+
+ // Due to tight coupling of this module with ckrm
+ // do not allow this module to be removed.
try_module_get(THIS_MODULE);
return ret;
-init_cache_err:
+ init_cache_err:
unregister_filesystem(&rcfs_fs_type);
-init_register_err:
+ init_register_err:
return ret;
}
}
module_init(init_rcfs_fs)
-module_exit(exit_rcfs_fs)
+ module_exit(exit_rcfs_fs)
-MODULE_LICENSE("GPL");
+ MODULE_LICENSE("GPL");