main.c 951 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright 2018 Google LLC
  4. */
  5. #include <linux/fs.h>
  6. #include <linux/init.h>
  7. #include <linux/module.h>
  8. #include <uapi/linux/incrementalfs.h>
  9. #include "sysfs.h"
  10. #include "vfs.h"
  11. static struct file_system_type incfs_fs_type = {
  12. .owner = THIS_MODULE,
  13. .name = INCFS_NAME,
  14. .mount = incfs_mount_fs,
  15. .kill_sb = incfs_kill_sb,
  16. .fs_flags = 0
  17. };
  18. static int __init init_incfs_module(void)
  19. {
  20. int err = 0;
  21. err = incfs_init_sysfs();
  22. if (err)
  23. return err;
  24. err = register_filesystem(&incfs_fs_type);
  25. if (err)
  26. incfs_cleanup_sysfs();
  27. return err;
  28. }
  29. static void __exit cleanup_incfs_module(void)
  30. {
  31. incfs_cleanup_sysfs();
  32. unregister_filesystem(&incfs_fs_type);
  33. }
  34. module_init(init_incfs_module);
  35. module_exit(cleanup_incfs_module);
  36. MODULE_LICENSE("GPL v2");
  37. MODULE_IMPORT_NS(ANDROID_GKI_VFS_EXPORT_ONLY);
  38. MODULE_AUTHOR("Eugene Zemtsov <ezemtsov@google.com>");
  39. MODULE_DESCRIPTION("Incremental File System");