summaryrefslogtreecommitdiffhomepage
path: root/pkg/abi/linux/fuse.go
diff options
context:
space:
mode:
authorBoyuan He <heboyuan@google.com>2020-09-09 17:13:18 -0700
committerAndrei Vagin <avagin@gmail.com>2020-09-16 12:19:30 -0700
commit2051260e8286b25ab39f3c1cb4614005236cbcc6 (patch)
tree03cbf5776f85c6fea5b49c5bf678128b68d6d3a8 /pkg/abi/linux/fuse.go
parent70cfea23776189575807f6aae28769bdfaa1e3fb (diff)
Implement FUSE_UNLINK
Fixes #3696
Diffstat (limited to 'pkg/abi/linux/fuse.go')
-rw-r--r--pkg/abi/linux/fuse.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/pkg/abi/linux/fuse.go b/pkg/abi/linux/fuse.go
index ca304af05..fdd22a13d 100644
--- a/pkg/abi/linux/fuse.go
+++ b/pkg/abi/linux/fuse.go
@@ -846,3 +846,26 @@ type FUSESetAttrIn struct {
_ uint32
}
+
+// FUSEUnlinkIn is the request sent by the kernel to the daemon
+// when trying to unlink a node.
+//
+// Dynamically-sized objects cannot be marshalled.
+type FUSEUnlinkIn struct {
+ marshal.StubMarshallable
+
+ // Name of the node to unlink.
+ Name string
+}
+
+// MarshalBytes serializes r.name to the dst buffer, which should
+// have size len(r.Name) + 1 and last byte set to 0.
+func (r *FUSEUnlinkIn) MarshalBytes(buf []byte) {
+ copy(buf, r.Name)
+}
+
+// SizeBytes is the size of the memory representation of FUSEUnlinkIn.
+// 1 extra byte for null-terminated Name string.
+func (r *FUSEUnlinkIn) SizeBytes() int {
+ return len(r.Name) + 1
+}