Skip to content

Commit e3da02a

Browse files
committed
Document semantics of add_entry parameter to readdir callback.
Fixes: #196.
1 parent 36cd288 commit e3da02a

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/api/filesystem/async_io.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,9 @@ pub trait AsyncFileSystem: FileSystem {
618618
/// the file system did not return a `Handle` from `opendir` then the contents of `handle` are
619619
/// undefined.
620620
///
621-
/// `size` indicates the maximum number of bytes that should be returned by this method.
621+
/// `size` indicates the maximum number of bytes that should be returned by this method,
622+
/// but can be ignored in practice. Instead, entries are returned by calling the
623+
/// `add_entry` function until it returns zero (indicating that the buffer is full).
622624
///
623625
/// If `offset` is non-zero then it corresponds to one of the `offset` values from a `DirEntry`
624626
/// that was previously returned by a call to `readdir` for the same handle. In this case the
@@ -659,7 +661,9 @@ pub trait AsyncFileSystem: FileSystem {
659661
/// the file system did not return a `Handle` from `opendir` then the contents of `handle` are
660662
/// undefined.
661663
///
662-
/// `size` indicates the maximum number of bytes that should be returned by this method.
664+
/// `size` indicates the maximum number of bytes that should be returned by this method,
665+
/// but can be ignored in practice. Instead, entries are returned by calling the
666+
/// `add_entry` function until it returns zero (indicating that the buffer is full).
663667
///
664668
/// Unlike `readdir`, the lookup count for `Inode`s associated with the returned directory
665669
/// entries **IS** affected by this method (since it returns an `Entry` for each `DirEntry`).

src/api/filesystem/sync_io.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,9 @@ pub trait FileSystem {
634634
/// the file system did not return a `Handle` from `opendir` then the contents of `handle` are
635635
/// undefined.
636636
///
637-
/// `size` indicates the maximum number of bytes that should be returned by this method.
637+
/// `size` indicates the maximum number of bytes that should be returned by this method,
638+
/// but can be ignored in practice. Instead, entries are returned by calling the
639+
/// `add_entry` function until it returns zero (indicating that the buffer is full).
638640
///
639641
/// If `offset` is non-zero then it corresponds to one of the `offset` values from a `DirEntry`
640642
/// that was previously returned by a call to `readdir` for the same handle. In this case the
@@ -675,7 +677,10 @@ pub trait FileSystem {
675677
/// the file system did not return a `Handle` from `opendir` then the contents of `handle` are
676678
/// undefined.
677679
///
678-
/// `size` indicates the maximum number of bytes that should be returned by this method.
680+
/// `size` indicates the maximum number of bytes that should be returned by this method,
681+
/// but can be ignored in practice. Instead, entries are returned by calling the
682+
/// `add_entry` function until it returns zero (indicating that the buffer is full).
683+
///
679684
///
680685
/// Unlike `readdir`, the lookup count for `Inode`s associated with the returned directory
681686
/// entries **IS** affected by this method (since it returns an `Entry` for each `DirEntry`).

0 commit comments

Comments
 (0)