MCPcopy
hub / github.com/google/gvisor / SetStat

Method SetStat

pkg/sentry/fsimpl/fuse/file.go:156–166  ·  view source on GitHub ↗

SetStat implements vfs.FileDescriptionImpl.SetStat.

(ctx context.Context, opts vfs.SetStatOptions)

Source from the content-addressed store, hash-verified

154
155// SetStat implements vfs.FileDescriptionImpl.SetStat.
156func (fd *fileDescription) SetStat(ctx context.Context, opts vfs.SetStatOptions) error {
157 fs := fd.filesystem()
158 creds := auth.CredentialsFromContext(ctx)
159 inode := fd.inode()
160 inode.attrMu.Lock()
161 defer inode.attrMu.Unlock()
162 if err := vfs.CheckSetStat(ctx, creds, &opts, inode.filemode(), auth.KUID(inode.uid.Load()), auth.KGID(inode.gid.Load())); err != nil {
163 return err
164 }
165 return inode.setAttr(ctx, fs, creds, opts, fhOptions{useFh: true, fh: fd.Fh})
166}
167
168// Sync implements vfs.FileDescriptionImpl.Sync.
169func (fd *fileDescription) Sync(ctx context.Context) error {

Callers

nothing calls this directly

Calls 11

filesystemMethod · 0.95
inodeMethod · 0.95
CredentialsFromContextFunction · 0.92
CheckSetStatFunction · 0.92
KUIDTypeAlias · 0.92
KGIDTypeAlias · 0.92
filemodeMethod · 0.80
setAttrMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65
LoadMethod · 0.65

Tested by

no test coverage detected