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/tmpfs | |
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/tmpfs')
-rw-r--r-- | pkg/sentry/fs/tmpfs/tmpfs.go | 4 |
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) } |