diff options
| author | 2013-10-08 04:57:39 +0000 | |
|---|---|---|
| committer | 2013-10-08 04:57:39 +0000 | |
| commit | f86cb379aa3f133365a9a17c7eebd29046a89c47 (patch) | |
| tree | 842bc8774ccbb968ad3315474ecc48a184d151bb /lib | |
| parent | Fix delivery of SIGPROF and SIGVTALRM to threaded processes by having (diff) | |
| download | wireguard-openbsd-f86cb379aa3f133365a9a17c7eebd29046a89c47.tar.xz wireguard-openbsd-f86cb379aa3f133365a9a17c7eebd29046a89c47.zip | |
1) our dirent entries are now 8 byte aligned.
2) d_type isn't the file's st_mode, but rather a type that can be derived
from the file's mode.
3) the readdir callback should be setting d_off. Assume for now that
fuse-based filesystems can operate with length based offsets
4) if the file type is unknown, use DT_UNKNOWN explictly instead
of assuming that's equal to zero
ok syl@
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libfuse/fuse_ops.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libfuse/fuse_ops.c b/lib/libfuse/fuse_ops.c index 0e10a306060..8ec2543b9c6 100644 --- a/lib/libfuse/fuse_ops.c +++ b/lib/libfuse/fuse_ops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fuse_ops.c,v 1.12 2013/10/07 18:41:01 syl Exp $ */ +/* $OpenBSD: fuse_ops.c,v 1.13 2013/10/08 04:57:39 guenther Exp $ */ /* * Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com> * @@ -188,7 +188,7 @@ ifuse_ops_opendir(struct fuse *f, struct fusebuf *fbuf) } #define GENERIC_DIRSIZ(NLEN) \ -((sizeof (struct dirent) - (MAXNAMLEN+1)) + ((NLEN+1 + 3) &~ 3)) +((sizeof (struct dirent) - (MAXNAMLEN+1)) + ((NLEN+1 + 7) &~ 7)) static int ifuse_fill_readdir(void *dh, const char *name, const struct stat *stbuf, @@ -222,13 +222,14 @@ ifuse_fill_readdir(void *dh, const char *name, const struct stat *stbuf, if (stbuf) { dir->d_fileno = stbuf->st_ino; - dir->d_type = stbuf->st_mode; + dir->d_type = IFTODT(stbuf->st_mode); } else { dir->d_fileno = 0xffffffff; - dir->d_type = 0; + dir->d_type = DT_UNKNOWN; } dir->d_namlen = namelen; dir->d_reclen = len; + dir->d_off = off + len; /* XXX */ memcpy(dir->d_name, name, namelen); fbuf->fb_len += len; |
