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/inode.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/sentry/fs/inode.go') diff --git a/pkg/sentry/fs/inode.go b/pkg/sentry/fs/inode.go index b8b5c1528..d82f9740e 100644 --- a/pkg/sentry/fs/inode.go +++ b/pkg/sentry/fs/inode.go @@ -253,7 +253,7 @@ func (i *Inode) UnstableAttr(ctx context.Context) (UnstableAttr, error) { } // Getxattr calls i.InodeOperations.Getxattr with i as the Inode. -func (i *Inode) Getxattr(name string) ([]byte, error) { +func (i *Inode) Getxattr(name string) (string, error) { if i.overlay != nil { return overlayGetxattr(i.overlay, name) } -- cgit v1.2.3