init.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
  3. *
  4. * This file is part of the Linux kernel and is made available under
  5. * the terms of the GNU General Public License, version 2, or at your
  6. * option, any later version, incorporated herein by reference.
  7. */
  8. #include <linux/module.h>
  9. #include <linux/init.h>
  10. #include "autofs_i.h"
  11. static struct dentry *autofs_mount(struct file_system_type *fs_type,
  12. int flags, const char *dev_name, void *data)
  13. {
  14. return mount_nodev(fs_type, flags, data, autofs4_fill_super);
  15. }
  16. static struct file_system_type autofs_fs_type = {
  17. .owner = THIS_MODULE,
  18. .name = "autofs",
  19. .mount = autofs_mount,
  20. .kill_sb = autofs4_kill_sb,
  21. };
  22. MODULE_ALIAS_FS("autofs");
  23. static int __init init_autofs4_fs(void)
  24. {
  25. int err;
  26. autofs_dev_ioctl_init();
  27. err = register_filesystem(&autofs_fs_type);
  28. if (err)
  29. autofs_dev_ioctl_exit();
  30. return err;
  31. }
  32. static void __exit exit_autofs4_fs(void)
  33. {
  34. autofs_dev_ioctl_exit();
  35. unregister_filesystem(&autofs_fs_type);
  36. }
  37. module_init(init_autofs4_fs)
  38. module_exit(exit_autofs4_fs)
  39. MODULE_LICENSE("GPL");