dotnwat / gassyfs

gassyfs - distributed in-memory file system over RDMA
GNU Lesser General Public License v2.1
29 stars 6 forks source link

fs: support retreive_reply #17

Closed dotnwat closed 9 years ago

dotnwat commented 9 years ago

There doesn't seem to be any examples (check the fuse examples, there is something there to look at at least for some pointers). Add the retreive_reply and print out the parameters for a simple cat call and start figuring out how this works.

dotnwat commented 9 years ago

Originally I thought this was the call for doing zero-copy reads. Actually it is just the normal read but with a different reply. So, this issue can be closed as the use of zero-copy will be looked into during optimization phase. Here is an example:

static void lo_read(fuse_req_t req, fuse_ino_t ino, size_t size,
              off_t offset, struct fuse_file_info *fi)
{
    struct fuse_bufvec buf = FUSE_BUFVEC_INIT(size);

    (void) ino;

    buf.buf[0].flags = FUSE_BUF_IS_FD | FUSE_BUF_FD_SEEK;
    buf.buf[0].fd = fi->fh;
    buf.buf[0].pos = offset;

    fuse_reply_data(req, &buf, FUSE_BUF_SPLICE_MOVE);
}