summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/ramfs/dir.go
diff options
context:
space:
mode:
authorZach Koopmans <zkoopmans@google.com>2021-07-01 12:02:59 -0700
committergVisor bot <gvisor-bot@google.com>2021-07-01 12:05:19 -0700
commit590b8d3e99dd24d2bb625d00fa99fbc9296dfe2b (patch)
tree520cfce78c69fc6ec77be9fa78e041152cb6dd8b /pkg/sentry/fs/ramfs/dir.go
parent07ffecef83bd31e78786af901c49a7be93b20517 (diff)
[syserror] Update several syserror errors to linuxerr equivalents.
Update/remove most syserror errors to linuxerr equivalents. For list of removed errors, see //pkg/syserror/syserror.go. PiperOrigin-RevId: 382574582
Diffstat (limited to 'pkg/sentry/fs/ramfs/dir.go')
-rw-r--r--pkg/sentry/fs/ramfs/dir.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/pkg/sentry/fs/ramfs/dir.go b/pkg/sentry/fs/ramfs/dir.go
index daa396e42..33023af77 100644
--- a/pkg/sentry/fs/ramfs/dir.go
+++ b/pkg/sentry/fs/ramfs/dir.go
@@ -209,7 +209,7 @@ func (d *Dir) removeChildLocked(ctx context.Context, name string) (*fs.Inode, er
// Remove removes the named non-directory.
func (d *Dir) Remove(ctx context.Context, _ *fs.Inode, name string) error {
if len(name) > linux.NAME_MAX {
- return syserror.ENAMETOOLONG
+ return linuxerr.ENAMETOOLONG
}
d.mu.Lock()
@@ -227,7 +227,7 @@ func (d *Dir) Remove(ctx context.Context, _ *fs.Inode, name string) error {
// RemoveDirectory removes the named directory.
func (d *Dir) RemoveDirectory(ctx context.Context, _ *fs.Inode, name string) error {
if len(name) > linux.NAME_MAX {
- return syserror.ENAMETOOLONG
+ return linuxerr.ENAMETOOLONG
}
d.mu.Lock()
@@ -241,7 +241,7 @@ func (d *Dir) RemoveDirectory(ctx context.Context, _ *fs.Inode, name string) err
if ok, err := hasChildren(ctx, childInode); err != nil {
return err
} else if ok {
- return syserror.ENOTEMPTY
+ return linuxerr.ENOTEMPTY
}
// Child was empty. Proceed with removal.
@@ -260,7 +260,7 @@ func (d *Dir) RemoveDirectory(ctx context.Context, _ *fs.Inode, name string) err
// with a reference.
func (d *Dir) Lookup(ctx context.Context, _ *fs.Inode, p string) (*fs.Dirent, error) {
if len(p) > linux.NAME_MAX {
- return nil, syserror.ENAMETOOLONG
+ return nil, linuxerr.ENAMETOOLONG
}
d.mu.Lock()
@@ -293,7 +293,7 @@ func (d *Dir) walkLocked(ctx context.Context, p string) (*fs.Inode, error) {
// makeInodeOperations. It is the common logic for creating a new child.
func (d *Dir) createInodeOperationsCommon(ctx context.Context, name string, makeInodeOperations func() (*fs.Inode, error)) (*fs.Inode, error) {
if len(name) > linux.NAME_MAX {
- return nil, syserror.ENAMETOOLONG
+ return nil, linuxerr.ENAMETOOLONG
}
d.mu.Lock()
@@ -345,7 +345,7 @@ func (d *Dir) CreateLink(ctx context.Context, dir *fs.Inode, oldname, newname st
// CreateHardLink creates a new hard link.
func (d *Dir) CreateHardLink(ctx context.Context, dir *fs.Inode, target *fs.Inode, name string) error {
if len(name) > linux.NAME_MAX {
- return syserror.ENAMETOOLONG
+ return linuxerr.ENAMETOOLONG
}
d.mu.Lock()
@@ -497,14 +497,14 @@ func hasChildren(ctx context.Context, inode *fs.Inode) (bool, error) {
func Rename(ctx context.Context, oldParent fs.InodeOperations, oldName string, newParent fs.InodeOperations, newName string, replacement bool) error {
op, ok := oldParent.(*Dir)
if !ok {
- return syserror.EXDEV
+ return linuxerr.EXDEV
}
np, ok := newParent.(*Dir)
if !ok {
- return syserror.EXDEV
+ return linuxerr.EXDEV
}
if len(newName) > linux.NAME_MAX {
- return syserror.ENAMETOOLONG
+ return linuxerr.ENAMETOOLONG
}
np.mu.Lock()
@@ -522,7 +522,7 @@ func Rename(ctx context.Context, oldParent fs.InodeOperations, oldName string, n
if ok, err := hasChildren(ctx, replaced); err != nil {
return err
} else if ok {
- return syserror.ENOTEMPTY
+ return linuxerr.ENOTEMPTY
}
}