diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-02-27 03:32:21 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-02-27 03:32:21 +0000 |
commit | 8c690ea82b93a7500335fc960c948c37807ae008 (patch) | |
tree | 754c6d4acf9539657df89e26ce1ce8a8409d09c5 /pkg/sentry/syscalls/linux/vfs2/stat.go | |
parent | 56c3c37488801ce9d638f7b6088c7744ed883c2c (diff) | |
parent | 8fb84f78adfc0dba964ebe97edb51ebf8a80f752 (diff) |
Merge release-20200219.0-50-g8fb84f7 (automated)
Diffstat (limited to 'pkg/sentry/syscalls/linux/vfs2/stat.go')
-rwxr-xr-x | pkg/sentry/syscalls/linux/vfs2/stat.go | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/pkg/sentry/syscalls/linux/vfs2/stat.go b/pkg/sentry/syscalls/linux/vfs2/stat.go index dca8d7011..12c532310 100755 --- a/pkg/sentry/syscalls/linux/vfs2/stat.go +++ b/pkg/sentry/syscalls/linux/vfs2/stat.go @@ -113,29 +113,6 @@ func fstatat(t *kernel.Task, dirfd int32, pathAddr, statAddr usermem.Addr, flags return stat.CopyOut(t, statAddr) } -// This takes both input and output as pointer arguments to avoid copying large -// structs. -func convertStatxToUserStat(t *kernel.Task, statx *linux.Statx, stat *linux.Stat) { - // Linux just copies fields from struct kstat without regard to struct - // kstat::result_mask (fs/stat.c:cp_new_stat()), so we do too. - userns := t.UserNamespace() - *stat = linux.Stat{ - Dev: uint64(linux.MakeDeviceID(uint16(statx.DevMajor), statx.DevMinor)), - Ino: statx.Ino, - Nlink: uint64(statx.Nlink), - Mode: uint32(statx.Mode), - UID: uint32(auth.KUID(statx.UID).In(userns).OrOverflow()), - GID: uint32(auth.KGID(statx.GID).In(userns).OrOverflow()), - Rdev: uint64(linux.MakeDeviceID(uint16(statx.RdevMajor), statx.RdevMinor)), - Size: int64(statx.Size), - Blksize: int64(statx.Blksize), - Blocks: int64(statx.Blocks), - ATime: timespecFromStatxTimestamp(statx.Atime), - MTime: timespecFromStatxTimestamp(statx.Mtime), - CTime: timespecFromStatxTimestamp(statx.Ctime), - } -} - func timespecFromStatxTimestamp(sxts linux.StatxTimestamp) linux.Timespec { return linux.Timespec{ Sec: sxts.Sec, |