Skip to content

log_fcb: optimize log_fcb_copy #3414

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kasjer
Copy link
Contributor

@kasjer kasjer commented Apr 25, 2025

Local function log_fcb_copy() did not use information about start location that was already available.
Function log_fcb_rtr_erase() found first element to copy and then used only part of what wa returned.
In turn log_fcb_copy() walk log again skipping entries.

It would not work correctly if more then on sector was used for source fcb and requested number of
preserved entries span more then one sector.

Code is shorter, faster and uses less stack

Local function log_fcb_copy() did not use information
about start location that was already available.
Function log_fcb_rtr_erase() found first element to
copy and then used only part of what wa returned.
In turn log_fcb_copy() walk log again skipping
entries.

It would not work correctly if more then on sector
was used for source fcb and requested number of
preserved entries span more then one sector.

Signed-off-by: Jerzy Kasenberg <[email protected]>
Copy link
Contributor

@vrahane vrahane left a comment

Choose a reason for hiding this comment

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

LGTM, pretty straight-forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants