collaborative-system / tea

Team Editing Advance Tools
0 stars 0 forks source link

Copy_file_range fuse operation #45

Open mati2251 opened 2 weeks ago

mati2251 commented 2 weeks ago

Documentation description

    /**
     * Copy a range of data from one file to another
     *
     * Performs an optimized copy between two file descriptors without the
     * additional cost of transferring data through the FUSE kernel module
     * to user space (glibc) and then back into the FUSE filesystem again.
     *
     * In case this method is not implemented, applications are expected to
     * fall back to a regular file copy.   (Some glibc versions did this
     * emulation automatically, but the emulation has been removed from all
     * glibc release branches.)
     */
    ssize_t (*copy_file_range) (const char *path_in,
                    struct fuse_file_info *fi_in,
                    off_t offset_in, const char *path_out,
                    struct fuse_file_info *fi_out,
                    off_t offset_out, size_t size, int flags);

General instructions on where to implement the fuse method

each point should contain two new types, request and response

  1. In the proto/messages.proto file
    • add two new types and two new messages to enum
  2. In common/io.h
    • Add new recv handlers:
  3. In common/io.cpp
    • Add new types to switch within recv_handler
  4. In server/fs.cpp
    • Add new request handler
    • Add new handlers to recv_handlers
  5. In filesystem/tcp.cpp
    • Add new handlers to recv_handlers
  6. In filesystem/fs.cpp
    • implement your fuse method