aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <miklos@szeredi.hu>2006-02-17 15:49:25 +0000
committerGravatar Miklos Szeredi <miklos@szeredi.hu>2006-02-17 15:49:25 +0000
commit1bf64f48067728cc470c3779f7eec78a0ffbd2c5 (patch)
treeb9b216f44f6f7b6a9665783e5e99762ac1c63d7b /example
parent6e806e964d722e7e0f7c029b50d69cf877c193ee (diff)
fix
Diffstat (limited to 'example')
-rw-r--r--example/hello_ll.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/example/hello_ll.c b/example/hello_ll.c
index 7682f4e..2213285 100644
--- a/example/hello_ll.c
+++ b/example/hello_ll.c
@@ -75,15 +75,17 @@ struct dirbuf {
size_t size;
};
-static void dirbuf_add(struct dirbuf *b, const char *name, fuse_ino_t ino)
+static void dirbuf_add(fuse_req_t req, struct dirbuf *b, const char *name,
+ fuse_ino_t ino)
{
struct stat stbuf;
size_t oldsize = b->size;
- b->size += fuse_dirent_size(strlen(name));
+ b->size += fuse_add_direntry(req, NULL, 0, name, NULL, 0);
b->p = (char *) realloc(b->p, b->size);
memset(&stbuf, 0, sizeof(stbuf));
stbuf.st_ino = ino;
- fuse_add_dirent(b->p + oldsize, name, &stbuf, b->size);
+ fuse_add_direntry(req, b->p + oldsize, b->size - oldsize, name, &stbuf,
+ b->size);
}
#define min(x, y) ((x) < (y) ? (x) : (y))
@@ -108,9 +110,9 @@ static void hello_ll_readdir(fuse_req_t req, fuse_ino_t ino, size_t size,
struct dirbuf b;
memset(&b, 0, sizeof(b));
- dirbuf_add(&b, ".", 1);
- dirbuf_add(&b, "..", 1);
- dirbuf_add(&b, hello_name, 2);
+ dirbuf_add(req, &b, ".", 1);
+ dirbuf_add(req, &b, "..", 1);
+ dirbuf_add(req, &b, hello_name, 2);
reply_buf_limited(req, b.p, b.size, off, size);
free(b.p);
}