| LLAPI_CHANGELOG_CLEAR(3) | Lustre Library Functions | 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 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 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
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);
AVAILABILITY
llapi_changelog_clear() is part of the lustre(7) user application interface library since release 2.0.0.
SEE ALSO
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 |