From 4b2157c44e6ad7e692fcffb7450143e83151d36b Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 6 Dec 2011 18:06:18 +0100 Subject: Add mmap() and munmap() methods to low level API Currently this is only useful for CUSE. Also update retrieve_reply() method. --- lib/cuse_lowlevel.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'lib/cuse_lowlevel.c') diff --git a/lib/cuse_lowlevel.c b/lib/cuse_lowlevel.c index 402cf4b..7bd289a 100644 --- a/lib/cuse_lowlevel.c +++ b/lib/cuse_lowlevel.c @@ -93,6 +93,28 @@ static void cuse_fll_poll(fuse_req_t req, fuse_ino_t ino, req_clop(req)->poll(req, fi, ph); } +static void cuse_fll_mmap(fuse_req_t req, fuse_ino_t ino, uint64_t addr, + size_t length, int prot, int flags, off_t offset, + struct fuse_file_info *fi) +{ + (void)ino; + req_clop(req)->mmap(req, addr, length, prot, flags, offset, fi); +} + +static void cuse_fll_munmap(fuse_req_t req, fuse_ino_t ino, uint64_t map_id, + size_t length, struct fuse_file_info *fi) +{ + (void)ino; + req_clop(req)->munmap(req, map_id, length, fi); +} + +static void cuse_fll_retrieve_reply(fuse_req_t req, void *cookie, + fuse_ino_t ino, off_t offset, + struct fuse_bufvec *bufv) +{ + req_clop(req)->retrieve_reply(req, cookie, ino, offset, bufv); +} + static size_t cuse_pack_info(int argc, const char **argv, char *buf) { size_t size = 0; @@ -169,6 +191,10 @@ struct fuse_session *cuse_lowlevel_new(struct fuse_args *args, lop.fsync = clop->fsync ? cuse_fll_fsync : NULL; lop.ioctl = clop->ioctl ? cuse_fll_ioctl : NULL; lop.poll = clop->poll ? cuse_fll_poll : NULL; + lop.mmap = clop->mmap ? cuse_fll_mmap : NULL; + lop.munmap = clop->munmap ? cuse_fll_munmap : NULL; + lop.retrieve_reply = clop->retrieve_reply ? + cuse_fll_retrieve_reply : NULL; se = fuse_lowlevel_new_common(args, &lop, sizeof(lop), userdata); if (!se) { -- cgit v1.2.3