Skip to contentSkip to conversation

what's the point of register_filesystem() in drivers/dax/super.c?

RFC Al Viro 2 participants 4 messages Mar 16, 2019 – Mar 17, 2019

Subsystems (2)
lore
Share & tools
lore

Al Viro

author maintainer
#0 lore raw

It's not user-mountable, kern_mount() doesn't care about
looking it up by name, so the only effect of having it registered is having it visible in /proc/filesystems.

Do you need that for anything? Because I would rather
avoid more of that voodoo...

#1 lore raw
Quoted 7 lines · Al Viro

It's not user-mountable, kern_mount() doesn't care about
looking it up by name, so the only effect of having it registered is having it visible in /proc/filesystems.

Do you need that for anything? Because I would rather
avoid more of that voodoo...

It can die. It was mindless copy/paste from fs/blockdev.c and the "bdev" fs. The device-dax unit tests pass just fine with it removed. I'll send a formal patch with the following:

drivers/dax/super.c +0 -7
index ccb22d8db3a2..3d6a9e61e358 100644
@@ -615,10 +615,6 @@ static int dax_fs_init(void)
        if (!dax_cache)
                return -ENOMEM;
 
-       rc = register_filesystem(&dax_fs_type);
-       if (rc)
-               goto err_register_fs;
-
        dax_mnt = kern_mount(&dax_fs_type);
        if (IS_ERR(dax_mnt)) {
                rc = PTR_ERR(dax_mnt);
@@ -629,8 +625,6 @@ static int dax_fs_init(void)
        return 0;
 
  err_mount:
-       unregister_filesystem(&dax_fs_type);
- err_register_fs:
        kmem_cache_destroy(dax_cache);
 
        return rc;
@@ -639,7 +633,6 @@ static int dax_fs_init(void)
 static void dax_fs_exit(void)
 {
        kern_unmount(dax_mnt);
-       unregister_filesystem(&dax_fs_type);
        kmem_cache_destroy(dax_cache);
 }
author maintainer Acked-by
#2 lore raw
Quoted 6 lines · Dan Williams
Quoted 5 lines · Al Viro

It's not user-mountable, kern_mount() doesn't care about
looking it up by name, so the only effect of having it registered is having it visible in /proc/filesystems.

Quoted 6 lines
Quoted 2 lines

Do you need that for anything? Because I would rather
avoid more of that voodoo...

It can die. It was mindless copy/paste from fs/blockdev.c and the "bdev" fs. The device-dax unit tests pass just fine with it removed. I'll send a formal patch with the following:

Do you prefer it in your tree, or would you rather have it go through vfs.git?

#3 lore raw
Quoted 11 lines · Al Viro
Quoted 9 lines · Dan Williams
Quoted 7 lines · Al Viro

It's not user-mountable, kern_mount() doesn't care about
looking it up by name, so the only effect of having it registered is having it visible in /proc/filesystems.

Do you need that for anything? Because I would rather
avoid more of that voodoo...

Quoted 8 lines
Quoted 3 lines

It can die. It was mindless copy/paste from fs/blockdev.c and the "bdev" fs. The device-dax unit tests pass just fine with it removed. I'll send a formal patch with the following:

Do you prefer it in your tree, or would you rather have it go through vfs.git?

vfs.git is fine. Patch inbound.