llapi_changelog_clear(3)

NAME
llapi_changelog_clear - Clear changelog records for a changelog consumer

SYNOPSIS
#include <lustre/lustreapi.h>

int llapi_changelog_clear(const char *mdtname, const char *idstr,
                          long long endrec);

DESCRIPTION

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.

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 VALUES

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

ERRORS

-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.

EXAMPLE
An example can be found for in lfs.c source file. lfs_changelog_clear implements the following command:
lfs changelog_clear MDTNAME ID ENDREC

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