summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-09-24 13:06:12 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-12-15 17:29:30 -0800
commit1a96a54a3a88a40e7c757cb1b63a93bf36e213c6 (patch)
tree7d23c7058bba43a2d017241b4ac2000e3e14d270 /fs/xfs/scrub
parent6e8ddf3aa4786e9b0bb7d562c55dbeae1ee1d32d (diff)
xfs: support in-memory buffer cache targets
Allow the buffer cache to target in-memory files by connecting it to xfiles. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/scrub')
-rw-r--r--fs/xfs/scrub/xfile.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/xfs/scrub/xfile.h b/fs/xfs/scrub/xfile.h
index 93d277bb19a5..b9380a1d434f 100644
--- a/fs/xfs/scrub/xfile.h
+++ b/fs/xfs/scrub/xfile.h
@@ -6,6 +6,7 @@
#ifndef __XFS_SCRUB_XFILE_H__
#define __XFS_SCRUB_XFILE_H__
+#ifdef CONFIG_XFS_IN_MEMORY_FILE
struct xfile {
struct file *file;
};
@@ -56,5 +57,18 @@ struct xfile_stat {
int xfile_stat(struct xfile *xf, struct xfile_stat *statbuf);
int xfile_dump(struct xfile *xf);
+#else
+static inline int
+xfile_obj_load(struct xfile *xf, void *buf, size_t count, loff_t offset)
+{
+ return -EIO;
+}
+
+static inline int
+xfile_obj_store(struct xfile *xf, void *buf, size_t count, loff_t offset)
+{
+ return -EIO;
+}
+#endif /* CONFIG_XFS_IN_MEMORY_FILE */
#endif /* __XFS_SCRUB_XFILE_H__ */