diff options
author | attilio <attilio@FreeBSD.org> | 2012-11-08 00:32:49 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2012-11-08 00:32:49 +0000 |
commit | 1e93fc5eebeddeb9b55367b7dbe1cfd50b731fbe (patch) | |
tree | d1e3110effbc60ea33841aa63c836e4e9dfbb12f /sys/fs/fuse/fuse_internal.h | |
parent | a60f06157e6e44ea0691467709b746037e6111c2 (diff) | |
download | FreeBSD-src-1e93fc5eebeddeb9b55367b7dbe1cfd50b731fbe.zip FreeBSD-src-1e93fc5eebeddeb9b55367b7dbe1cfd50b731fbe.tar.gz |
- Current caching mode is completely broken because it simply relies
on timing of the operations and not real lookup, bringing too many
false positives. Remove the whole mechanism. If it needs to be
implemented, next time it should really be done in the proper way.
- Fix VOP_GETATTR() in order to cope with userland bugs that would
change the type of file and not panic. Instead it gets the entry as
if it is not existing.
Reported and tested by: flo
MFC after: 2 months
X-MFC: 241519, 242536,242616
Diffstat (limited to 'sys/fs/fuse/fuse_internal.h')
-rw-r--r-- | sys/fs/fuse/fuse_internal.h | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/sys/fs/fuse/fuse_internal.h b/sys/fs/fuse/fuse_internal.h index 9cf20e9..187245c 100644 --- a/sys/fs/fuse/fuse_internal.h +++ b/sys/fs/fuse/fuse_internal.h @@ -138,23 +138,6 @@ uio_setresid(struct uio *uio, ssize_t resid) uio->uio_resid = resid; } -/* time */ - -#define fuse_timespec_add(vvp, uvp) \ - do { \ - (vvp)->tv_sec += (uvp)->tv_sec; \ - (vvp)->tv_nsec += (uvp)->tv_nsec; \ - if ((vvp)->tv_nsec >= 1000000000) { \ - (vvp)->tv_sec++; \ - (vvp)->tv_nsec -= 1000000000; \ - } \ - } while (0) - -#define fuse_timespec_cmp(tvp, uvp, cmp) \ - (((tvp)->tv_sec == (uvp)->tv_sec) ? \ - ((tvp)->tv_nsec cmp (uvp)->tv_nsec) : \ - ((tvp)->tv_sec cmp (uvp)->tv_sec)) - /* miscellaneous */ static __inline__ @@ -254,17 +237,9 @@ fuse_internal_attr_fat2vat(struct mount *mp, } -#define cache_attrs(vp, fuse_out) do { \ - struct timespec uptsp_ ## __func__; \ - \ - VTOFUD(vp)->cached_attrs_valid.tv_sec = (fuse_out)->attr_valid; \ - VTOFUD(vp)->cached_attrs_valid.tv_nsec = (fuse_out)->attr_valid_nsec; \ - nanouptime(&uptsp_ ## __func__); \ - \ - fuse_timespec_add(&VTOFUD(vp)->cached_attrs_valid, &uptsp_ ## __func__); \ - \ - fuse_internal_attr_fat2vat(vnode_mount(vp), &(fuse_out)->attr, VTOVA(vp)); \ -} while (0) +#define cache_attrs(vp, fuse_out) \ + fuse_internal_attr_fat2vat(vnode_mount(vp), &(fuse_out)->attr, \ + VTOVA(vp)); /* fsync */ |