From 0a76670183f484461cf7d69c2761cfd65547500f Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Mon, 26 Aug 2024 19:33:47 +0200 Subject: getattr: Make use of FUSE_GETATTR_FH in lowlevel examples High level examples were already using it, but not lowlevel. Also update the documentation. --- example/passthrough_ll.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'example/passthrough_ll.c') diff --git a/example/passthrough_ll.c b/example/passthrough_ll.c index 87c18a2..62a42f4 100644 --- a/example/passthrough_ll.c +++ b/example/passthrough_ll.c @@ -204,10 +204,11 @@ static void lo_getattr(fuse_req_t req, fuse_ino_t ino, int res; struct stat buf; struct lo_data *lo = lo_data(req); + int fd = fi ? fi->fh : lo_fd(req, ino); (void) fi; - res = fstatat(lo_fd(req, ino), "", &buf, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW); + res = fstatat(fd, "", &buf, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW); if (res == -1) return (void) fuse_reply_err(req, errno); -- cgit v1.2.3