init.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* -*- linux-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 int autofs_get_sb(struct file_system_type *fs_type,
  16. int flags, const char *dev_name, void *data, struct vfsmount *mnt)
  17. {
  18. return get_sb_nodev(fs_type, flags, data, autofs_fill_super, mnt);
  19. }
  20. static struct file_system_type autofs_fs_type = {
  21. .owner = THIS_MODULE,
  22. .name = "autofs",
  23. .get_sb = autofs_get_sb,
  24. .kill_sb = autofs_kill_sb,
  25. };
  26. static int __init init_autofs_fs(void)
  27. {
  28. return register_filesystem(&autofs_fs_type);
  29. }
  30. static void __exit exit_autofs_fs(void)
  31. {
  32. unregister_filesystem(&autofs_fs_type);
  33. }
  34. module_init(init_autofs_fs);
  35. module_exit(exit_autofs_fs);
  36. #ifdef DEBUG
  37. void autofs_say(const char *name, int len)
  38. {
  39. printk("(%d: ", len);
  40. while ( len-- )
  41. printk("%c", *name++);
  42. printk(")\n");
  43. }
  44. #endif
  45. MODULE_LICENSE("GPL");