init.c 1.2 KB

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