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

DAOS-16887 dfuse: use the inode instead of open handle in pre-read #15630

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/client/dfuse/dfuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ bool
dfuse_dcache_get_valid(struct dfuse_inode_entry *ie, double max_age);

void
dfuse_pre_read(struct dfuse_info *dfuse_info, struct dfuse_obj_hdl *oh);
dfuse_pre_read(struct dfuse_info *dfuse_info, struct dfuse_inode_entry *ie);

int
check_for_uns_ep(struct dfuse_info *dfuse_info, struct dfuse_inode_entry *ie, char *attr,
Expand Down
2 changes: 1 addition & 1 deletion src/client/dfuse/ops/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ dfuse_cb_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
* release from completing which also holds open the inode.
*/
if (preread)
dfuse_pre_read(dfuse_info, oh);
dfuse_pre_read(dfuse_info, ie);

return;
decref:
Expand Down
12 changes: 6 additions & 6 deletions src/client/dfuse/ops/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,13 +600,13 @@ dfuse_cb_pre_read_complete(struct dfuse_event *ev)
}

void
dfuse_pre_read(struct dfuse_info *dfuse_info, struct dfuse_obj_hdl *oh)
dfuse_pre_read(struct dfuse_info *dfuse_info, struct dfuse_inode_entry *ie)
{
struct active_inode *active = oh->doh_ie->ie_active;
struct active_inode *active = ie->ie_active;
struct dfuse_eq *eqt;
int rc;
struct dfuse_event *ev;
size_t len = oh->doh_ie->ie_stat.st_size;
size_t len = ie->ie_stat.st_size;

eqt = pick_eqt(dfuse_info);
ev = d_slab_acquire(eqt->de_pre_read_slab);
Expand All @@ -616,15 +616,15 @@ dfuse_pre_read(struct dfuse_info *dfuse_info, struct dfuse_obj_hdl *oh)
ev->de_iov.iov_len = len;
ev->de_req = 0;
ev->de_sgl.sg_nr = 1;
ev->de_ie = oh->doh_ie;
ev->de_ie = ie;
ev->de_readahead_len = len;
ev->de_req_position = 0;
ev->de_di = dfuse_info;

ev->de_complete_cb = dfuse_cb_pre_read_complete;
active->readahead->dra_ev = ev;

rc = dfs_read(oh->doh_dfs, oh->doh_obj, &ev->de_sgl, 0, &ev->de_len, &ev->de_ev);
rc = dfs_read(ie->ie_dfs->dfs_ns, ie->ie_obj, &ev->de_sgl, 0, &ev->de_len, &ev->de_ev);
if (rc != 0)
goto err;

Expand All @@ -642,6 +642,6 @@ dfuse_pre_read(struct dfuse_info *dfuse_info, struct dfuse_obj_hdl *oh)
d_slab_release(eqt->de_pre_read_slab, ev);
active->readahead->dra_ev = NULL;
}
active_ie_decref(dfuse_info, oh->doh_ie);
active_ie_decref(dfuse_info, ie);
Copy link
Contributor

Choose a reason for hiding this comment

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

This code holds a reference on the inode being "active" which itself holds a reference on the inode so it should be safe to access ie here.

pre_read_mark_done(active);
}
Loading