summaryrefslogtreecommitdiffstats
path: root/fs/fuse/fuse_i.h
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2020-08-19 18:19:51 -0400
committerMiklos Szeredi <mszeredi@redhat.com>2020-09-10 11:39:23 +0200
commitc2d0ad00d948de73c78f05d2b3e5bdfa605035cc (patch)
treedbc7decd77eb124264832633bb77b1b3396b8a27 /fs/fuse/fuse_i.h
parentceec02d4354a317cacce4b053a580ea3c7fc6cdc (diff)
downloadlinux-stable-c2d0ad00d948de73c78f05d2b3e5bdfa605035cc.tar.gz
linux-stable-c2d0ad00d948de73c78f05d2b3e5bdfa605035cc.tar.bz2
linux-stable-c2d0ad00d948de73c78f05d2b3e5bdfa605035cc.zip
virtiofs: implement dax read/write operations
This patch implements basic DAX support. mmap() is not implemented yet and will come in later patches. This patch looks into implemeting read/write. We make use of interval tree to keep track of per inode dax mappings. Do not use dax for file extending writes, instead just send WRITE message to daemon (like we do for direct I/O path). This will keep write and i_size change atomic w.r.t crash. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com> Signed-off-by: Peng Tao <tao.peng@linux.alibaba.com> Cc: Dave Chinner <david@fromorbit.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/fuse_i.h')
-rw-r--r--fs/fuse/fuse_i.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 2f3f04aa64c7..2d2bdd596194 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -148,6 +148,13 @@ struct fuse_inode {
/** Lock to protect write related fields */
spinlock_t lock;
+
+#ifdef CONFIG_FUSE_DAX
+ /*
+ * Dax specific inode data
+ */
+ struct fuse_inode_dax *dax;
+#endif
};
/** FUSE inode state bits */
@@ -1104,8 +1111,16 @@ void fuse_free_conn(struct fuse_conn *fc);
/* dax.c */
+#define FUSE_IS_DAX(inode) (IS_ENABLED(CONFIG_FUSE_DAX) && IS_DAX(inode))
+
+ssize_t fuse_dax_read_iter(struct kiocb *iocb, struct iov_iter *to);
+ssize_t fuse_dax_write_iter(struct kiocb *iocb, struct iov_iter *from);
+int fuse_dax_mmap(struct file *file, struct vm_area_struct *vma);
int fuse_dax_conn_alloc(struct fuse_conn *fc, struct dax_device *dax_dev);
void fuse_dax_conn_free(struct fuse_conn *fc);
+bool fuse_dax_inode_alloc(struct super_block *sb, struct fuse_inode *fi);
+void fuse_dax_inode_init(struct inode *inode);
+void fuse_dax_inode_cleanup(struct inode *inode);
bool fuse_dax_check_alignment(struct fuse_conn *fc, unsigned int map_alignment);
#endif /* _FS_FUSE_I_H */