From 0bb84efe75fa11f039f275d4805464596b2a817a Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 26 Oct 2017 15:37:45 +0100 Subject: [PATCH] mountlib: Rename Remove to RemoveName --- cmd/cmount/fs.go | 4 ++-- cmd/mount/dir.go | 2 +- cmd/mountlib/dir.go | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/cmount/fs.go b/cmd/cmount/fs.go index 1273679f7..ef58dd891 100644 --- a/cmd/cmount/fs.go +++ b/cmd/cmount/fs.go @@ -489,7 +489,7 @@ func (fsys *FS) Unlink(filePath string) (errc int) { if errc != 0 { return errc } - return translateError(parentDir.Remove(leaf)) + return translateError(parentDir.RemoveName(leaf)) } // Mkdir creates a directory. @@ -510,7 +510,7 @@ func (fsys *FS) Rmdir(dirPath string) (errc int) { if errc != 0 { return errc } - return translateError(parentDir.Remove(leaf)) + return translateError(parentDir.RemoveName(leaf)) } // Rename renames a file. diff --git a/cmd/mount/dir.go b/cmd/mount/dir.go index 0d1197ca0..51329342a 100644 --- a/cmd/mount/dir.go +++ b/cmd/mount/dir.go @@ -164,7 +164,7 @@ var _ fusefs.NodeRemover = (*Dir)(nil) // may correspond to a file (unlink) or to a directory (rmdir). func (d *Dir) Remove(ctx context.Context, req *fuse.RemoveRequest) (err error) { defer fs.Trace(d, "name=%q", req.Name)("err=%v", &err) - err = d.Dir.Remove(req.Name) + err = d.Dir.RemoveName(req.Name) if err != nil { return translateError(err) } diff --git a/cmd/mountlib/dir.go b/cmd/mountlib/dir.go index 385129932..d2d1b5da3 100644 --- a/cmd/mountlib/dir.go +++ b/cmd/mountlib/dir.go @@ -356,10 +356,10 @@ func (d *Dir) Mkdir(name string) (*Dir, error) { return dir, nil } -// Remove removes the entry with the given name from -// the receiver, which must be a directory. The entry to be removed -// may correspond to a file (unlink) or to a directory (rmdir). -func (d *Dir) Remove(name string) error { +// RemoveName removes the entry with the given name from the receiver, +// which must be a directory. The entry to be removed may correspond +// to a file (unlink) or to a directory (rmdir). +func (d *Dir) RemoveName(name string) error { if d.fsys.readOnly { return EROFS }