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.

65 lines
2.1 KiB

3 years ago
3 years ago
3 years ago
  1. package mount
  2. import "github.com/hanwen/go-fuse/v2/fuse"
  3. // https://github.com/libfuse/libfuse/blob/48ae2e72b39b6a31cb2194f6f11786b7ca06aac6/include/fuse.h#L778
  4. /**
  5. * Copy a range of data from one file to anotherNiels de Vos, 4 years ago: libfuse: add copy_file_range() support
  6. *
  7. * Performs an optimized copy between two file descriptors without the
  8. * additional cost of transferring data through the FUSE kernel module
  9. * to user space (glibc) and then back into the FUSE filesystem again.
  10. *
  11. * In case this method is not implemented, applications are expected to
  12. * fall back to a regular file copy. (Some glibc versions did this
  13. * emulation automatically, but the emulation has been removed from all
  14. * glibc release branches.)
  15. */
  16. func (wfs *WFS) CopyFileRange(cancel <-chan struct{}, in *fuse.CopyFileRangeIn) (written uint32, code fuse.Status) {
  17. return 0, fuse.ENOSYS
  18. }
  19. /**
  20. * Allocates space for an open file
  21. *
  22. * This function ensures that required space is allocated for specified
  23. * file. If this function returns success then any subsequent write
  24. * request to specified range is guaranteed not to fail because of lack
  25. * of space on the file system media.
  26. */
  27. func (wfs *WFS) Fallocate(cancel <-chan struct{}, in *fuse.FallocateIn) (code fuse.Status) {
  28. return fuse.ENOSYS
  29. }
  30. /**
  31. * Find next data or hole after the specified offset
  32. */
  33. func (wfs *WFS) Lseek(cancel <-chan struct{}, in *fuse.LseekIn, out *fuse.LseekOut) fuse.Status {
  34. return fuse.ENOSYS
  35. }
  36. func (wfs *WFS) GetLk(cancel <-chan struct{}, in *fuse.LkIn, out *fuse.LkOut) (code fuse.Status) {
  37. return fuse.ENOSYS
  38. }
  39. func (wfs *WFS) SetLk(cancel <-chan struct{}, in *fuse.LkIn) (code fuse.Status) {
  40. return fuse.ENOSYS
  41. }
  42. func (wfs *WFS) SetLkw(cancel <-chan struct{}, in *fuse.LkIn) (code fuse.Status) {
  43. return fuse.ENOSYS
  44. }
  45. /**
  46. * Check file access permissions
  47. *
  48. * This will be called for the access() system call. If the
  49. * 'default_permissions' mount option is given, this method is not
  50. * called.
  51. *
  52. * This method is not called under Linux kernel versions 2.4.x
  53. */
  54. func (wfs *WFS) Access(cancel <-chan struct{}, input *fuse.AccessIn) (code fuse.Status) {
  55. return fuse.ENOSYS
  56. }