passthrough_ll: add is_symlink to lo_inode
authorMiklos Szeredi <mszeredi@redhat.com>
Tue, 14 Aug 2018 19:37:02 +0000 (21:37 +0200)
committerNikolaus Rath <Nikolaus@rath.org>
Wed, 10 Oct 2018 09:49:48 +0000 (10:49 +0100)
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
example/passthrough_ll.c

index 4c4f68af3a3c64a2c1fd2be6b682ff60ca2a0317..700483fb708a31f3ecb67255637e4edddc5868b2 100644 (file)
@@ -69,6 +69,7 @@ struct lo_inode {
        struct lo_inode *next; /* protected by lo->mutex */
        struct lo_inode *prev; /* protected by lo->mutex */
        int fd;
+       bool is_symlink;
        ino_t ino;
        dev_t dev;
        uint64_t refcount; /* protected by lo->mutex */
@@ -193,6 +194,7 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
                if (!inode)
                        goto out_err;
 
+               inode->is_symlink = S_ISLNK(e->attr.st_mode);
                inode->refcount = 1;
                inode->fd = newfd;
                inode->ino = e->attr.st_ino;
@@ -612,6 +614,7 @@ int main(int argc, char *argv[])
        
        lo.debug = opts.debug;
        lo.root.refcount = 2;
+       lo.root.is_symlink = false;
        lo.root.fd = open("/", O_PATH);
        if (lo.root.fd == -1)
                err(1, "open(\"/\", O_PATH)");