OS Manuals

llapi_changelog_clear(3)

llapi_changelog_clear - Clear changelog records for a changelog consumer

LLAPI_CHANGELOG_CLEAR(3) Lustre Library Functions LLAPI_CHANGELOG_CLEAR(3)

llapi_changelog_clear - Clear changelog records for a changelog consumer

#include <lustre/lustreapi.h>
int llapi_changelog_clear(const char *mdtname, const char *idstr,
                          long long endrec);

The function llapi_changelog_clear() indicates that changelog records previous to endrec are no longer of interest to a particular consumer idstr , potentially allowing the MDT mdtname (e.g: "lustrefs-MDT0000") to free up disk space by freeing old records if no other changelog consumers still need to process them.

An endrec of 0 indicates the current last record.

Changelog consumers must be registered on the MDT node using:
lctl --device MDT_NAME changelog_register

Return the file descriptor on success or a negative errno value on failure.

-EINVAL
One or more invalid arguments are given.
-ENOENT
MDT's changelog char device or changelog user not found.
-ENOPERM
Not enough permissions to open the changelog char device. By default, the device is only accessible to the root user.

To clear the changelog for a specific consumer ID:


char *mdtname = "testfs-MDT0000";
char *idstr = "cl2-dirwatch";
long long end_record = 12345678;
rc = llapi_changelog_clear(mdtname, idstr, end_record);

llapi_changelog_clear() is part of the lustre(7) user application interface library since release 2.0.0.

lfs-changelog_clear(1), llapi_changelog_get_fd(3), llapi_changelog_in_buf(3), llapi_changelog_recv(3), llapi_changelog_start(3), llapi_changelog_start_user(3), lustreapi(7), lctl-changelog_register(8)

2024-08-22 Lustre User API

lustre 2.17.59-r1 · enterprise-packages · ingested 2026-10-02