llapi_heat_get(3)

NAME
llapi_heat_get, llapi_heat_set - get and clear heat for a file

SYNOPSIS
#include <lustre/lustreapi.h>

int llapi_heat_get(int fd, struct lu_heat *heat);
int llapi_heat_set(int fd, __u64 flags);

DESCRIPTION

The function llapi_heat_get() returns file access frequency information on the file descriptor fd. Information is returned in the heat argument which should already be allocated, which is a lu_heat data structure, which contains the following fields:

struct lu_heat {
	__u32 lh_heat_count;
	__u32 lh_padding1;
	__u64 lh_heat[0];
};
The function llapi_heat_set() mainly clears the heat information on the file descriptor fd according to the parameter flags which gives options for file heat, currently one of:

LU_HEAT_FLAG_CLEAR
    Clear the heat information for a given file.

LU_HEAT_FLAG_OFF
    Turn off the file heat support for a given file.

RETURN VALUES

llapi_heat_get() and llapi_heat_set() return 0 on success or a negative errno value on failure.

ERRORS

-ENOMEM
    Insufficient memory to complete operation.

-EFAULT
    Memory region is not properly mapped.

-EINVAL
    One or more invalid arguments are given.

EOPNOTSUPP
    File heat operation is not supported.

SEE ALSO
lustreapi(7)