Skip to content

Commit

Permalink
DAOS-16686 dfuse: read from cache for readahead
Browse files Browse the repository at this point in the history
Read from readahead cache aggressively, and it may need improved
later.

Required-githooks: true
Allow-unstable-test: true
Signed-off-by: Di Wang <[email protected]>
  • Loading branch information
wangdi1 committed Dec 18, 2024
1 parent a331daa commit 3309425
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/client/dfuse/ops/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ dfuse_readahead_reply(fuse_req_t req, size_t len, off_t position, struct dfuse_o
* later checks will determine if the file is read to the end.
*/
oh->doh_linear_read_pos = max(oh->doh_linear_read_pos, position + len);
} else if (oh->doh_linear_read_pos != position) {
DFUSE_TRA_DEBUG(oh, "disabling pre read");
} else if ((position + len) <= active->readahead->dra_ev->de_readahead_len) {
DFUSE_TRA_DEBUG(oh, "disabling pre read %llu pos %zu != %zu",
(unsigned long long)oh->doh_ie->ie_stat.st_ino,
oh->doh_linear_read_pos, position);
return false;
} else {
oh->doh_linear_read_pos = position + len;
Expand Down

0 comments on commit 3309425

Please sign in to comment.