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

librbd: don't read metadata twice on image open #18542

Merged
merged 1 commit into from Oct 27, 2017

Conversation

trociny
Copy link
Contributor

@trociny trociny commented Oct 25, 2017

After adding get_metadata to RefreshRequest it has become redundant
in OpenRequest.

Signed-off-by: Mykola Golub to.my.trociny@gmail.com

@@ -274,6 +274,11 @@ struct C_InvalidateCache : public Context {
trace_endpoint.copy_name(pname);
perf_start(pname);

assert(image_watcher == NULL);
image_watcher = new ImageWatcher<>(*this);

Choose a reason for hiding this comment

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

Any reason why the ImageWatcher needs to be constructed prior to the refresh state machine? I grepped and didn't immediately see it being referenced (except for the change below to determine if it's safe to apply metadata string overrides).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In refresh we create exclusive lock, and it (ManagedLock) references the watcher.

Choose a reason for hiding this comment

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

Ack -- thanks

image_watcher = new ImageWatcher<>(*this);
}

void ImageCtx::post_init() {

Choose a reason for hiding this comment

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

Nit: perhaps rename to init_cache since it is for the cache and readahead (which technically requires the cache)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dillaman updated

After adding get_metadata to RefreshRequest it has become redundant
in OpenRequest.

Signed-off-by: Mykola Golub <to.my.trociny@gmail.com>
Copy link

@dillaman dillaman left a comment

Choose a reason for hiding this comment

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

lgtm

@yuriw
Copy link
Contributor

yuriw commented Oct 26, 2017

@yuriw yuriw merged commit 20cc43f into ceph:master Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants