diff options
author | Jeffle Xu <jefflexu@linux.alibaba.com> | 2021-11-25 08:05:24 +0100 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2021-12-14 11:09:36 +0100 |
commit | cecd491641c23f3c63958a62efb74cdaf3c93d7b (patch) | |
tree | 31a5883230fbc0564771b61ef510624e44d82b4d /fs/fuse/dax.c | |
parent | fuse: Pass correct lend value to filemap_write_and_wait_range() (diff) | |
download | linux-cecd491641c23f3c63958a62efb74cdaf3c93d7b.tar.xz 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/dax.c')
-rw-r--r-- | fs/fuse/dax.c | 10 |
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; |