11 #include <lustre/lustreapi.h>
13 int main(int argc, char **argv)
15 char *dir = "foreign_dir", *end;
16 char *xval = "UUID@UUID";
18 __u32 type = LU_FOREIGN_TYPE_SYMLINK, flags = 0xda05;
21 while ((c = getopt(argc, argv, "hd:f:m:t:x:")) != -1) {
30 mode = strtoul(optarg, &end, 8);
33 "%s: invalid mode '%s'\n", argv[0],
40 flags = strtoul(optarg, &end, 0);
41 if (errno != 0 || *end != '\0' ||
42 flags >= UINT32_MAX) {
44 "%s: invalid flags '%s'\n", argv[0],
50 type = strtoul(optarg, &end, 0);
53 "%s: invalid type '%s'\n", argv[0],
61 "Usage: %s [-d <dirname>] [-m <octalmode>] [-x <LOV EA content>] [-t <type>] [-f <hexflags>]\n",
68 rc = llapi_dir_create_foreign(dir, mode, type, flags, xval);
70 fprintf(stderr, "llapi_dir_create_foreign() error : %d\n", rc);