[PATCH 17/21] Add sync command to debugfs

Valerie Aurora val at versity.com
Tue Feb 11 13:19:14 PST 2025


Add a sync command to debugfs to force all pending writes out to the
devd server.

Signed-off-by: Valerie Aurora <val at versity.com>
---
 cli/debugfs.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/cli/debugfs.c b/cli/debugfs.c
index 58f01b6..a3f07ec 100644
--- a/cli/debugfs.c
+++ b/cli/debugfs.c
@@ -142,6 +142,16 @@ static void cmd_stat(struct debugfs_context *ctx, int argc, char **argv)
 	}
 }
 
+static void cmd_sync(struct debugfs_context *ctx, int argc, char **argv)
+{
+	int ret;
+
+	ret = ngnfs_block_sync(ctx->nfi);
+	if (ret < 0)
+		printf("sync error: "ENOF"\n", ENOA(-ret));
+}
+
+
 static struct command {
 	char *name;
 	void (*func)(struct debugfs_context *ctx, int argc, char **argv);
@@ -151,6 +161,7 @@ static struct command {
 	{ "quit", cmd_quit, },
 	{ "readdir", cmd_readdir, },
 	{ "stat", cmd_stat, },
+	{ "sync", cmd_sync, },
 };
 
 static int compar_cmd_names(const void *A, const void *B)
-- 
2.48.1




More information about the ngnfs-devel mailing list