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

Remove specified entry from ZAP directly without lookup internally #6948

Closed
Nasf-Fan opened this issue Dec 12, 2017 · 3 comments
Closed

Remove specified entry from ZAP directly without lookup internally #6948

Nasf-Fan opened this issue Dec 12, 2017 · 3 comments
Labels
Status: Stale No recent activity for issue

Comments

@Nasf-Fan
Copy link
Contributor

Currently, zap_remove()/zap_remove_by_dnode() needs to lookup the specified index (or name) to locate the entry internally with the directory locked, then remove the found entry. In fact, for most of cases, the caller has already performed lookup before calling zap_remove()/zap_remove_by_dnode(). But related lookup result cannot be used by the zap_remove()/zap_remove_by_dnode().

I am wondering whether or not we can extend related API (and locks) to allow lookup the entry outside and directly use the lookup result for removing, that will save some lookup overhead. That will improve unlink/delete performance, especially for large directory.

@bzzz77
Copy link
Contributor

bzzz77 commented Dec 12, 2017

another option - zap_remove_and_return() returning value

@behlendorf
Copy link
Contributor

I like @bzzz77's suggestion which would fit nicely in to the existing interface, although I'd suggest naming it zap_lookup_and remove().

@stale
Copy link

stale bot commented Aug 25, 2020

This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale No recent activity for issue label Aug 25, 2020
@stale stale bot closed this as completed Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale No recent activity for issue
Projects
None yet
Development

No branches or pull requests

3 participants