llapi_layout_comp_add(3)

NAME
llapi_layout_comp_add, llapi_layout_comp_del - add or delete a layout component into/from the layout.

SYNOPSIS
#include <lustre/lustreapi.h>

int llapi_layout_comp_add(struct llapi_layout *layout,
                          struct llapi_layout *comp);

int llapi_layout_comp_del(struct llapi_layout *layout,
                          struct llapi_layout *comp);

DESCRIPTION

A composite layout is made of several layout components.

llapi_layout_comp_add(3) adds the layout component comp into the existing in-memory layout under construction, and comp is freed. The layout will be turned into composite if it was plain before adding. All layout attributes of comp will be inherited from the layout, unless otherwise specified for this component by llapi_layout_*_set(3) functions.

llapi_layout_comp_del(3) deletes the layout component comp from the in-memory layout, but does not delete the component from an existing file layout on the MDT.

RETURN VALUES
llapi_layout_comp_add() and llapi_layout_comp_del() return 0 on success, or -1 if an error occurred (in which case, errno is set appropriately).

ERRORS

EINVAL
    An invalid argument was specified.

SEE ALSO
llapi_layout_alloc(3), llapi_layout_free(3), llapi_layout_file_open(3), llapi_layout_file_comp_add(3), llapi_layout_file_comp_del(3), llapi_layout(7), lustreapi(7)