LLAPI_LAYOUT_ALLOC(3)

NAME
llapi_layout_alloc, llapi_layout_free - allocate and destroy struct llapi_layout objects.

SYNOPSIS
#include <lustre/lustreapi.h>

struct llapi_layout *llapi_layout_alloc(void);

void llapi_layout_free(struct llapi_layout *layout);

DESCRIPTION
llapi_layout_alloc() returns a pointer to a newly-allocated struct llapi_layout. The struct llapi_layout is an opaque entity containing the layout information for a file in a Lustre filesystem. Its internal structure should not be directly accessed by an application. It may be used in subsequent calls to the functions referenced in the llapi_layout(7) manual page to modify layout attributes and create files with the given layout.

The returned struct llapi_layout object is initialized with default attribute values that will affect the standard Lustre behavior for assigning layouts to newly-created files. These values may be modified using the group of functions in struct llapi_layout API whose names end with _set. The pointer should be freed with llapi_layout_free() when it is no longer needed.

llapi_layout_free() frees the memory associated with layout.

RETURN VALUES
llapi_layout_alloc() returns a valid pointer on success or NULL on failure with errno set to an approporiate error code.

llapi_layout_free() returns no value.

ERRORS

ENOMEM
    Insufficient storage space is available.

AVAILABILITY
llapi_layout_alloc() and llapi_layout_free() are part of the lustre(7) user application interface library since release 2.7.0.

SEE ALSO
llapi_layout_file_create(3), llapi_layout(7), lustreapi(7)