summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/fsutil
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-07-01 19:10:02 +0000
committergVisor bot <gvisor-bot@google.com>2021-07-01 19:10:02 +0000
commit9a66a5f3083af2d041ec1427ce67642be7aa6d9e (patch)
tree0d8bd6dcef07aadc55ab8ea8500d106b24b77fef /pkg/sentry/fs/fsutil
parent28291a5a5d25633c8bdf45ed5affe90f779c74b4 (diff)
parent590b8d3e99dd24d2bb625d00fa99fbc9296dfe2b (diff)
Merge release-20210628.0-16-g590b8d3e9 (automated)
Diffstat (limited to 'pkg/sentry/fs/fsutil')
-rw-r--r--pkg/sentry/fs/fsutil/file.go6
-rw-r--r--pkg/sentry/fs/fsutil/inode.go12
2 files changed, 9 insertions, 9 deletions
diff --git a/pkg/sentry/fs/fsutil/file.go b/pkg/sentry/fs/fsutil/file.go
index c3525ba8e..fe327235a 100644
--- a/pkg/sentry/fs/fsutil/file.go
+++ b/pkg/sentry/fs/fsutil/file.go
@@ -46,7 +46,7 @@ func SeekWithDirCursor(ctx context.Context, file *fs.File, whence fs.SeekWhence,
// Does the Inode represents a non-seekable type?
if fs.IsPipe(inode.StableAttr) || fs.IsSocket(inode.StableAttr) {
- return current, syserror.ESPIPE
+ return current, linuxerr.ESPIPE
}
// Does the Inode represent a character device?
@@ -162,7 +162,7 @@ type FilePipeSeek struct{}
// Seek implements fs.FileOperations.Seek.
func (FilePipeSeek) Seek(context.Context, *fs.File, fs.SeekWhence, int64) (int64, error) {
- return 0, syserror.ESPIPE
+ return 0, linuxerr.ESPIPE
}
// FileNotDirReaddir implements fs.FileOperations.Readdir for non-directories.
@@ -205,7 +205,7 @@ type FileNoMMap struct{}
// ConfigureMMap implements fs.FileOperations.ConfigureMMap.
func (FileNoMMap) ConfigureMMap(context.Context, *fs.File, *memmap.MMapOpts) error {
- return syserror.ENODEV
+ return linuxerr.ENODEV
}
// GenericConfigureMMap implements fs.FileOperations.ConfigureMMap for most
diff --git a/pkg/sentry/fs/fsutil/inode.go b/pkg/sentry/fs/fsutil/inode.go
index bda07275d..d2b769007 100644
--- a/pkg/sentry/fs/fsutil/inode.go
+++ b/pkg/sentry/fs/fsutil/inode.go
@@ -219,7 +219,7 @@ func (i *InodeSimpleExtendedAttributes) GetXattr(_ context.Context, _ *fs.Inode,
value, ok := i.xattrs[name]
i.mu.RUnlock()
if !ok {
- return "", syserror.ENOATTR
+ return "", linuxerr.ENOATTR
}
return value, nil
}
@@ -230,7 +230,7 @@ func (i *InodeSimpleExtendedAttributes) SetXattr(_ context.Context, _ *fs.Inode,
defer i.mu.Unlock()
if i.xattrs == nil {
if flags&linux.XATTR_REPLACE != 0 {
- return syserror.ENODATA
+ return linuxerr.ENODATA
}
i.xattrs = make(map[string]string)
}
@@ -240,7 +240,7 @@ func (i *InodeSimpleExtendedAttributes) SetXattr(_ context.Context, _ *fs.Inode,
return syserror.EEXIST
}
if !ok && flags&linux.XATTR_REPLACE != 0 {
- return syserror.ENODATA
+ return linuxerr.ENODATA
}
i.xattrs[name] = value
@@ -266,7 +266,7 @@ func (i *InodeSimpleExtendedAttributes) RemoveXattr(_ context.Context, _ *fs.Ino
delete(i.xattrs, name)
return nil
}
- return syserror.ENOATTR
+ return linuxerr.ENOATTR
}
// staticFile is a file with static contents. It is returned by
@@ -449,12 +449,12 @@ type InodeNotSymlink struct{}
// Readlink implements fs.InodeOperations.Readlink.
func (InodeNotSymlink) Readlink(context.Context, *fs.Inode) (string, error) {
- return "", syserror.ENOLINK
+ return "", linuxerr.ENOLINK
}
// Getlink implements fs.InodeOperations.Getlink.
func (InodeNotSymlink) Getlink(context.Context, *fs.Inode) (*fs.Dirent, error) {
- return nil, syserror.ENOLINK
+ return nil, linuxerr.ENOLINK
}
// InodeNoExtendedAttributes can be used by Inodes that do not support