diff options
author | Nicolas Lacasse <nlacasse@google.com> | 2019-04-05 15:48:26 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-04-05 15:49:39 -0700 |
commit | ee7e6d33b2a017a53bebfdc55d182f53474d4d7d (patch) | |
tree | 91c302c8844f62f9c168e571231ecf4cb5e3fbb7 /pkg/sentry/fs/inode_operations.go | |
parent | f44f2f73b068658ddf632586e2178e372fcd1cbd (diff) |
Use string type for extended attribute values, instead of []byte.
Strings are a better fit for this usage because they are immutable in Go, and
can contain arbitrary bytes. It also allows us to avoid casting bytes to string
(and the associated allocation) in the hot path when checking for overlay
whiteouts.
PiperOrigin-RevId: 242208856
Change-Id: I7699ae6302492eca71787dd0b72e0a5a217a3db2
Diffstat (limited to 'pkg/sentry/fs/inode_operations.go')
-rw-r--r-- | pkg/sentry/fs/inode_operations.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/sentry/fs/inode_operations.go b/pkg/sentry/fs/inode_operations.go index e8b9ab96b..ceacc7659 100644 --- a/pkg/sentry/fs/inode_operations.go +++ b/pkg/sentry/fs/inode_operations.go @@ -174,11 +174,11 @@ type InodeOperations interface { // do not support extended attributes return EOPNOTSUPP. Inodes that // support extended attributes but don't have a value at name return // ENODATA. - Getxattr(inode *Inode, name string) ([]byte, error) + Getxattr(inode *Inode, name string) (string, error) // Setxattr sets the value of extended attribute name. Inodes that // do not support extended attributes return EOPNOTSUPP. - Setxattr(inode *Inode, name string, value []byte) error + Setxattr(inode *Inode, name, value string) error // Listxattr returns the set of all extended attributes names that // have values. Inodes that do not support extended attributes return |