Details
Description
With "lctl changelog_register" (and "llapi_changelog_register" to be added in LU-19276) a changelog user can be created with a mask that indicates which changelog record types should be recorded to the Changelog. If there are multiple changelog users registered, then the Changelog will record the union of those user masks. This reduces the number of records that are recorded in the Changelog to the minimum set that are needed for all of the currently registered users.
However, llapi_changelog_start()+llapi_changelog_recv(), or "lfs changelog", do not take the changelog user/mask into account when returning changelog records. If multiple users are registered with different masks, then the llapi_changelog_recv() will see all of the records in the Changelog instead of only the ones that it was registered for.
It would be better to add a new variant of llapi_changelog_start() (e.g. llapi_changelog_start_user()) that accepts the changelog user as an argument, and optionally the changelog record mask, and automatically filter the returned changelog records based on the record mask for that user.
It would also be better if llapi_changelog_start_user() started log processing at the last record specified for the named changelog user rather than at the oldest record if no startrec argument is supplied.
A new llapi_changelog_clear_user() interface should be added that takes the opaque changelog handle from llapi_changelog_start_user() so that the application does not need to specify the user each time.