fs Add unmount subcommand
This commit is contained in:
@ -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) {
|
||||
|
||||
20
user/fs/unmount.c
Normal file
20
user/fs/unmount.c
Normal file
@ -0,0 +1,20 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <ulib.h>
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user