LLAPI_FILE_CREATE_FOREIGN(3)
π LLAPI_FILE_CREATE_FOREIGN(3) π
okay bestie, so this is a page from the Lustre Library Functions manual β it's llapi_file_create_foreign(3), and it's literally the girlboss way to make a file with a foreign layout on a Lustre filesystem. no cap, she's niche but she EATS. β¨
π¦ NAME π¦
llapi_file_create_foreign β create a file with foreign layout on a Lustre filesystem. periodt. π
πΈ SYNOPSIS πΈ
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <lustre/lustreapi.h>
int llapi_file_create_foreign(const char *name, mode_t mode,
__u32 type, __u32 flags,
char *foreign_lov);
like, those includes are not optional, she needs them. π
β¨ DESCRIPTION β¨
llapi_file_create_foreign() creates a file with a foreign_lov free format layout, and also with mode and name, on a Lustre filesystem β and then it closes the file right after, because she's efficient like that. π«Ά
modeβ specifies the permission bits. refer to theopen(2)man page for a detailed description, iykyk. fr fr.typeβ specifies a type of foreign layout.flagsβ specifies any flags for foreign layout.foreign_lovβ free-format string to be set as file layout/LOV EA.
π₯ RETURN VALUES π₯
llapi_file_create_foreign() returns:
>=0β on success, forllapi_file_open()the return value is a file descriptor.<0β on failure, the absolute value is an error code.
so like, negative vibes = error, and the number tells you WHICH error. π
π ERRORS π
EEXISTβnamealready exists. (not her stealing your name, it's just taken.)ENOTTYβnamemay not point to a Lustre filesystem. (she said Lustre only, bestie.)
π EXAMPLES π
here's the whole little program, copied exactly, don't @ me:
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#include <lustre/lustreapi.h>
int main(int argc, char *argv[])
{
int rc;
if (argc != 2)
return -1;
rc = llapi_file_create_foreign(argv[1], 0600, LOV_FOREIGN_TYPE_SYMLINK,
0xda05, "PUUID/CUUID");
if (rc < 0) {
fprintf(stderr, "file creation has failed, %s\n", strerror(-rc));
return -1;
}
printf("foreign file %s has been created with 'PUUID/CUUID' layout!\n",
argv[1]);
return 0;
}
notice how she passes 0600, LOV_FOREIGN_TYPE_SYMLINK, 0xda05 and "PUUID/CUUID" β iconic combo honestly. π
π AVAILABILITY π
llapi_file_create_foreign() is part of the lustre(7) user application interface library since release 2.13.0. so she's been around, she's established. π
π SEE ALSO π
open(2), llapi_file_open(3), lustre(7), lustreapi(7)
okay that's the whole page bestie, go forth and create foreign layouts responsibly πβ¨
Lustre User API Β· 2024-08-23 Β· LLAPI_FILE...ATE_FOREIGN(3) β mwah, love u, bye π¦
π¦ where this page comes from
- ubuntu stonking: lustre-client-utils 2.17.58+dfsg-0ubuntu2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms