Skip to content

Commit a964cf0

Browse files
committed
un-export mount.FMountat
It's only used internally, so we can un-export this utility until it is needed elsewhere. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 21f532d commit a964cf0

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

mount/fmountat_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import (
2626
"golang.org/x/sys/unix"
2727
)
2828

29-
// FMountat performs mount from the provided directory.
30-
func FMountat(dirfd uintptr, source, target, fstype string, flags uintptr, data string) error {
29+
// fMountat performs mount from the provided directory.
30+
func fMountat(dirfd uintptr, source, target, fstype string, flags uintptr, data string) error {
3131
var (
3232
sourceP, targetP, fstypeP, dataP *byte
3333
pid uintptr

mount/fmountat_linux_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func testFMountatNormal(t *testing.T, root string) {
8888
defer f.Close()
8989

9090
// mount work to fs
91-
if err = FMountat(f.Fd(), workdir, "fs", "bind", unix.MS_BIND|unix.MS_RDONLY, ""); err != nil {
91+
if err = fMountat(f.Fd(), workdir, "fs", "bind", unix.MS_BIND|unix.MS_RDONLY, ""); err != nil {
9292
t.Fatalf("expected no error here, but got error: %+v", err)
9393
}
9494
defer umount(t, fsdir)
@@ -124,7 +124,7 @@ func testFMountatWithFileFd(t *testing.T, root string) {
124124
}
125125
defer f.Close()
126126

127-
err = FMountat(f.Fd(), filepath.Join(root, "empty"), filepath.Join(root, "work"), "", 0, "")
127+
err = fMountat(f.Fd(), filepath.Join(root, "empty"), filepath.Join(root, "work"), "", 0, "")
128128
if !errors.Is(err, expectedErr) {
129129
t.Fatalf("expected error %v, but got %v", expectedErr, errors.Cause(err))
130130
}
@@ -145,7 +145,7 @@ func testFMountatWithInvalidSource(t *testing.T, root string) {
145145
}
146146
defer f.Close()
147147

148-
err = FMountat(f.Fd(), filepath.Join(root, "oops"), "at", "bind", unix.MS_BIND, "")
148+
err = fMountat(f.Fd(), filepath.Join(root, "oops"), "at", "bind", unix.MS_BIND, "")
149149
if !errors.Is(err, expectedErr) {
150150
t.Fatalf("expected error %v, but got %v", expectedErr, err)
151151
}

mount/mount_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ func mountAt(chdir string, source, target, fstype string, flags uintptr, data st
377377
if !fs.IsDir() {
378378
return errors.Wrap(errors.Errorf("%s is not dir", chdir), "failed to mountat")
379379
}
380-
return errors.Wrap(FMountat(f.Fd(), source, target, fstype, flags, data), "failed to mountat")
380+
return errors.Wrap(fMountat(f.Fd(), source, target, fstype, flags, data), "failed to mountat")
381381
}
382382

383383
func (m *Mount) mountWithHelper(helperBinary, typePrefix, target string) error {

0 commit comments

Comments
 (0)