diff options
author | Ridwan Sharif <ridwanmsharif@google.com> | 2020-08-11 12:13:01 -0400 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2020-09-11 13:35:25 -0700 |
commit | a94377620401aee2b3e37d16f90054f7ddc756da (patch) | |
tree | 7655d7965f54facdd3ca08f760090d335651a10c /pkg/abi/linux | |
parent | 74e229c56ceb488a61a1b42d8f7da2d58c3c5418 (diff) |
Implement FUSE_RMDIR
Fixes #3587
Co-authored-by: Craig Chi <craigchi@google.com>
Diffstat (limited to 'pkg/abi/linux')
-rw-r--r-- | pkg/abi/linux/fuse.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/pkg/abi/linux/fuse.go b/pkg/abi/linux/fuse.go index 0ece7b756..c75debb8c 100644 --- a/pkg/abi/linux/fuse.go +++ b/pkg/abi/linux/fuse.go @@ -569,3 +569,29 @@ func (r *FUSEMkdirIn) MarshalUnsafe(buf []byte) { func (r *FUSEMkdirIn) SizeBytes() int { return r.MkdirMeta.SizeBytes() + len(r.Name) + 1 } + +// FUSERmDirIn is the request sent by the kernel to the daemon +// when trying to remove a directory. +// +// Dynamically-sized objects cannot be marshalled. +type FUSERmDirIn struct { + marshal.StubMarshallable + + // Name is a directory name to be looked up. + Name string +} + +// MarshalUnsafe serializes r.name to the dst buffer. +func (r *FUSERmDirIn) MarshalUnsafe(buf []byte) { + copy(buf, r.Name) +} + +// SizeBytes is the size of the memory representation of FUSERmDirIn. +func (r *FUSERmDirIn) SizeBytes() int { + return len(r.Name) + 1 +} + +// UnmarshalUnsafe deserializes r.name from the src buffer. +func (r *FUSERmDirIn) UnmarshalUnsafe(src []byte) { + r.Name = string(src) +} |