diff options
| author | chrislu <chris.lu@gmail.com> | 2022-02-13 04:22:02 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-02-13 04:22:02 -0800 |
| commit | a1ef0e48a982ade0ca6a6e288e955422c61f8c37 (patch) | |
| tree | 39f143bd1b901315ea1975c3738092ce191914b9 /weed/mount/weedfs_dir_read.go | |
| parent | be40ff6048f8b6005db9cff54f074b3ab5134abb (diff) | |
| download | seaweedfs-a1ef0e48a982ade0ca6a6e288e955422c61f8c37.tar.xz seaweedfs-a1ef0e48a982ade0ca6a6e288e955422c61f8c37.zip | |
doc
Diffstat (limited to 'weed/mount/weedfs_dir_read.go')
| -rw-r--r-- | weed/mount/weedfs_dir_read.go | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/weed/mount/weedfs_dir_read.go b/weed/mount/weedfs_dir_read.go index 96fd36ffe..3a187aa1c 100644 --- a/weed/mount/weedfs_dir_read.go +++ b/weed/mount/weedfs_dir_read.go @@ -13,18 +13,56 @@ import ( // Directory handling +/** Open directory + * + * Unless the 'default_permissions' mount option is given, + * this method should check if opendir is permitted for this + * directory. Optionally opendir may also return an arbitrary + * filehandle in the fuse_file_info structure, which will be + * passed to readdir, releasedir and fsyncdir. + */ func (wfs *WFS) OpenDir(cancel <-chan struct{}, input *fuse.OpenIn, out *fuse.OpenOut) (code fuse.Status) { if !wfs.inodeToPath.HasInode(input.NodeId) { return fuse.ENOENT } return fuse.OK } + +/** Release directory + * + * If the directory has been removed after the call to opendir, the + * path parameter will be NULL. + */ func (wfs *WFS) ReleaseDir(input *fuse.ReleaseIn) { } + +/** Synchronize directory contents + * + * If the directory has been removed after the call to opendir, the + * path parameter will be NULL. + * + * If the datasync parameter is non-zero, then only the user data + * should be flushed, not the meta data + */ func (wfs *WFS) FsyncDir(cancel <-chan struct{}, input *fuse.FsyncIn) (code fuse.Status) { return fuse.OK } +/** Read directory + * + * The filesystem may choose between two modes of operation: + * + * 1) The readdir implementation ignores the offset parameter, and + * passes zero to the filler function's offset. The filler + * function will not return '1' (unless an error happens), so the + * whole directory is read in a single readdir operation. + * + * 2) The readdir implementation keeps track of the offsets of the + * directory entries. It uses the offset parameter and always + * passes non-zero offset to the filler function. When the buffer + * is full (or an error happens) the filler function will return + * '1'. + */ func (wfs *WFS) ReadDir(cancel <-chan struct{}, input *fuse.ReadIn, out *fuse.DirEntryList) (code fuse.Status) { return wfs.doReadDirectory(input, out, false) } |
