fscache-index.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* NFS FS-Cache index structure definition
  2. *
  3. * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #include <linux/init.h>
  12. #include <linux/kernel.h>
  13. #include <linux/sched.h>
  14. #include <linux/mm.h>
  15. #include <linux/nfs_fs.h>
  16. #include <linux/nfs_fs_sb.h>
  17. #include <linux/in6.h>
  18. #include "internal.h"
  19. #include "fscache.h"
  20. #define NFSDBG_FACILITY NFSDBG_FSCACHE
  21. /*
  22. * Define the NFS filesystem for FS-Cache. Upon registration FS-Cache sticks
  23. * the cookie for the top-level index object for NFS into here. The top-level
  24. * index can than have other cache objects inserted into it.
  25. */
  26. struct fscache_netfs nfs_fscache_netfs = {
  27. .name = "nfs",
  28. .version = 0,
  29. };
  30. /*
  31. * Register NFS for caching
  32. */
  33. int nfs_fscache_register(void)
  34. {
  35. return fscache_register_netfs(&nfs_fscache_netfs);
  36. }
  37. /*
  38. * Unregister NFS for caching
  39. */
  40. void nfs_fscache_unregister(void)
  41. {
  42. fscache_unregister_netfs(&nfs_fscache_netfs);
  43. }