• Jeff Layton's avatar
    ceph: add new "nopagecache" option · 94cc0877
    Jeff Layton authored
    CephFS is a bit unlike most other filesystems in that it only
    conditionally does buffered I/O based on the caps that it gets from the
    MDS. In most cases, unless there is contended access for an inode the
    MDS does give Fbc caps to the client, so the unbuffered codepaths are
    only infrequently traveled and are difficult to test.
    
    At one time, the "-o sync" mount option would give you this behavior,
    but that was removed in commit 7ab9b380 ("ceph: Don't use
    ceph-sync-mode for synchronous-fs.").
    
    Add a new mount option to tell the client to ignore Fbc caps when doing
    I/O, and to use the synchronous codepaths exclusively, even on
    non-O_DIRECT file descriptors. We already have an ioctl that forces this
    behavior on a per-file basis, so we can just always set the CEPH_F_SYNC
    flag in the file description on such mounts.
    
    Additionally, this patch also changes the client to not request Fbc when
    doing direct I/O. We aren't using the cache with O_DIRECT so we don't
    have any need for those caps.
    Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
    Acked-by: default avatarGreg Farnum <gfarnum@redhat.com>
    Reviewed-by: default avatarVenky Shankar <vshankar@redhat.com>
    Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
    94cc0877
super.c 37.3 KB