Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuse readdir #1244

Merged
merged 2 commits into from
Oct 27, 2021
Merged

Fuse readdir #1244

merged 2 commits into from
Oct 27, 2021

Conversation

shyodx
Copy link
Collaborator

@shyodx shyodx commented Oct 18, 2021

This patchset introduces HandleReadDirer for fuse. It allows readdir
to only read partial sub-dirents one time. If both HandleReadDirer
and HandleReadDirAll are implemented, the former is used.

This patch introduces an Interface HandleReadDirer, which implements
ReadDir to read partial sub-dirents accroding to request offset and
size.

From now on, readdir could be implemented in two ways:
 * ReaddirAll reads all sub-dirents one time
 * Readdir reads partial sub-dirents and the caller needs to call
   it multple times if more sub-dirents are requested
 * If both are implemented, Readdir is used

Signed-off-by: Sheng Yong <shengyong2021@gmail.com>
mervinkid
mervinkid previously approved these changes Oct 21, 2021
Copy link
Member

@mervinkid mervinkid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve +1

The call of BatchInodeGet should also be optimized to reduce the splitting of large requests into multiple small requests.

This implements ReadDir for fuse.

In order to save current position of readdir, a map DirContexts is
introduced in `Dir struct'. Key Value pair (fuse.HandleID,
DirContext) is created and saved in DirContexts when readdir
starts, and is removed when parent directory is closed.

ReadDir reads a number of dirents from current position, thus a
DirContext, based on ReadDirLimit. After that, a new position
is saved in the same DirContext.

Signed-off-by: Sheng Yong <shengyong2021@gmail.com>
@shuoranliu shuoranliu merged commit b605340 into cubefs:master Oct 27, 2021
@shyodx shyodx deleted the fuse-readdir branch November 3, 2021 02:20
awzhgw pushed a commit that referenced this pull request Jan 21, 2024
…-17 15:10:33

修复Extent Merge去重逻辑遗漏问题
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants