2015-03-25 01:17:58 +03:00
|
|
|
// Copyright 2015 Google Inc. All Rights Reserved.
|
|
|
|
//
|
|
|
|
// 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 fuseutil
|
|
|
|
|
2015-03-25 01:20:54 +03:00
|
|
|
import (
|
2018-02-07 18:12:44 +03:00
|
|
|
"context"
|
|
|
|
|
2015-03-25 01:20:54 +03:00
|
|
|
"github.com/jacobsa/fuse"
|
|
|
|
"github.com/jacobsa/fuse/fuseops"
|
|
|
|
)
|
|
|
|
|
2015-03-25 01:54:12 +03:00
|
|
|
// A FileSystem that responds to all ops with fuse.ENOSYS. Embed this in your
|
2015-03-25 01:20:54 +03:00
|
|
|
// struct to inherit default implementations for the methods you don't care
|
|
|
|
// about, ensuring your struct will continue to implement FileSystem even as
|
|
|
|
// new methods are added.
|
2015-03-25 01:17:58 +03:00
|
|
|
type NotImplementedFileSystem struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ FileSystem = &NotImplementedFileSystem{}
|
2015-03-25 01:20:54 +03:00
|
|
|
|
2015-09-09 02:47:48 +03:00
|
|
|
func (fs *NotImplementedFileSystem) StatFS(
|
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.StatFSOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-09-09 02:47:48 +03:00
|
|
|
}
|
|
|
|
|
2015-03-25 01:20:54 +03:00
|
|
|
func (fs *NotImplementedFileSystem) LookUpInode(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.LookUpInodeOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-03-25 01:20:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (fs *NotImplementedFileSystem) GetInodeAttributes(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.GetInodeAttributesOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-03-25 01:20:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (fs *NotImplementedFileSystem) SetInodeAttributes(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.SetInodeAttributesOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-03-25 01:20:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (fs *NotImplementedFileSystem) ForgetInode(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.ForgetInodeOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-03-25 01:20:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (fs *NotImplementedFileSystem) MkDir(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.MkDirOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-03-25 01:20:54 +03:00
|
|
|
}
|
|
|
|
|
2015-12-15 02:35:40 +03:00
|
|
|
func (fs *NotImplementedFileSystem) MkNode(
|
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.MkNodeOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-12-15 02:35:40 +03:00
|
|
|
}
|
|
|
|
|
2015-03-25 01:20:54 +03:00
|
|
|
func (fs *NotImplementedFileSystem) CreateFile(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.CreateFileOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-03-25 01:20:54 +03:00
|
|
|
}
|
|
|
|
|
2015-05-19 08:33:19 +03:00
|
|
|
func (fs *NotImplementedFileSystem) CreateSymlink(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.CreateSymlinkOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-05-19 08:33:19 +03:00
|
|
|
}
|
|
|
|
|
2017-11-24 14:44:41 +03:00
|
|
|
func (fs *NotImplementedFileSystem) CreateLink(
|
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.CreateLinkOp) error {
|
|
|
|
return fuse.ENOSYS
|
2017-11-24 14:44:41 +03:00
|
|
|
}
|
|
|
|
|
2015-06-25 08:37:37 +03:00
|
|
|
func (fs *NotImplementedFileSystem) Rename(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.RenameOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-06-25 08:37:37 +03:00
|
|
|
}
|
|
|
|
|
2015-03-25 01:20:54 +03:00
|
|
|
func (fs *NotImplementedFileSystem) RmDir(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.RmDirOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-03-25 01:20:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (fs *NotImplementedFileSystem) Unlink(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.UnlinkOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-03-25 01:20:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (fs *NotImplementedFileSystem) OpenDir(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.OpenDirOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-03-25 01:20:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (fs *NotImplementedFileSystem) ReadDir(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.ReadDirOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-03-25 01:20:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (fs *NotImplementedFileSystem) ReleaseDirHandle(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.ReleaseDirHandleOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-03-25 01:20:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (fs *NotImplementedFileSystem) OpenFile(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.OpenFileOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-03-25 01:20:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (fs *NotImplementedFileSystem) ReadFile(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.ReadFileOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-03-25 01:20:54 +03:00
|
|
|
}
|
|
|
|
|
2021-08-25 11:05:53 +03:00
|
|
|
func (fs *NotImplementedFileSystem) VectoredRead(
|
|
|
|
ctx context.Context,
|
|
|
|
op *fuseops.VectoredReadOp) error {
|
|
|
|
return fuse.ENOSYS
|
|
|
|
}
|
|
|
|
|
2015-03-25 01:20:54 +03:00
|
|
|
func (fs *NotImplementedFileSystem) WriteFile(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.WriteFileOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-03-25 01:20:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (fs *NotImplementedFileSystem) SyncFile(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.SyncFileOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-03-25 01:20:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (fs *NotImplementedFileSystem) FlushFile(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.FlushFileOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-03-25 01:20:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (fs *NotImplementedFileSystem) ReleaseFileHandle(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.ReleaseFileHandleOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-03-25 01:20:54 +03:00
|
|
|
}
|
2015-05-19 09:06:57 +03:00
|
|
|
|
|
|
|
func (fs *NotImplementedFileSystem) ReadSymlink(
|
2015-07-27 08:15:07 +03:00
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.ReadSymlinkOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-05-19 09:06:57 +03:00
|
|
|
}
|
2015-06-05 06:51:45 +03:00
|
|
|
|
2015-12-04 23:26:49 +03:00
|
|
|
func (fs *NotImplementedFileSystem) RemoveXattr(
|
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.RemoveXattrOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-12-04 23:26:49 +03:00
|
|
|
}
|
|
|
|
|
2015-12-10 23:58:46 +03:00
|
|
|
func (fs *NotImplementedFileSystem) GetXattr(
|
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.GetXattrOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-12-10 23:58:46 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (fs *NotImplementedFileSystem) ListXattr(
|
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.ListXattrOp) error {
|
|
|
|
return fuse.ENOSYS
|
2015-12-10 23:58:46 +03:00
|
|
|
}
|
|
|
|
|
2017-03-06 06:40:50 +03:00
|
|
|
func (fs *NotImplementedFileSystem) SetXattr(
|
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.SetXattrOp) error {
|
|
|
|
return fuse.ENOSYS
|
2017-03-06 06:40:50 +03:00
|
|
|
}
|
|
|
|
|
2019-10-26 11:15:00 +03:00
|
|
|
func (fs *NotImplementedFileSystem) Fallocate(
|
|
|
|
ctx context.Context,
|
2020-01-28 12:10:08 +03:00
|
|
|
op *fuseops.FallocateOp) error {
|
|
|
|
return fuse.ENOSYS
|
2019-10-26 11:15:00 +03:00
|
|
|
}
|
|
|
|
|
2015-06-05 06:51:45 +03:00
|
|
|
func (fs *NotImplementedFileSystem) Destroy() {
|
|
|
|
}
|