aboutsummaryrefslogtreecommitdiff
path: root/lib/fuse_lowlevel.c
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <miklos@szeredi.hu>2008-02-08 17:22:15 +0000
committerGravatar Miklos Szeredi <miklos@szeredi.hu>2008-02-08 17:22:15 +0000
commit30ece080006087a7e615cce3f7fc51b6d8a5d5bf (patch)
tree5d60a4679f82a1bb941356278d87abe2b9560d1b /lib/fuse_lowlevel.c
parentb20d88bbbc6e5ae67f0c99595859fd653949a3aa (diff)
Support receiving file handle from kernel in GETATTR request; Allow operations with a NULL path argument, if the filesystem supports it
Diffstat (limited to 'lib/fuse_lowlevel.c')
-rw-r--r--lib/fuse_lowlevel.c16
1 files changed, 14 insertions, 2 deletions
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);
}