diff --git a/changelog/unreleased/improve-posixfs.md b/changelog/unreleased/improve-posixfs.md index 1e788f1732..bd642a4507 100644 --- a/changelog/unreleased/improve-posixfs.md +++ b/changelog/unreleased/improve-posixfs.md @@ -2,4 +2,6 @@ Enhancement: Add trashbin support to posixfs alongside other improvements We added support for trashbins to posixfs. Posixfs also saw a number of other improvement, bugfixes and optimizations. +https://github.com/cs3org/reva/pull/4848 https://github.com/cs3org/reva/pull/4779 + diff --git a/pkg/storage/fs/posix/timemanager/timemanager.go b/pkg/storage/fs/posix/timemanager/timemanager.go index ee5407d9f9..f8e9e958d3 100644 --- a/pkg/storage/fs/posix/timemanager/timemanager.go +++ b/pkg/storage/fs/posix/timemanager/timemanager.go @@ -80,8 +80,9 @@ func (m *Manager) CTime(ctx context.Context, n *node.Node) (time.Time, error) { } stat := fi.Sys().(*syscall.Stat_t) + statCTime := StatCTime(stat) //nolint:unconvert - return time.Unix(int64(stat.Ctim.Sec), int64(stat.Ctim.Nsec)), nil + return time.Unix(int64(statCTime.Sec), int64(statCTime.Nsec)), nil } // TCTime returns the tree creation time (tctime) of a node. diff --git a/pkg/storage/fs/posix/timemanager/timemanager_bsd.go b/pkg/storage/fs/posix/timemanager/timemanager_bsd.go new file mode 100644 index 0000000000..c2bebb2e01 --- /dev/null +++ b/pkg/storage/fs/posix/timemanager/timemanager_bsd.go @@ -0,0 +1,10 @@ +//go:build darwin || freebsd || netbsd || openbsd + +package timemanager + +import "syscall" + +// StatCtime returns the change time +func StatCTime(st *syscall.Stat_t) syscall.Timespec { + return st.Ctimespec +} diff --git a/pkg/storage/fs/posix/timemanager/timemanager_sysv.go b/pkg/storage/fs/posix/timemanager/timemanager_sysv.go new file mode 100644 index 0000000000..bb4966fce6 --- /dev/null +++ b/pkg/storage/fs/posix/timemanager/timemanager_sysv.go @@ -0,0 +1,10 @@ +//go:build dragonfly || linux || solaris + +package timemanager + +import "syscall" + +// StatCtime returns the change time +func StatCTime(st *syscall.Stat_t) syscall.Timespec { + return st.Ctim +}