Skip to contentSkip to conversation

debugfs: remove module_exit()

PATCH In review Amerigo Wang 3 participants 7 messages Nov 9, 2010 – Dec 2, 2010 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 debugfs: remove module_exit()

debugfs can't be a module, so module_exit() is meaningless for it.

---

fs/debugfs/inode.c +0 -15
index 37a8ca7..d38c88f 100644
@@ -13,9 +13,6 @@
  *
  */
 
-/* uncomment to get debug messages from the debug filesystem, ah the irony. */
-/* #define DEBUG */
-
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/mount.h>
@@ -540,17 +537,5 @@ static int __init debugfs_init(void)
 
 	return retval;
 }
-
-static void __exit debugfs_exit(void)
-{
-	debugfs_registered = false;
-
-	simple_release_fs(&debugfs_mount, &debugfs_mount_count);
-	unregister_filesystem(&debug_fs_type);
-	kobject_put(debug_kobj);
-}
-
 core_initcall(debugfs_init);
-module_exit(debugfs_exit);
-MODULE_LICENSE("GPL");
 
#1 lore raw
Quoted 11 lines · Amerigo Wang

debugfs can't be a module, so module_exit() is meaningless for it.

---

fs/debugfs/inode.c +0 -0
index 37a8ca7..d38c88f 100644

fs/debugfs/inode.c line 17

Quoted 5 lines
fs/debugfs/inode.c +0 -2
@@ -13,9 +13,6 @@
  *
  */
 
-/* uncomment to get debug messages from the debug filesystem, ah the irony. */
-/* #define DEBUG */

Why did you remove these lines? They don't pertain to this patch.

Quoted 7 lines
fs/debugfs/inode.c +0 -1
-
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/mount.h>
@@ -540,17 +537,5 @@ static int __init debugfs_init(void)
 
 	return retval;

fs/debugfs/inode.c static int __init debugfs_init(void) · line 551

Quoted 10 lines
fs/debugfs/inode.c +0 -9
 }
-
-static void __exit debugfs_exit(void)
-{
-	debugfs_registered = false;
-
-	simple_release_fs(&debugfs_mount, &debugfs_mount_count);
-	unregister_filesystem(&debug_fs_type);
-	kobject_put(debug_kobj);
-}

When the code is built into the kernel, the __exit function should go away, so this isn't costing us any extra memory, right?

And debugfs used to be able to be built as a module, perhaps it will be in the future? I don't think this patch is really needed.

thanks,

greg k-h

author
#2 lore raw
Quoted 15 lines · Greg KH
Quoted 14 lines · Amerigo Wang

debugfs can't be a module, so module_exit() is meaningless for it.

---

fs/debugfs/inode.c +0 -0
index 37a8ca7..d38c88f 100644
@@ -13,9 +13,6 @@
   *
   */
 
Quoted 4 lines

fs/debugfs/inode.c line 17

Quoted 2 lines
fs/debugfs/inode.c +0 -2
-/* uncomment to get debug messages from the debug filesystem, ah the irony. */
-/* #define DEBUG */

Why did you remove these lines? They don't pertain to this patch.

These lines are obsolete.

Quoted 7 lines
Quoted 7 lines
fs/debugfs/inode.c +0 -1
-
  #include<linux/module.h>
  #include<linux/fs.h>
  #include<linux/mount.h>
@@ -540,17 +537,5 @@ static int __init debugfs_init(void)
 
Quoted 14 lines

fs/debugfs/inode.c static int __init debugfs_init(void) · line 551

Quoted 11 lines
fs/debugfs/inode.c +0 -9
  	return retval;
  }
-
-static void __exit debugfs_exit(void)
-{
-	debugfs_registered = false;
-
-	simple_release_fs(&debugfs_mount,&debugfs_mount_count);
-	unregister_filesystem(&debug_fs_type);
-	kobject_put(debug_kobj);
-}

When the code is built into the kernel, the __exit function should go away, so this isn't costing us any extra memory, right?

Perhaps, but this can still reduce the vmlinux size, right?

Quoted 4 lines

And debugfs used to be able to be built as a module, perhaps it will be in the future? I don't think this patch is really needed.

Huh? Wasn't it a module before?

I think the problem is tracers use debugfs, it needs to depends on DEBUGFS=y.

Thanks.

#3 lore raw
Quoted 16 lines · Cong Wang
Quoted 15 lines · Greg KH
Quoted 14 lines · Amerigo Wang

