export.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // SPDX-License-Identifier: LGPL-2.1
  2. /*
  3. *
  4. * Copyright (C) International Business Machines Corp., 2007
  5. * Author(s): Steve French ([email protected])
  6. *
  7. * Common Internet FileSystem (CIFS) client
  8. *
  9. * Operations related to support for exporting files via NFSD
  10. *
  11. */
  12. /*
  13. * See Documentation/filesystems/nfs/exporting.rst
  14. * and examples in fs/exportfs
  15. *
  16. * Since cifs is a network file system, an "fsid" must be included for
  17. * any nfs exports file entries which refer to cifs paths. In addition
  18. * the cifs mount must be mounted with the "serverino" option (ie use stable
  19. * server inode numbers instead of locally generated temporary ones).
  20. * Although cifs inodes do not use generation numbers (have generation number
  21. * of zero) - the inode number alone should be good enough for simple cases
  22. * in which users want to export cifs shares with NFS. The decode and encode
  23. * could be improved by using a new routine which expects 64 bit inode numbers
  24. * instead of the default 32 bit routines in fs/exportfs
  25. *
  26. */
  27. #include <linux/fs.h>
  28. #include <linux/exportfs.h>
  29. #include "cifsglob.h"
  30. #include "cifs_debug.h"
  31. #include "cifsfs.h"
  32. #ifdef CONFIG_CIFS_NFSD_EXPORT
  33. static struct dentry *cifs_get_parent(struct dentry *dentry)
  34. {
  35. /* BB need to add code here eventually to enable export via NFSD */
  36. cifs_dbg(FYI, "get parent for %p\n", dentry);
  37. return ERR_PTR(-EACCES);
  38. }
  39. const struct export_operations cifs_export_ops = {
  40. .get_parent = cifs_get_parent,
  41. /* Following five export operations are unneeded so far and can default:
  42. .get_dentry =
  43. .get_name =
  44. .find_exported_dentry =
  45. .decode_fh =
  46. .encode_fs = */
  47. };
  48. #endif /* CONFIG_CIFS_NFSD_EXPORT */