From f389f58daf07136a32671013f831f80dbd932d84 Mon Sep 17 00:00:00 2001 From: kamkow1 Date: Sat, 25 Oct 2025 23:21:30 +0200 Subject: [PATCH] fs Add unmount subcommand --- user/fs/main.c | 2 +- user/fs/unmount.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 user/fs/unmount.c diff --git a/user/fs/main.c b/user/fs/main.c index 01c0b2c..3cb0ae4 100644 --- a/user/fs/main.c +++ b/user/fs/main.c @@ -5,7 +5,7 @@ #define CMDS(X) \ X(fetch) X(mkf) X(mkd) \ X(tree) X(mount) X(del) \ - X(fmt) + X(fmt) X(unmount) void main(void) { if (argslen() == 0) { diff --git a/user/fs/unmount.c b/user/fs/unmount.c new file mode 100644 index 0000000..7a788cf --- /dev/null +++ b/user/fs/unmount.c @@ -0,0 +1,20 @@ +#include +#include +#include + +void fs_unmount(void) { + if (argslen() < 2) { + uprintf("fs: Not enough arguments\n"); + return; + } + + char *mountpoint = *(args()+1); + + int32_t ret = vfsunmount(mountpoint); + + if (ret != E_OK) { + uprintf("fs: Could not unmount %s\n", mountpoint); + } else { + uprintf("OK %s\n", mountpoint); + } +}