From ee7e6d33b2a017a53bebfdc55d182f53474d4d7d Mon Sep 17 00:00:00 2001 From: Nicolas Lacasse Date: Fri, 5 Apr 2019 15:48:26 -0700 Subject: 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 --- pkg/sentry/fs/tmpfs/tmpfs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/sentry/fs/tmpfs/tmpfs.go') 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) } -- cgit v1.2.3