Whamcloud - gitweb
Now enough fixes to get it actually working...
authoradilger <adilger>
Tue, 10 Dec 2002 10:07:30 +0000 (10:07 +0000)
committeradilger <adilger>
Tue, 10 Dec 2002 10:07:30 +0000 (10:07 +0000)
lustre/include/linux/lustre_fsfilt.h
lustre/obdclass/fsfilt.c
lustre/obdclass/fsfilt_ext3.c
lustre/obdclass/fsfilt_extN.c

index 3775909..b1ec270 100644 (file)
@@ -51,8 +51,10 @@ struct fsfilt_operations {
         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
@@ -131,9 +133,6 @@ static inline int fsfilt_statfs(struct obd_device *obd, struct super_block *fs,
         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
index 0d15a09..97a84df 100644 (file)
@@ -28,28 +28,28 @@ static struct fsfilt_operations *fsfilt_search_type(const char *type)
         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;
 
@@ -57,8 +57,8 @@ void fsfilt_unregister_type(const char *type)
         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;
@@ -104,7 +104,7 @@ void fsfilt_put_ops(struct fsfilt_operations *fs_ops)
 }
 
 
-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);
index a2f0d9a..3878315 100644 (file)
@@ -269,7 +269,7 @@ static int fsfilt_ext3_statfs(struct super_block *sb, struct statfs *sfs)
         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,
@@ -296,7 +296,7 @@ static int __init fsfilt_ext3_init(void)
                 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);
@@ -308,7 +308,7 @@ static void __exit fsfilt_ext3_exit(void)
 {
         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) {
index b5300ec..54214ed 100644 (file)
@@ -268,7 +268,7 @@ static int fsfilt_extN_statfs(struct super_block *sb, struct statfs *sfs)
         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,
@@ -295,7 +295,7 @@ static int __init fsfilt_extN_init(void)
                 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);
@@ -307,7 +307,7 @@ static void __exit fsfilt_extN_exit(void)
 {
         int rc;
 
-        fsfilt_unregister_fs_type("extN");
+        fsfilt_unregister_ops(&fsfilt_extN_ops);
         rc = kmem_cache_destroy(fcb_cache);
 
         if (rc || fcb_cache_count) {