llapi_changelog_recv(3)

NAME
llapi_changelog_recv, llapi_changelog_free - Read and free a changelog records

SYNOPSIS
#include <lustre/lustreapi.h>

int llapi_changelog_recv(void *priv, struct changelog_rec **rech);

int llapi_changelog_free(struct changelog_rec **rech);

DESCRIPTION

The function llapi_changelog_recv() allocates and reads the next changelog record rech from the changelog reader instance priv.

The function llapi_changelog_free() releases the allocated record rech.

NOTES
If llapi_changelog_start() initializes priv with CHANGELOG_FLAG_FOLLOW flag, llapi_changelog_recv() can block waiting for new records.

RETURN VALUES

0   On success

1   End of records

-errno
    On failure.

ERRORS

-ENOMEM
    Insufficient memory to complete operation.

-EINVAL
    One or more invalid arguments are given.

-EIO
    Failed to read the changelog record on the MDT.

EXAMPLE
An example can be found for in lfs.c source file. lfs_changelog() implements the following command:
lfs changelog [--follow] MDTNAME [STARTREC [ENDREC]]

SEE ALSO
lfs-changelog(1), llapi_changelog_clear(3), llapi_changelog_get_fd(3), llapi_changelog_in_buf(3), llapi_changelog_start(3), lustreapi(7)