From e612c866cb738def704de4323407eebc7a1bf28a Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Mon, 2 Mar 2015 16:11:14 +1100 Subject: [PATCH] Declared a MkDir method. --- file_system.go | 23 +++++++++++++++++++++++ fuseutil/not_implemented_file_system.go | 6 ++++++ 2 files changed, 29 insertions(+) diff --git a/file_system.go b/file_system.go index d972428..fc1cd49 100644 --- a/file_system.go +++ b/file_system.go @@ -52,6 +52,16 @@ type FileSystem interface { ctx context.Context, req *ForgetInodeRequest) (*ForgetInodeResponse, error) + /////////////////////////////////// + // Inode creation + /////////////////////////////////// + + // Create a directory inode as a child of an existing directory inode. The + // kernel sends this in response to a mkdir(2) call. + MkDir( + ctx context.Context, + req *MkDirRequest) (*MkDirResponse, error) + /////////////////////////////////// // Directory handles /////////////////////////////////// @@ -306,6 +316,19 @@ type ForgetInodeRequest struct { type ForgetInodeResponse struct { } +type MkDirRequest struct { + // The ID of parent directory inode within which to create the child. + Parent InodeID + + // The name of the child to create, and the mode with which to create it. + Name string + Mode os.FileMode +} + +type MkDirResponse struct { + // TODO(jacobsa): Create a structure and share it with LookUpInodeResponse. +} + type OpenDirRequest struct { // The ID of the inode to be opened. Inode InodeID diff --git a/fuseutil/not_implemented_file_system.go b/fuseutil/not_implemented_file_system.go index c4f7a88..8453d97 100644 --- a/fuseutil/not_implemented_file_system.go +++ b/fuseutil/not_implemented_file_system.go @@ -40,6 +40,12 @@ func (fs *NotImplementedFileSystem) ForgetInode( return nil, fuse.ENOSYS } +func (fs *NotImplementedFileSystem) MkDir( + ctx context.Context, + req *fuse.MkDirRequest) (*fuse.MkDirResponse, error) { + return nil, fuse.ENOSYS +} + func (fs *NotImplementedFileSystem) OpenDir( ctx context.Context, req *fuse.OpenDirRequest) (*fuse.OpenDirResponse, error) {