summaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorJeffle Xu <jefflexu@linux.alibaba.com>2021-11-25 15:05:24 +0800
committerMiklos Szeredi <mszeredi@redhat.com>2021-12-14 11:09:36 +0100
commitcecd491641c23f3c63958a62efb74cdaf3c93d7b (patch)
tree31a5883230fbc0564771b61ef510624e44d82b4d /fs/fuse
parente388164ea385f04666c4633f5dc4f951fca71890 (diff)
downloadlinux-cecd491641c23f3c63958a62efb74cdaf3c93d7b.tar.gz
linux-cecd491641c23f3c63958a62efb74cdaf3c93d7b.tar.bz2
linux-cecd491641c23f3c63958a62efb74cdaf3c93d7b.zip
fuse: add fuse_should_enable_dax() helper
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>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/dax.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c
index 713818d74de6..8057fbf5576c 100644
--- a/fs/fuse/dax.c
+++ b/fs/fuse/dax.c
@@ -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;