Declared a MkDir method.

geesefs-0-30-9
Aaron Jacobs 2015-03-02 16:11:14 +11:00
parent 902c5800e1
commit e612c866cb
2 changed files with 29 additions and 0 deletions

View File

@ -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

View File

@ -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) {