diff options
author | Eric Wong <normalperson@yhbt.net> | 2014-03-05 14:45:44 +0100 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2014-03-05 14:45:44 +0100 |
commit | 6bf2e6f07c133f7b145a4726c5d962f14c650ca7 (patch) | |
tree | 7ab3a9941edad868c961404f0bbee23967990118 /example/fioc.c | |
parent | 0096c126aa4548df66c658afeb18a5a5356a2c57 (diff) | |
download | libfuse-6bf2e6f07c133f7b145a4726c5d962f14c650ca7.tar.gz |
libfuse: implement readdirplus for high-level API
Reuse the old "readdir" callback, but add a flags argument, that has
FUSE_READDIR_PLUS in case this is a "plus" version. Filesystems can safely
ignore this flag, but if they want they can add optimizations based on it:
i.e. only retrieve the full attributes in PLUS mode.
The filler function is also given a flags argument and the filesystem can
set FUSE_FILL_DIR_PLUS if all the attributes in "stat" are valid.
Diffstat (limited to 'example/fioc.c')
-rwxr-xr-x | example/fioc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/example/fioc.c b/example/fioc.c index 2117ac8..368f807 100755 --- a/example/fioc.c +++ b/example/fioc.c @@ -169,17 +169,19 @@ static int fioc_truncate(const char *path, off_t size) } static int fioc_readdir(const char *path, void *buf, fuse_fill_dir_t filler, - off_t offset, struct fuse_file_info *fi) + off_t offset, struct fuse_file_info *fi, + enum fuse_readdir_flags flags) { (void) fi; (void) offset; + (void) flags; if (fioc_file_type(path) != FIOC_ROOT) return -ENOENT; - filler(buf, ".", NULL, 0); - filler(buf, "..", NULL, 0); - filler(buf, FIOC_NAME, NULL, 0); + filler(buf, ".", NULL, 0, 0); + filler(buf, "..", NULL, 0, 0); + filler(buf, FIOC_NAME, NULL, 0, 0); return 0; } |