From 30ece080006087a7e615cce3f7fc51b6d8a5d5bf Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 8 Feb 2008 17:22:15 +0000 Subject: Support receiving file handle from kernel in GETATTR request; Allow operations with a NULL path argument, if the filesystem supports it --- lib/fuse_lowlevel.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'lib/fuse_lowlevel.c') diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index ed885fd..d1ef7b2 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -458,10 +458,22 @@ static void do_forget(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) static void do_getattr(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) { - (void) inarg; + struct fuse_file_info *fip = NULL; + struct fuse_file_info fi; + + if (req->f->conn.proto_minor >= 9) { + struct fuse_getattr_in *arg = (struct fuse_getattr_in *) inarg; + + if (arg->getattr_flags & FUSE_GETATTR_FH) { + memset(&fi, 0, sizeof(fi)); + fi.fh = arg->fh; + fi.fh_old = fi.fh; + fip = &fi; + } + } if (req->f->op.getattr) - req->f->op.getattr(req, nodeid, NULL); + req->f->op.getattr(req, nodeid, fip); else fuse_reply_err(req, ENOSYS); } -- cgit v1.2.3