From 8fb48feb5024d2aa9083690e472f1b1072cb8169 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Mon, 8 Nov 2004 14:48:52 +0000 Subject: getdir related API change --- lib/fuse.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/fuse.c') diff --git a/lib/fuse.c b/lib/fuse.c index 6b42252..ddb7ce3 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -429,13 +429,17 @@ static void convert_stat(struct stat *stbuf, struct fuse_attr *attr) #endif } -static int fill_dir(struct fuse_dirhandle *dh, char *name, int type) +static int fill_dir(struct fuse_dirhandle *dh, const char *name, int type, + ino_t ino) { struct fuse_dirent dirent; size_t reclen; size_t res; - dirent.ino = (unsigned long) -1; + if ((dh->fuse->flags & FUSE_USE_INO)) + dirent.ino = ino; + else + dirent.ino = (unsigned long) -1; dirent.namelen = strlen(name); strncpy(dirent.name, name, sizeof(dirent.name)); dirent.type = type; @@ -821,7 +825,7 @@ static void do_getdir(struct fuse *f, struct fuse_in_header *in) if (path != NULL) { res = -ENOSYS; if (f->op.getdir) - res = f->op.getdir(path, &dh, (fuse_dirfil_t) fill_dir); + res = f->op.getdir(path, &dh, fill_dir); free(path); } fflush(dh.fp); -- cgit v1.2.3