From 3e9e5fe09de629453625b3c54d4836c99dfe73b3 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Fri, 27 Feb 2015 09:52:34 +1100 Subject: [PATCH] ReleaseHandle docs and types. --- file_system.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/file_system.go b/file_system.go index 91c8f77..a1f5335 100644 --- a/file_system.go +++ b/file_system.go @@ -28,9 +28,6 @@ type FileSystem interface { // Forget an inode ID previously issued (e.g. by LookUpInode). The kernel // calls this when removing an inode from its internal caches. - // - // The kernel guarantees that the node ID will not be used in further calls - // to the file system (unless it is reissued by the file system). ForgetInode( ctx context.Context, req *ForgetInodeRequest) (*ForgetInodeResponse, error) @@ -42,7 +39,12 @@ type FileSystem interface { ctx context.Context, req *OpenDirRequest) (*OpenDirResponse, error) - // XXX: Comments + // Release a previously-minted handle. The kernel calls this when there are + // no more references to an open file: all file descriptors are closed and + // all memory mappings are unmapped. + // + // The kernel guarantees that the handle ID will not be used in further calls + // to the file system (unless it is reissued by the file system). ReleaseHandle( ctx context.Context, req *ReleaseHandleRequest) (*ReleaseHandleResponse, error) @@ -212,3 +214,13 @@ type OpenDirResponse struct { // ReleaseHandle. Handle HandleID } + +type ReleaseHandleRequest struct { + // The handle ID to be released. The kernel guarantees that this ID will not + // be used in further calls to the file system (unless it is reissued by the + // file system). + Handle HandleID +} + +type ReleaseHandleResponse struct { +}