| LLAPI_UNLINK_FOREIGN(3) | Lustre Library Functions | LLAPI_UNLINK_FOREIGN(3) |
NAME
llapi_unlink_foreign - unlink file/dir with foreign layout on a Lustre filesystem
SYNOPSIS
#include <lustre/lustreapi.h>
int llapi_unlink_foreign(char *name);
DESCRIPTION
llapi_unlink_foreign() will allow to unlink a file/dir of name with foreign LOV/LMV, that would be prevented to be using regular unlink/rmdir command/syscall. It also works for regular file/dir.
RETURN VALUES
llapi_unlink_foreign() return:
- =0
- on success.
- <0
- on failure, the absolute value is an error code.
ERRORS
EXAMPLES
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <lustre/lustreapi.h>
int main(int argc, char **argv)
{
char *foreign = NULL;
int c, rc;
while ((c = getopt(argc, argv, "hf:")) != -1) {
switch (c) {
case 'f':
foreign = optarg;
break;
case 'h':
default:
fprintf(stderr,
"Usage: %s [-f <foreign file/dir pathname>]0,
argv[0]);
exit(0);
break;
}
}
if (foreign == NULL) {
fprintf(stderr, "a foreign file/dir pathname must be provided0);
exit(0);
}
rc = llapi_unlink_foreign(foreign);
if (rc < 0)
fprintf(stderr, "llapi_unlink_foreign() error: %d0, rc);
return rc;
}
AVAILABILITY
llapi_unlink_foreign() is part of the lustre(7) user application interface library since release 2.9.0
SEE ALSO
| 2024-08-28 | Lustre User API |