diff --git a/fuseops/convert.go b/fuseops/convert.go index 4dd0ceb..960ca2a 100644 --- a/fuseops/convert.go +++ b/fuseops/convert.go @@ -42,14 +42,6 @@ func Convert( var io internalOp switch typed := r.(type) { - case *bazilfuse.InitRequest: - to := &InitOp{ - maxReadahead: typed.MaxReadahead, - } - - io = to - co = &to.commonOp - case *bazilfuse.LookupRequest: to := &LookUpInodeOp{ Parent: InodeID(typed.Header.Node), diff --git a/fuseops/ops.go b/fuseops/ops.go index cd21c0e..f65646e 100644 --- a/fuseops/ops.go +++ b/fuseops/ops.go @@ -53,64 +53,6 @@ type Op interface { Logf(format string, v ...interface{}) } -//////////////////////////////////////////////////////////////////////// -// Setup -//////////////////////////////////////////////////////////////////////// - -// Sent once when mounting the file system. It must succeed in order for the -// mount to succeed. -type InitOp struct { - commonOp - - maxReadahead uint32 -} - -func (o *InitOp) toBazilfuseResponse() (bfResp interface{}) { - resp := bazilfuse.InitResponse{} - bfResp = &resp - - // Ask the Linux kernel for larger write requests. - // - // As of 2015-03-26, the behavior in the kernel is: - // - // * (http://goo.gl/jMKHMZ, http://goo.gl/XTF4ZH) Cap the max write size at - // the maximum of 4096 and init_response->max_write. - // - // * (http://goo.gl/gEIvHZ) If FUSE_BIG_WRITES isn't set, don't return more - // than one page. - // - // * (http://goo.gl/4RLhxZ, http://goo.gl/hi0Cm2) Never write more than - // FUSE_MAX_PAGES_PER_REQ pages (128 KiB on x86). - // - // 4 KiB is crazy small. Ask for significantly more, and take what the kernel - // will give us. - const maxWrite = 1 << 21 - resp.Flags |= bazilfuse.InitBigWrites - resp.MaxWrite = maxWrite - - // Ask the Linux kernel for larger read requests. - // - // As of 2015-03-26, the behavior in the kernel is: - // - // * (http://goo.gl/bQ1f1i, http://goo.gl/HwBrR6) Set the local variable - // ra_pages to be init_response->max_readahead divided by the page size. - // - // * (http://goo.gl/gcIsSh, http://goo.gl/LKV2vA) Set - // backing_dev_info::ra_pages to the min of that value and what was sent - // in the request's max_readahead field. - // - // * (http://goo.gl/u2SqzH) Use backing_dev_info::ra_pages when deciding - // how much to read ahead. - // - // * (http://goo.gl/JnhbdL) Don't read ahead at all if that field is zero. - // - // Reading a page at a time is a drag. Ask for as much as the kernel is - // willing to give us. - resp.MaxReadahead = o.maxReadahead - - return -} - //////////////////////////////////////////////////////////////////////// // Inodes //////////////////////////////////////////////////////////////////////// diff --git a/fuseutil/file_system.go b/fuseutil/file_system.go index 18510aa..aff879b 100644 --- a/fuseutil/file_system.go +++ b/fuseutil/file_system.go @@ -40,7 +40,6 @@ var fRandomDelays = flag.Bool( // See NotImplementedFileSystem for a convenient way to embed default // implementations for methods you don't care about. type FileSystem interface { - Init(*fuseops.InitOp) error LookUpInode(*fuseops.LookUpInodeOp) error GetInodeAttributes(*fuseops.GetInodeAttributesOp) error SetInodeAttributes(*fuseops.SetInodeAttributesOp) error @@ -128,9 +127,6 @@ func (s *fileSystemServer) handleOp(op fuseops.Op) { default: err = fuse.ENOSYS - case *fuseops.InitOp: - err = s.fs.Init(typed) - case *fuseops.LookUpInodeOp: err = s.fs.LookUpInode(typed) diff --git a/fuseutil/not_implemented_file_system.go b/fuseutil/not_implemented_file_system.go index 9d12e21..d3a5301 100644 --- a/fuseutil/not_implemented_file_system.go +++ b/fuseutil/not_implemented_file_system.go @@ -28,12 +28,6 @@ type NotImplementedFileSystem struct { var _ FileSystem = &NotImplementedFileSystem{} -func (fs *NotImplementedFileSystem) Init( - op *fuseops.InitOp) (err error) { - err = fuse.ENOSYS - return -} - func (fs *NotImplementedFileSystem) LookUpInode( op *fuseops.LookUpInodeOp) (err error) { err = fuse.ENOSYS diff --git a/mounted_file_system.go b/mounted_file_system.go index afecd6f..3113bc4 100644 --- a/mounted_file_system.go +++ b/mounted_file_system.go @@ -184,9 +184,7 @@ func (c *MountConfig) bazilfuseOptions() (opts []bazilfuse.MountOption) { // Attempt to mount a file system on the given directory, using the supplied // Server to serve connection requests. This function blocks until the file -// system is successfully mounted. On some systems, this requires the supplied -// Server to make forward progress (in particular, to respond to -// fuseops.InitOp). +// system is successfully mounted. func Mount( dir string, server Server, diff --git a/samples/cachingfs/caching_fs.go b/samples/cachingfs/caching_fs.go index e5e36ec..dc8e4d8 100644 --- a/samples/cachingfs/caching_fs.go +++ b/samples/cachingfs/caching_fs.go @@ -238,11 +238,6 @@ func (fs *cachingFS) SetMtime(mtime time.Time) { // FileSystem methods //////////////////////////////////////////////////////////////////////// -func (fs *cachingFS) Init( - op *fuseops.InitOp) (err error) { - return -} - // LOCKS_EXCLUDED(fs.mu) func (fs *cachingFS) LookUpInode( op *fuseops.LookUpInodeOp) (err error) { diff --git a/samples/flushfs/flush_fs.go b/samples/flushfs/flush_fs.go index b208b7e..bf8c3c0 100644 --- a/samples/flushfs/flush_fs.go +++ b/samples/flushfs/flush_fs.go @@ -92,11 +92,6 @@ func (fs *flushFS) barAttributes() fuseops.InodeAttributes { // FileSystem methods //////////////////////////////////////////////////////////////////////// -func (fs *flushFS) Init( - op *fuseops.InitOp) (err error) { - return -} - func (fs *flushFS) LookUpInode( op *fuseops.LookUpInodeOp) (err error) { fs.mu.Lock() diff --git a/samples/forgetfs/forget_fs.go b/samples/forgetfs/forget_fs.go index 5275691..d8f47ea 100644 --- a/samples/forgetfs/forget_fs.go +++ b/samples/forgetfs/forget_fs.go @@ -222,11 +222,6 @@ func (fs *fsImpl) findInodeByID(id fuseops.InodeID) (in *inode) { // FileSystem methods //////////////////////////////////////////////////////////////////////// -func (fs *fsImpl) Init( - op *fuseops.InitOp) (err error) { - return -} - func (fs *fsImpl) LookUpInode( op *fuseops.LookUpInodeOp) (err error) { fs.mu.Lock() diff --git a/samples/hellofs/hello_fs.go b/samples/hellofs/hello_fs.go index 30695d2..b07d1d4 100644 --- a/samples/hellofs/hello_fs.go +++ b/samples/hellofs/hello_fs.go @@ -147,10 +147,6 @@ func (fs *helloFS) patchAttributes( attr.Crtime = now } -func (fs *helloFS) Init(op *fuseops.InitOp) (err error) { - return -} - func (fs *helloFS) LookUpInode(op *fuseops.LookUpInodeOp) (err error) { // Find the info for the parent. parentInfo, ok := gInodeInfo[op.Parent] diff --git a/samples/interruptfs/interrupt_fs.go b/samples/interruptfs/interrupt_fs.go index 78a2959..5960a32 100644 --- a/samples/interruptfs/interrupt_fs.go +++ b/samples/interruptfs/interrupt_fs.go @@ -77,11 +77,6 @@ func (fs *InterruptFS) WaitForReadInFlight() { // FileSystem methods //////////////////////////////////////////////////////////////////////// -func (fs *InterruptFS) Init( - op *fuseops.InitOp) (err error) { - return -} - func (fs *InterruptFS) LookUpInode( op *fuseops.LookUpInodeOp) (err error) { // We support only one parent. diff --git a/samples/memfs/memfs.go b/samples/memfs/memfs.go index 7b97bec..544b516 100644 --- a/samples/memfs/memfs.go +++ b/samples/memfs/memfs.go @@ -199,11 +199,6 @@ func (fs *memFS) deallocateInode(id fuseops.InodeID) { // FileSystem methods //////////////////////////////////////////////////////////////////////// -func (fs *memFS) Init( - op *fuseops.InitOp) (err error) { - return -} - func (fs *memFS) LookUpInode( op *fuseops.LookUpInodeOp) (err error) { fs.mu.Lock()