diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-02-04 16:33:11 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-02-04 16:33:11 +0000 |
commit | 9bd06563049671dbc979ce25ca931a1dfd906570 (patch) | |
tree | b14ce7dc65612927789fd2123b0036f053324a26 /pkg/sentry/fs/gofer/fifo.go | |
parent | 37bac1411e4b92af438448bf0bdeaed55bd1d1e1 (diff) | |
parent | d7cd484091543827678f1548b8e5668a7a86e13f (diff) |
Merge release-20200127.0-58-gd7cd484 (automated)
Diffstat (limited to 'pkg/sentry/fs/gofer/fifo.go')
-rwxr-xr-x | pkg/sentry/fs/gofer/fifo.go | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/pkg/sentry/fs/gofer/fifo.go b/pkg/sentry/fs/gofer/fifo.go new file mode 100755 index 000000000..456557058 --- /dev/null +++ b/pkg/sentry/fs/gofer/fifo.go @@ -0,0 +1,40 @@ +// Copyright 2020 The gVisor Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package gofer + +import ( + "gvisor.dev/gvisor/pkg/context" + "gvisor.dev/gvisor/pkg/sentry/fs" +) + +// +stateify savable +type fifo struct { + fs.InodeOperations + fileIops *inodeOperations +} + +var _ fs.InodeOperations = (*fifo)(nil) + +// Rename implements fs.InodeOperations. It forwards the call to the underlying +// file inode to handle the file rename. Note that file key remains the same +// after the rename to keep the endpoint mapping. +func (i *fifo) Rename(ctx context.Context, inode *fs.Inode, oldParent *fs.Inode, oldName string, newParent *fs.Inode, newName string, replacement bool) error { + return i.fileIops.Rename(ctx, inode, oldParent, oldName, newParent, newName, replacement) +} + +// StatFS implements fs.InodeOperations. +func (i *fifo) StatFS(ctx context.Context) (fs.Info, error) { + return i.fileIops.StatFS(ctx) +} |