]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
fuse: add fuse_should_enable_dax() helper
authorJeffle Xu <jefflexu@linux.alibaba.com>
Thu, 25 Nov 2021 07:05:24 +0000 (15:05 +0800)
committerMiklos Szeredi <mszeredi@redhat.com>
Tue, 14 Dec 2021 10:09:36 +0000 (11:09 +0100)
This is in prep for following per inode DAX checking.

Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Reviewed-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/dax.c

index 713818d74de6cfcf93d079eee7e726c3660c2fbe..8057fbf5576c5174f9b3b69ed4a27534f0ec7c4e 100644 (file)
@@ -1327,11 +1327,19 @@ static const struct address_space_operations fuse_dax_file_aops  = {
        .invalidatepage = noop_invalidatepage,
 };
 
-void fuse_dax_inode_init(struct inode *inode)
+static bool fuse_should_enable_dax(struct inode *inode)
 {
        struct fuse_conn *fc = get_fuse_conn(inode);
 
        if (!fc->dax)
+               return false;
+
+       return true;
+}
+
+void fuse_dax_inode_init(struct inode *inode)
+{
+       if (!fuse_should_enable_dax(inode))
                return;
 
        inode->i_flags |= S_DAX;