fuse: Implement FOPEN_KEEP_CACHE flag
Implement FUSE open flag FOPEN_KEEP_CACHE. Without this flag, cached file contents should be invalidated on open. Apparently, fusefs-encfs relies upon this behavior. PR: 218636 Submitted by: Ben RUBSON <ben.rubson at gmail.com>
This commit is contained in:
parent
737534aac0
commit
6520c75f85
@ -272,8 +272,6 @@ fuse_vnode_open(struct vnode *vp, int32_t fuse_open_flags, struct thread *td)
|
||||
/*
|
||||
* Funcation is called for every vnode open.
|
||||
* Merge fuse_open_flags it may be 0
|
||||
*
|
||||
* XXXIP: Handle FOPEN_KEEP_CACHE
|
||||
*/
|
||||
/*
|
||||
* Ideally speaking, direct io should be enabled on
|
||||
@ -293,6 +291,8 @@ fuse_vnode_open(struct vnode *vp, int32_t fuse_open_flags, struct thread *td)
|
||||
VTOFUD(vp)->flag |= FN_DIRECTIO;
|
||||
fuse_io_invalbuf(vp, td);
|
||||
} else {
|
||||
if ((fuse_open_flags & FOPEN_KEEP_CACHE) == 0)
|
||||
fuse_io_invalbuf(vp, td);
|
||||
VTOFUD(vp)->flag &= ~FN_DIRECTIO;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user