Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ clean:
rm -f go-code-tester *.log *.out cover*

go-code-tester:
git clone --depth 1 git@github.com:CSM/actions.git temp-repo
git clone --depth 1 git@github.com:dell/actions.git temp-repo
cp temp-repo/go-code-tester/entrypoint.sh ./go-code-tester
chmod +x go-code-tester
rm -rf temp-repo
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ You may obtain a copy of the License at
# Mount
A portable Go library for filesystem related operations such as mount,
format, etc.

4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/dell/gofsutil

go 1.25
go 1.26

require (
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.11.0
golang.org/x/sys v0.39.0
golang.org/x/sys v0.43.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.11.0 h1:ib4sjIrwZKxE5u/Japgo/7SJV3PvgjGiRNAvTVGqQl8=
github.com/stretchr/testify v1.11.0/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI=
golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
10 changes: 10 additions & 0 deletions gofsutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ type FSinterface interface {
fsInfo(ctx context.Context, path string) (int64, int64, int64, int64, int64, int64, error)
getNVMeController(device string) (string, error)

// Space reclamation — private (architecture-specific)
fstrim(ctx context.Context, mountPoint string) (*FstrimResult, error)
blkdiscard(ctx context.Context, devicePath string) (*BlkdiscardResult, error)
checkDiscardSupport(ctx context.Context, devicePath string) (*DiscardCapability, error)

// Architecture agnostic implementations, generally just wrappers
GetDiskFormat(ctx context.Context, disk string) (string, error)
Format(ctx context.Context, source, target, fsType string, options ...string) error
Expand All @@ -75,6 +80,11 @@ type FSinterface interface {
GetMpathNameFromDevice(ctx context.Context, device string) (string, error)
FsInfo(ctx context.Context, path string) (int64, int64, int64, int64, int64, int64, error)
GetNVMeController(device string) (string, error)

// Space reclamation — public (architecture-agnostic wrappers)
Fstrim(ctx context.Context, mountPoint string) (*FstrimResult, error)
Blkdiscard(ctx context.Context, devicePath string) (*BlkdiscardResult, error)
CheckDiscardSupport(ctx context.Context, devicePath string) (*DiscardCapability, error)
}

// MultipathDevDiskByIDPrefix is a pathname prefix for items located in /dev/disk/by-id
Expand Down
4 changes: 2 additions & 2 deletions gofsutil_fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1322,13 +1322,13 @@ func TestFS_FindFSType(t *testing.T) {
wantErr bool
}{
{
name: "Success",
name: "Error_Mount_Path_Not_Found",
args: args{
ctx: context.Background(),
mountpoint: "mount_path",
},
wantFsType: "",
wantErr: false,
wantErr: true,
},
}
for _, tt := range tests {
Expand Down
Loading
Loading