summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-07-14 11:06:30 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-10-14 14:16:46 -0700
commit704f248d3a35bb62933af4cd240a0124abc19fcc (patch)
tree7d918ff6291d9e1da83ab37858894906148fa94e /fs/xfs/scrub
parentb9d1f8d6cf021a8fc125e035e9b532a9d723b67c (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 9513b90fd0f5..c057bf786468 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;
};
@@ -61,5 +62,18 @@ int xfile_obj_put_page(struct xfile *xf, loff_t offset, unsigned int len,
struct page *page, void *fsdata);
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, const void *buf, size_t count, loff_t offset)
+{
+ return -EIO;
+}
+#endif /* CONFIG_XFS_IN_MEMORY_FILE */
#endif /* __XFS_SCRUB_XFILE_H__ */