LLAPI\_CHANGELOG\_CLEAR(3) Lustre Library Functions LLAPI\_CHANGELOG\_CLEAR(3)

# [NAME](#NAME)

llapi\_changelog\_clear - Clear changelog records for a changelog consumer

# [SYNOPSIS](#SYNOPSIS)

```
#include <lustre/lustreapi.h>
```

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

# [DESCRIPTION](#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-changelog\_register**(8)](/man/enterprise-packages/lustre/lctl-changelog_register.8).

# [RETURN VALUES](#RETURN_VALUES)

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

# [ERRORS](#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](#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](#AVAILABILITY)

**llapi\_changelog\_clear()** is part of the [**lustre**(7)](/man/enterprise-packages/lustre/lustre.7) user application interface library since release 2.0.0.

# [SEE ALSO](#SEE_ALSO)

[**lfs-changelog\_clear**(1)](/man/enterprise-packages/lustre/lfs-changelog_clear.1), [**llapi\_changelog\_deregister**(3)](/man/enterprise-packages/lustre/llapi_changelog_deregister.3), [**llapi\_changelog\_get\_fd**(3)](/man/enterprise-packages/lustre/llapi_changelog_get_fd.3), [**llapi\_changelog\_in\_buf**(3)](/man/enterprise-packages/lustre/llapi_changelog_in_buf.3), [**llapi\_changelog\_recv**(3)](/man/enterprise-packages/lustre/llapi_changelog_recv.3), [**llapi\_changelog\_register**(3)](/man/enterprise-packages/lustre/llapi_changelog_register.3), [**llapi\_changelog\_start**(3)](/man/enterprise-packages/lustre/llapi_changelog_start.3), [**llapi\_changelog\_start\_user**(3)](/man/enterprise-packages/lustre/llapi_changelog_start_user.3), [**lustreapi**(7)](/man/enterprise-packages/lustre/lustreapi.7)

2026-09-12 Lustre User API

---

Document: llapi_changelog_clear(3) from lustre 2.17.60-r0 (Chainguard OS)
Source: https://github.com/lustre/lustre-release