debugfs can't be a module, so module_exit() is meaningless for it.

---

fs/debugfs/inode.c +0 -0
index 37a8ca7..d38c88f 100644
@@ -13,9 +13,6 @@
  *
  */
 
Quoted 6 lines
Quoted 4 lines

fs/debugfs/inode.c line 17

Quoted 2 lines
fs/debugfs/inode.c +0 -2
-/* uncomment to get debug messages from the debug filesystem, ah the irony. */
-/* #define DEBUG */

Why did you remove these lines? They don't pertain to this patch.

These lines are obsolete.

Even if they were (and hint, I don't think they are), they have nothing to do with the patch you created so they don't belong here. The rule is "one patch per logical change" and you didn't even describe that you were removing these lines in the changelog entry, so that's two strikes against removing these lines.

Quoted 22 lines
Quoted 6 lines
Quoted 6 lines
fs/debugfs/inode.c +0 -1
-
 #include<linux/module.h>
 #include<linux/fs.h>
 #include<linux/mount.h>
@@ -540,17 +537,5 @@ static int __init debugfs_init(void)
 
Quoted 14 lines

fs/debugfs/inode.c static int __init debugfs_init(void) · line 551

Quoted 11 lines
fs/debugfs/inode.c +0 -9
 	return retval;
 }
-
-static void __exit debugfs_exit(void)
-{
-	debugfs_registered = false;
-
-	simple_release_fs(&debugfs_mount,&debugfs_mount_count);
-	unregister_filesystem(&debug_fs_type);
-	kobject_put(debug_kobj);
-}

When the code is built into the kernel, the __exit function should go away, so this isn't costing us any extra memory, right?

Quoted 1 line

Perhaps, but this can still reduce the vmlinux size, right?

Which really doesn't matter, right? How much is it reduced?

Quoted 5 lines
Quoted 3 lines

And debugfs used to be able to be built as a module, perhaps it will be in the future? I don't think this patch is really needed.

Huh? Wasn't it a module before?

Yes it was.

Quoted 1 line

I think the problem is tracers use debugfs, it needs to depends on DEBUGFS=y.

So if you disable tracing, then you could use debugfs as a module, right? So the patch should not be applied.

thanks,

greg k-h

author
#4 lore raw
Quoted 22 lines · Greg KH
Quoted 21 lines · Cong Wang
Quoted 19 lines · Greg KH
Quoted 11 lines · Amerigo Wang

debugfs can't be a module, so module_exit() is meaningless for it.

---

fs/debugfs/inode.c +0 -0
index 37a8ca7..d38c88f 100644

fs/debugfs/inode.c line 17

Quoted 5 lines
fs/debugfs/inode.c +0 -2
@@ -13,9 +13,6 @@
   *
   */
 
-/* uncomment to get debug messages from the debug filesystem, ah the irony. */
-/* #define DEBUG */

Why did you remove these lines? They don't pertain to this patch.

Quoted 8 lines
Quoted 1 line

These lines are obsolete.

Even if they were (and hint, I don't think they are), they have nothing to do with the patch you created so they don't belong here. The rule is "one patch per logical change" and you didn't even describe that you were removing these lines in the changelog entry, so that's two strikes against removing these lines.

Ok, teach me where DEBUG is used in that file?

Quoted 30 lines
Quoted 22 lines
Quoted 6 lines
Quoted 6 lines
fs/debugfs/inode.c +0 -1
-
  #include<linux/module.h>
  #include<linux/fs.h>
  #include<linux/mount.h>
@@ -540,17 +537,5 @@ static int __init debugfs_init(void)
 
Quoted 14 lines

fs/debugfs/inode.c static int __init debugfs_init(void) · line 551

Quoted 11 lines
fs/debugfs/inode.c +0 -9
  	return retval;
  }
-
-static void __exit debugfs_exit(void)
-{
-	debugfs_registered = false;
-
-	simple_release_fs(&debugfs_mount,&debugfs_mount_count);
-	unregister_filesystem(&debug_fs_type);
-	kobject_put(debug_kobj);
-}

When the code is built into the kernel, the __exit function should go away, so this isn't costing us any extra memory, right?

Quoted 1 line

Perhaps, but this can still reduce the vmlinux size, right?

Which really doesn't matter, right? How much is it reduced?

Quoted 4 lines
Quoted 3 lines

