diff --git a/mount/fmountat_linux.go b/mount/fmountat_linux.go index 45732488d..705b95ede 100644 --- a/mount/fmountat_linux.go +++ b/mount/fmountat_linux.go @@ -26,8 +26,8 @@ import ( "golang.org/x/sys/unix" ) -// FMountat performs mount from the provided directory. -func FMountat(dirfd uintptr, source, target, fstype string, flags uintptr, data string) error { +// fMountat performs mount from the provided directory. +func fMountat(dirfd uintptr, source, target, fstype string, flags uintptr, data string) error { var ( sourceP, targetP, fstypeP, dataP *byte pid uintptr diff --git a/mount/fmountat_linux_test.go b/mount/fmountat_linux_test.go index 4f25acf9b..06b3a2667 100644 --- a/mount/fmountat_linux_test.go +++ b/mount/fmountat_linux_test.go @@ -88,7 +88,7 @@ func testFMountatNormal(t *testing.T, root string) { defer f.Close() // mount work to fs - if err = FMountat(f.Fd(), workdir, "fs", "bind", unix.MS_BIND|unix.MS_RDONLY, ""); err != nil { + if err = fMountat(f.Fd(), workdir, "fs", "bind", unix.MS_BIND|unix.MS_RDONLY, ""); err != nil { t.Fatalf("expected no error here, but got error: %+v", err) } defer umount(t, fsdir) @@ -124,7 +124,7 @@ func testFMountatWithFileFd(t *testing.T, root string) { } defer f.Close() - err = FMountat(f.Fd(), filepath.Join(root, "empty"), filepath.Join(root, "work"), "", 0, "") + err = fMountat(f.Fd(), filepath.Join(root, "empty"), filepath.Join(root, "work"), "", 0, "") if !errors.Is(err, expectedErr) { t.Fatalf("expected error %v, but got %v", expectedErr, errors.Cause(err)) } @@ -145,7 +145,7 @@ func testFMountatWithInvalidSource(t *testing.T, root string) { } defer f.Close() - err = FMountat(f.Fd(), filepath.Join(root, "oops"), "at", "bind", unix.MS_BIND, "") + err = fMountat(f.Fd(), filepath.Join(root, "oops"), "at", "bind", unix.MS_BIND, "") if !errors.Is(err, expectedErr) { t.Fatalf("expected error %v, but got %v", expectedErr, err) } diff --git a/mount/mount_linux.go b/mount/mount_linux.go index e0e066b31..31148049a 100644 --- a/mount/mount_linux.go +++ b/mount/mount_linux.go @@ -377,7 +377,7 @@ func mountAt(chdir string, source, target, fstype string, flags uintptr, data st if !fs.IsDir() { return errors.Wrap(errors.Errorf("%s is not dir", chdir), "failed to mountat") } - return errors.Wrap(FMountat(f.Fd(), source, target, fstype, flags, data), "failed to mountat") + return errors.Wrap(fMountat(f.Fd(), source, target, fstype, flags, data), "failed to mountat") } func (m *Mount) mountWithHelper(helperBinary, typePrefix, target string) error {