• Amir Goldstein's avatar
    fuse: introduce inode io modes · cb098dd2
    Amir Goldstein authored
    The fuse inode io mode is determined by the mode of its open files/mmaps
    and parallel dio opens and expressed in the value of fi->iocachectr:
    
     > 0 - caching io: files open in caching mode or mmap on direct_io file
     < 0 - parallel dio: direct io mode with parallel dio writes enabled
    == 0 - direct io: no files open in caching mode and no files mmaped
    
    Note that iocachectr value of 0 might become positive or negative,
    while non-parallel dio is getting processed.
    
    direct_io mmap uses page cache, so first mmap will mark the file as
    ff->io_opened and increment fi->iocachectr to enter the caching io mode.
    
    If the server opens the file in caching mode while it is already open
    for parallel dio or vice versa the open fails.
    
    This allows executing parallel dio when inode is not in caching mode
    and no mmaps have been performed on the inode in question.
    Signed-off-by: default avatarBernd Schubert <bschubert@ddn.com>
    Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
    Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
    cb098dd2
fuse_i.h 33.8 KB