Skip to contentSkip to conversation

rpdfs: Add minimal statfs support

PATCH Applied Chris Kirby 2 participants 2 messages Feb 25

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 rpdfs: Add minimal statfs support

Add minimal statfs support

For now, just report f_type, f_bsize, and f_namelen.

---
 fs/rpdfs/super.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
fs/rpdfs/super.c +11 -0
index 4b2d968a6767..9b18c25175b7 100644
@@ -6,6 +6,7 @@
 #include <linux/fs.h>
 #include <linux/fs_context.h>
 #include <linux/fs_parser.h>
+#include <linux/statfs.h>
 
 #include "balloc.h"
 #include "block.h"
@@ -22,9 +23,19 @@ struct rpdfs_fs_context {
 	bool mkfs;
 };
 
+static int rpdfs_statfs(struct dentry *dentry, struct kstatfs *buf)
+{
+	buf->f_type = RPDFS_SUPER_MAGIC;
+	buf->f_bsize = RPDFS_BLOCK_SIZE;
+	buf->f_namelen = RPDFS_NAME_MAX;
+
+	return 0;
+}
+
 static const struct super_operations rpdfs_sop = {
 	.alloc_inode	= rpdfs_alloc_inode,
 	.free_inode	= rpdfs_free_inode,
+	.statfs		= rpdfs_statfs,
 	.write_inode	= rpdfs_write_inode,
 };
 
Signature · 1 line
2.53.0
Applied
#1 lore raw
Quoted 1 line · Chris Kirby

Add minimal statfs support

Applied, thanks!

- z