• A
    fuse: add FOPEN_NOFLUSH · a390ccb3
    Amir Goldstein 提交于
    Add flag returned by FUSE_OPEN and FUSE_CREATE requests to avoid flushing
    data cache on close.
    
    Different filesystems implement ->flush() is different ways:
     - Most disk filesystems do not implement ->flush() at all
     - Some network filesystem (e.g. nfs) flush local write cache of
       FMODE_WRITE file and send a "flush" command to server
     - Some network filesystem (e.g. cifs) flush local write cache of
       FMODE_WRITE file without sending an additional command to server
    
    FUSE flushes local write cache of ANY file, even non FMODE_WRITE
    and sends a "flush" command to server (if server implements it).
    
    The FUSE implementation of ->flush() seems over agressive and
    arbitrary and does not make a lot of sense when writeback caching is
    disabled.
    
    Instead of deciding on another arbitrary implementation that makes
    sense, leave the choice of per-file flush behavior in the hands of
    the server.
    
    Link: https://lore.kernel.org/linux-fsdevel/CAJfpegspE8e6aKd47uZtSYX8Y-1e1FWS0VL0DH2Skb9gQP5RJQ@mail.gmail.com/Suggested-by: NMiklos Szeredi <mszeredi@redhat.com>
    Signed-off-by: NAmir Goldstein <amir73il@gmail.com>
    Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
    a390ccb3
fuse.h 22.7 KB