Skip to content

Commit

Permalink
[feat]curvefs/client:support warmup sym link
Browse files Browse the repository at this point in the history
add feat support symlink by fuseOpReadLink

Signed-off-by: Cyber-SiKu <[email protected]>
  • Loading branch information
Cyber-SiKu committed Sep 12, 2023
1 parent a844674 commit 9f3b825
Show file tree
Hide file tree
Showing 5 changed files with 2,264 additions and 270 deletions.
2 changes: 1 addition & 1 deletion curvefs/src/client/fuse_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,6 @@ CURVEFS_ERROR FuseClient::FuseOpLink(fuse_req_t req,
CURVEFS_ERROR FuseClient::FuseOpReadLink(fuse_req_t req, fuse_ino_t ino,
std::string *linkStr) {
(void)req;
VLOG(1) << "FuseOpReadLink, ino: " << ino << ", linkStr: " << linkStr;
InodeAttr attr;
CURVEFS_ERROR ret = inodeManager_->GetInodeAttr(ino, &attr);
if (ret != CURVEFS_ERROR::OK) {
Expand All @@ -1304,6 +1303,7 @@ CURVEFS_ERROR FuseClient::FuseOpReadLink(fuse_req_t req, fuse_ino_t ino,
return ret;
}
*linkStr = attr.symlink();
VLOG(1) << "FuseOpReadLink, ino: " << ino << ", linkStr: " << *linkStr;
return CURVEFS_ERROR::OK;
}

Expand Down
6 changes: 5 additions & 1 deletion curvefs/src/client/fuse_s3_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,13 @@ class FuseS3Client : public FuseClient {
char *buffer, size_t *rSize) {
return FuseOpRead(req, ino, size, off, fi, buffer, rSize);
};
auto readLinkFunc = [this](fuse_req_t req, fuse_ino_t ino,
std::string *linkStr) {
return FuseClient::FuseOpReadLink(req, ino, linkStr);
};
warmupManager_ = std::make_shared<warmup::WarmupManagerS3Impl>(
metaClient_, inodeManager_, dentryManager_, fsInfo_, readFunc,
s3Adaptor_, nullptr);
readLinkFunc, nullptr, s3Adaptor_);
}

FuseS3Client(const std::shared_ptr<MdsClient> &mdsClient,
Expand Down
Loading

0 comments on commit 9f3b825

Please sign in to comment.