summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/tmpfs/tmpfs.go
diff options
context:
space:
mode:
authorNicolas Lacasse <nlacasse@google.com>2019-04-05 15:48:26 -0700
committerShentubot <shentubot@google.com>2019-04-05 15:49:39 -0700
commitee7e6d33b2a017a53bebfdc55d182f53474d4d7d (patch)
tree91c302c8844f62f9c168e571231ecf4cb5e3fbb7 /pkg/sentry/fs/tmpfs/tmpfs.go
parentf44f2f73b068658ddf632586e2178e372fcd1cbd (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/tmpfs/tmpfs.go')
-rw-r--r--pkg/sentry/fs/tmpfs/tmpfs.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/sentry/fs/tmpfs/tmpfs.go b/pkg/sentry/fs/tmpfs/tmpfs.go
index a1672a4d0..555692505 100644
--- a/pkg/sentry/fs/tmpfs/tmpfs.go
+++ b/pkg/sentry/fs/tmpfs/tmpfs.go
@@ -150,12 +150,12 @@ func (d *Dir) CreateFifo(ctx context.Context, dir *fs.Inode, name string, perms
}
// Getxattr implements fs.InodeOperations.Getxattr.
-func (d *Dir) Getxattr(i *fs.Inode, name string) ([]byte, error) {
+func (d *Dir) Getxattr(i *fs.Inode, name string) (string, error) {
return d.ramfsDir.Getxattr(i, name)
}
// Setxattr implements fs.InodeOperations.Setxattr.
-func (d *Dir) Setxattr(i *fs.Inode, name string, value []byte) error {
+func (d *Dir) Setxattr(i *fs.Inode, name, value string) error {
return d.ramfsDir.Setxattr(i, name, value)
}