Skip to contentSkip to conversation

rpdfs: Flush dirty blocks on sync

PATCH Applied Valerie Aurora 2 participants 2 messages Mar 17 – Mar 25

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rpdfs: Flush dirty blocks on sync

Write out dirty blocks when the VFS wants to sync, e.g. when unmounting.

---
 fs/rpdfs/super.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
fs/rpdfs/super.c +12 -0
index 41df49795e2d..d842ab68839a 100644
@@ -26,6 +26,17 @@ struct rpdfs_fs_context {
 	bool mkfs;
 };
 
+static int rpdfs_sync_fs(struct super_block *sb, int wait)
+{
+	struct rpdfs_fs_info *rfi = RPDFS_SB_FS(sb);
+
+	rpdfs_prd("wait %d", wait);
+
+	rpdfs_block_sync(rfi, wait);
+
+	return 0;
+}
+
 static int rpdfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 {
 	buf->f_type = RPDFS_SUPER_MAGIC;
@@ -38,6 +49,7 @@ static int rpdfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 static const struct super_operations rpdfs_sop = {
 	.alloc_inode	= rpdfs_alloc_inode,
 	.free_inode	= rpdfs_free_inode,
+	.sync_fs	= rpdfs_sync_fs,
 	.statfs		= rpdfs_statfs,
 	.write_inode	= rpdfs_write_inode,
 };
Signature · 1 line
2.49.0
Applied
#1 lore raw
Quoted 3 lines · Valerie Aurora

Write out dirty blocks when the VFS wants to sync, e.g. when unmounting.

Applied, thanks!

I'm taking bets on whether we remember to fix up the return 0 once we wire up io errors through write completion up to the block flush waiters :).

- z