You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.1 KiB

  1. package mount
  2. import (
  3. "github.com/hanwen/go-fuse/v2/fuse"
  4. )
  5. /**
  6. * Flush method
  7. *
  8. * This is called on each close() of the opened file.
  9. *
  10. * Since file descriptors can be duplicated (dup, dup2, fork), for
  11. * one open call there may be many flush calls.
  12. *
  13. * Filesystems shouldn't assume that flush will always be called
  14. * after some writes, or that if will be called at all.
  15. *
  16. * fi->fh will contain the value set by the open method, or will
  17. * be undefined if the open method didn't set any value.
  18. *
  19. * NOTE: the name of the method is misleading, since (unlike
  20. * fsync) the filesystem is not forced to flush pending writes.
  21. * One reason to flush data is if the filesystem wants to return
  22. * write errors during close. However, such use is non-portable
  23. * because POSIX does not require [close] to wait for delayed I/O to
  24. * complete.
  25. *
  26. * If the filesystem supports file locking operations (setlk,
  27. * getlk) it should remove all locks belonging to 'fi->owner'.
  28. *
  29. * If this request is answered with an error code of ENOSYS,
  30. * this is treated as success and future calls to flush() will
  31. * succeed automatically without being send to the filesystem
  32. * process.
  33. *
  34. * Valid replies:
  35. * fuse_reply_err
  36. *
  37. * @param req request handle
  38. * @param ino the inode number
  39. * @param fi file information
  40. *
  41. * [close]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html
  42. */
  43. func (wfs *WFS) Flush(cancel <-chan struct{}, in *fuse.FlushIn) fuse.Status {
  44. return fuse.ENOSYS
  45. }
  46. /**
  47. * Synchronize file contents
  48. *
  49. * If the datasync parameter is non-zero, then only the user data
  50. * should be flushed, not the meta data.
  51. *
  52. * If this request is answered with an error code of ENOSYS,
  53. * this is treated as success and future calls to fsync() will
  54. * succeed automatically without being send to the filesystem
  55. * process.
  56. *
  57. * Valid replies:
  58. * fuse_reply_err
  59. *
  60. * @param req request handle
  61. * @param ino the inode number
  62. * @param datasync flag indicating if only data should be flushed
  63. * @param fi file information
  64. */
  65. func (wfs *WFS) Fsync(cancel <-chan struct{}, in *fuse.FsyncIn) (code fuse.Status) {
  66. return fuse.ENOSYS
  67. }