And debugfs used to be able to be built as a module, perhaps it will be in the future? I don't think this patch is really needed.

Quoted 9 lines
Quoted 1 line

Huh? Wasn't it a module before?

Yes it was.

Quoted 1 line

I think the problem is tracers use debugfs, it needs to depends on DEBUGFS=y.

So if you disable tracing, then you could use debugfs as a module, right? So the patch should not be applied.

No, that CONFIG is a bool, no way to make it as a module. Since you insist, I will send a patch to make it as a module.

Thanks.

#5 lore raw
Quoted 25 lines · Cong Wang
Quoted 24 lines · Greg KH
Quoted 22 lines · Cong Wang
Quoted 15 lines · Greg KH
Quoted 14 lines · Amerigo Wang

debugfs can't be a module, so module_exit() is meaningless for it.

---

fs/debugfs/inode.c +0 -0
index 37a8ca7..d38c88f 100644
@@ -13,9 +13,6 @@
  *
  */
 
Quoted 4 lines

fs/debugfs/inode.c line 17

Quoted 2 lines
fs/debugfs/inode.c +0 -2
-/* uncomment to get debug messages from the debug filesystem, ah the irony. */
-/* #define DEBUG */

Why did you remove these lines? They don't pertain to this patch.

These lines are obsolete.

Quoted 8 lines
Quoted 6 lines

Even if they were (and hint, I don't think they are), they have nothing to do with the patch you created so they don't belong here. The rule is "one patch per logical change" and you didn't even describe that you were removing these lines in the changelog entry, so that's two strikes against removing these lines.

Ok, teach me where DEBUG is used in that file?

It is. And even if it isn't, it still shouldn't be done in this patch, which is my main point here.

Quoted 34 lines
Quoted 34 lines
Quoted 22 lines
Quoted 6 lines
Quoted 6 lines
fs/debugfs/inode.c +0 -1
-
 #include<linux/module.h>
 #include<linux/fs.h>
 #include<linux/mount.h>
@@ -540,17 +537,5 @@ static int __init debugfs_init(void)
 
Quoted 14 lines

fs/debugfs/inode.c static int __init debugfs_init(void) · line 551

Quoted 11 lines
fs/debugfs/inode.c +0 -9
 	return retval;
 }
-
-static void __exit debugfs_exit(void)
-{
-	debugfs_registered = false;
-
-	simple_release_fs(&debugfs_mount,&debugfs_mount_count);
-	unregister_filesystem(&debug_fs_type);
-	kobject_put(debug_kobj);
-}

When the code is built into the kernel, the __exit function should go away, so this isn't costing us any extra memory, right?

Quoted 1 line

Perhaps, but this can still reduce the vmlinux size, right?

Which really doesn't matter, right? How much is it reduced?

Quoted 5 lines
Quoted 3 lines

And debugfs used to be able to be built as a module, perhaps it will be in the future? I don't think this patch is really needed.

Huh? Wasn't it a module before?

Yes it was.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

I think the problem is tracers use debugfs, it needs to depends on DEBUGFS=y.

So if you disable tracing, then you could use debugfs as a module, right? So the patch should not be applied.

No, that CONFIG is a bool, no way to make it as a module. Since you insist, I will send a patch to make it as a module.

{sigh} No, that's not what I ment at all.

greg k-h

author
#6 lore raw
Quoted 7 lines · Greg KH
Quoted 7 lines
Quoted 6 lines

Even if they were (and hint, I don't think they are), they have nothing to do with the patch you created so they don't belong here. The rule is "one patch per logical change" and you didn't even describe that you were removing these lines in the changelog entry, so that's two strikes against removing these lines.

Quoted 5 lines
Quoted 1 line

Ok, teach me where DEBUG is used in that file?

It is. And even if it isn't, it still shouldn't be done in this patch, which is my main point here.

I see.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

Huh? Wasn't it a module before?

Yes it was.

Quoted 1 line

I think the problem is tracers use debugfs, it needs to depends on DEBUGFS=y.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

So if you disable tracing, then you could use debugfs as a module, right? So the patch should not be applied.

No, that CONFIG is a bool, no way to make it as a module. Since you insist, I will send a patch to make it as a module.

{sigh} No, that's not what I ment at all.

Totally confused. :(

If you want to make it as a module, then we should not use 'bool' and tracers should depend on =y.

If not, then this patch applies.