int (* fs_statfs)(struct super_block *sb, struct statfs *sfs);
};
-extern int fsfilt_register_fs_type(struct fsfilt_operations *op);
-extern void fsfilt_unregister_fs_type(const char *name);
+extern int fsfilt_register_ops(struct fsfilt_operations *fs_ops);
+extern void fsfilt_unregister_ops(struct fsfilt_operations *fs_ops);
+extern struct fsfilt_operations *fsfilt_get_ops(char *type);
+extern void fsfilt_put_ops(struct fsfilt_operations *fs_ops);
#define FSFILT_OP_UNLINK 1
#define FSFILT_OP_RMDIR 2
return obd->obd_fsops->fs_statfs(fs, sfs);
}
-extern struct fsfilt_operations *fsfilt_get_ops(char *type);
-extern void fsfilt_put_ops(struct fsfilt_operations *fs_ops);
-
#endif /* __KERNEL__ */
#endif
return NULL;
}
-int fsfilt_register_type(struct fsfilt_operations *ops)
+int fsfilt_register_ops(struct fsfilt_operations *fs_ops)
{
struct fsfilt_operations *found;
/* lock fsfilt_types list */
- if ((found = fsfilt_search_type(ops->fs_type))) {
- if (found != ops) {
+ if ((found = fsfilt_search_type(fs_ops->fs_type))) {
+ if (found != fs_ops) {
CERROR("different operations for type %s\n",
- ops->fs_type);
+ fs_ops->fs_type);
/* unlock fsfilt_types list */
RETURN(-EEXIST);
}
} else {
MOD_INC_USE_COUNT;
- list_add(&ops->fs_list, &fsfilt_types);
+ list_add(&fs_ops->fs_list, &fsfilt_types);
}
/* unlock fsfilt_types list */
return 0;
}
-void fsfilt_unregister_type(const char *type)
+void fsfilt_unregister_ops(struct fsfilt_operations *fs_ops)
{
struct list_head *p;
list_for_each(p, &fsfilt_types) {
struct fsfilt_operations *found;
- found = list_entry(p, struct fsfilt_operations, fs_list);
- if (!strcmp(found->fs_type, type)) {
+ found = list_entry(p, typeof(*found), fs_list);
+ if (found == fs_ops) {
list_del(p);
MOD_DEC_USE_COUNT;
break;
}
-EXPORT_SYMBOL(fsfilt_register_fs_type);
-EXPORT_SYMBOL(fsfilt_unregister_fs_type);
+EXPORT_SYMBOL(fsfilt_register_ops);
+EXPORT_SYMBOL(fsfilt_unregister_ops);
EXPORT_SYMBOL(fsfilt_get_ops);
EXPORT_SYMBOL(fsfilt_put_ops);
return rc;
}
-static struct fsfilt_operations fsfilt_ext3_fs_ops = {
+static struct fsfilt_operations fsfilt_ext3_ops = {
fs_type: "ext3",
fs_owner: THIS_MODULE,
fs_start: fsfilt_ext3_start,
GOTO(out, rc = -ENOMEM);
}
- rc = fsfilt_register_fs_type(&fsfilt_ext3_fs_ops);
+ rc = fsfilt_register_ops(&fsfilt_ext3_fs_ops);
if (rc)
kmem_cache_destroy(fcb_cache);
{
int rc;
- fsfilt_unregister_fs_type("ext3");
+ fsfilt_unregister_ops(&fsfilt_ext3_fs_ops);
rc = kmem_cache_destroy(fcb_cache);
if (rc || fcb_cache_count) {
return rc;
}
-static struct fsfilt_operations fsfilt_extN_fs_ops = {
+static struct fsfilt_operations fsfilt_extN_ops = {
fs_type: "extN",
fs_owner: THIS_MODULE,
fs_start: fsfilt_extN_start,
GOTO(out, rc = -ENOMEM);
}
- rc = fsfilt_register_fs_type(&fsfilt_extN_fs_ops);
+ rc = fsfilt_register_ops(&fsfilt_extN_ops);
if (rc)
kmem_cache_destroy(fcb_cache);
{
int rc;
- fsfilt_unregister_fs_type("extN");
+ fsfilt_unregister_ops(&fsfilt_extN_ops);
rc = kmem_cache_destroy(fcb_cache);
if (rc || fcb_cache_count) {