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
few ZAP methods to access by dnode #5464
Conversation
|
@bzzz77, thanks for your PR! By analyzing the history of the files in this pull request, we identified @behlendorf, @ahrens and @nedbass to be potential reviewers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, only style feedback from me. Note that the cstyle tool may be able to catch at least some of these.
| } | ||
| } | ||
| txh = dmu_tx_hold_dnode_impl(tx, os, dn, type, arg1, arg2); | ||
| if (txh && txh->txh_dnode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On illumos, we try to explicitly convert things to boolean, e.g. txh != NULL && txh->txh_dnode != NULL here. Not sure if you do that for ZoL but I find it cleaner.
| (void) dmu_tx_hold_object_impl(tx, os, | ||
| object, THT_NEWOBJECT, 0, 0); | ||
| (void) dmu_tx_hold_dnode_impl(tx, os, | ||
| dn, THT_NEWOBJECT, 0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation's wrong here, should be prev line + 4 spaces
| txh = dmu_tx_hold_dnode_impl(tx, os, dn, type, arg1, arg2); | ||
| if (txh && txh->txh_dnode) | ||
| dnode_rele(txh->txh_dnode, tx); | ||
| return txh; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put parenthesis around return value (txh)
| @@ -1168,6 +1162,38 @@ zap_add(objset_t *os, uint64_t zapobj, const char *key, | |||
| } | |||
| ASSERT(zap == zn->zn_zap); | |||
| zap_name_free(zn); | |||
| return err; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(err)
| int err; | ||
|
|
||
| err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, TRUE, FTAG, &zap); | ||
| if (err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err != 0
| int err; | ||
|
|
||
| err = zap_lockdir_by_dnode(dn, tx, RW_WRITER, TRUE, TRUE, FTAG, &zap); | ||
| if (err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err != 0
| @@ -1288,23 +1314,16 @@ zap_remove(objset_t *os, uint64_t zapobj, const char *name, dmu_tx_t *tx) | |||
| return (zap_remove_norm(os, zapobj, name, MT_EXACT, tx)); | |||
| } | |||
|
|
|||
| int | |||
| zap_remove_norm(objset_t *os, uint64_t zapobj, const char *name, | |||
| int zap_remove_impl(zap_t *zap, const char *name, | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add newline after return type
|
Here's a link to the style warnings from the buildbot. |
|
@bzzz77 |
|
The ztest failures are new and definitely look related to this patch. |
19a183c
to
6df37e9
Compare
|
thanks for the reviews. I've extended the coverage of the patch a bit. not sure though how to refresh the PR to reference the updated patch. the panic Brian reported above should be fixed in the new version. |
|
@bzzz77 please also make the patch is rebased against the very latest master and run |
6df37e9
to
8254657
Compare
|
Brian, I rebased against the latest master, did run make cstyle and tested with ztest locally. then made a forced push. |
|
@bzzz77 due to the very recent 02730c3 commit you'll need to run |
8254657
to
bef8068
Compare
|
@behlendorf, I did like you saied and pushed again.. probably I'm doing something wrong, but I see the changes committed, including zap_add_impl() taking 'tag' as a parameter - this was missed in the initial patch and caused panic in zloop testing. |
|
Almost there. There updated PR just includes an extra patch which is already part of master. So just rebase on the latest master and force update the PR. Before pushing you'll want to fix this warning in |
bef8068
to
c15b3ce
Compare
|
thanks, I'm updating the patch.. |
c15b3ce
to
3d6f26b
Compare
That could work to get us most of the benefit with less code change. Obviously it doesn't help for |
|
sure, I can develop a proto. |
|
in my benchmarks I see that lookup-in-tx approach is ~0.5% slower compared to direct by-dnode. so i guess it's better to leave the patch as is. |
3d6f26b
to
3500a14
Compare
|
@bzzz77 did you mean to close this? From your comment above it sounds like the direct by-dnode patch is the way to go. |
|
direct by-dnode is what this patch is doing - few methods added like zap_add_by_dnode(), etc. so I'd rather like to see it landed when possible :) |
|
Right, then let's get this reviewed and merged. Can you reopen this PR, rebase the latest version of the patch against master and force update the branch on Github. |
Authored by: Alexey Zhuralev alexey@udm.ru