# HG changeset patch # User Josef 'Jeff' Sipek # Date 1671325611 18000 # Node ID 4105b14950bc8eb0726e127a9e74898dcebffbfc # Parent eb2ea1fc3c039705c63567100ececdb6b86952d9 common: extend UNLINK to handle rmdir behavior as well Signed-off-by: Josef 'Jeff' Sipek diff -r eb2ea1fc3c03 -r 4105b14950bc docs/fs-protocol.md --- a/docs/fs-protocol.md Wed Dec 14 23:21:47 2022 -0500 +++ b/docs/fs-protocol.md Sat Dec 17 20:06:51 2022 -0500 @@ -189,11 +189,15 @@ removed. If a null oid is specified and there are multiple dirents with the same name, the operation fails with `ENOTUNIQ`. +The rmdir bool specifies whether the operation is a rmdir (true) or unlink +(false). + Inputs ------ * directory open file handle * path component name * desired target oid +* rmdir semantics Outputs ------- diff -r eb2ea1fc3c03 -r 4105b14950bc src/common/fscall.c --- a/src/common/fscall.c Wed Dec 14 23:21:47 2022 -0500 +++ b/src/common/fscall.c Sat Dec 17 20:06:51 2022 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Josef 'Jeff' Sipek + * Copyright (c) 2016-2020,2022 Josef 'Jeff' Sipek * Copyright (c) 2016 Steve Dougherty * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -355,6 +355,7 @@ unlink_req.parent = parent_handle; unlink_req.name = (char *) name; + unlink_req.rmdir = false; if (desired) unlink_req.desired = *desired; diff -r eb2ea1fc3c03 -r 4105b14950bc src/common/rpc_fs.x --- a/src/common/rpc_fs.x Wed Dec 14 23:21:47 2022 -0500 +++ b/src/common/rpc_fs.x Sat Dec 17 20:06:51 2022 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2020 Josef 'Jeff' Sipek + * Copyright (c) 2015-2020,2022 Josef 'Jeff' Sipek * Copyright (c) 2015 Holly Sipek * Copyright (c) 2015 Joshua Kahn * Copyright (c) 2016 Steve Dougherty @@ -105,6 +105,7 @@ HANDLE(parent); string name<>; struct noid desired; + bool rmdir; }; %/***** OPEN *****/