diff options
author | Dean Deng <deandeng@google.com> | 2020-02-07 14:46:24 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-02-07 14:47:13 -0800 |
commit | 17b9f5e66238bde1e4ed3bd9e5fb67342c8b58ec (patch) | |
tree | 7d22c13978117ef63c5dc72f412ca869c99cde2d /pkg/p9/file.go | |
parent | e1587a28876f8aac689a2cd1b7630f1637655b58 (diff) |
Support listxattr and removexattr syscalls.
Note that these are only implemented for tmpfs, and other impls will still
return EOPNOTSUPP.
PiperOrigin-RevId: 293899385
Diffstat (limited to 'pkg/p9/file.go')
-rw-r--r-- | pkg/p9/file.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pkg/p9/file.go b/pkg/p9/file.go index 4607cfcdf..d4ffbc8e3 100644 --- a/pkg/p9/file.go +++ b/pkg/p9/file.go @@ -105,6 +105,22 @@ type File interface { // TODO(b/127675828): Determine concurrency guarantees once implemented. SetXattr(name, value string, flags uint32) error + // ListXattr lists the names of the extended attributes on this node. + // + // Size indicates the size of the buffer that has been allocated to hold the + // attribute list. If the list would be larger than size, implementations may + // return ERANGE to indicate that the buffer is too small, but they are also + // free to ignore the hint entirely (i.e. the value returned may be larger + // than size). All size checking is done independently at the syscall layer. + // + // TODO(b/148303075): Determine concurrency guarantees once implemented. + ListXattr(size uint64) (map[string]struct{}, error) + + // RemoveXattr removes extended attributes on this node. + // + // TODO(b/148303075): Determine concurrency guarantees once implemented. + RemoveXattr(name string) error + // Allocate allows the caller to directly manipulate the allocated disk space // for the file. See fallocate(2) for more details. Allocate(mode AllocateMode, offset, length uint64) error |