From 34e68b6b4ff04de5c7b5e2dc46e5bd44c6845e63 Mon Sep 17 00:00:00 2001 From: Ayush Ranjan Date: Fri, 8 Oct 2021 15:38:41 -0700 Subject: Remove redundant slice copy in lisafs gofer client. listXattr() was doing redundant work. Remove it. PiperOrigin-RevId: 401871315 --- pkg/sentry/fsimpl/gofer/gofer.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pkg/sentry/fsimpl/gofer/gofer.go b/pkg/sentry/fsimpl/gofer/gofer.go index 2dd9226c1..b98825e26 100644 --- a/pkg/sentry/fsimpl/gofer/gofer.go +++ b/pkg/sentry/fsimpl/gofer/gofer.go @@ -2049,16 +2049,7 @@ func (d *dentry) listXattr(ctx context.Context, size uint64) ([]string, error) { } if d.fs.opts.lisaEnabled { - xattrs, err := d.controlFDLisa.ListXattr(ctx, size) - if err != nil { - return nil, err - } - - res := make([]string, 0, len(xattrs)) - for _, xattr := range xattrs { - res = append(res, xattr) - } - return res, nil + return d.controlFDLisa.ListXattr(ctx, size) } xattrMap, err := d.file.listXattr(ctx, size) -- cgit v1.2.3