Skip to content

Commit 967eb16

Browse files
committed
add hello world lustre plugin
1 parent 96761fd commit 967eb16

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

contrib/lustre_plugin.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include <stdio.h>
2+
3+
void process_dir(char *path) {
4+
printf("Hello from lustre dir plugin: %s\n", path);
5+
}
6+
7+
void process_file(char *path) {
8+
printf("Hello from lustre file plugin: %s\n", path);
9+
}

src/gufi_dir2index.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ static int process_nondir(struct work *entry, struct entry_data *ed, void *args)
143143
}
144144
}
145145

146+
if (in->plugin_ops.process_file) {
147+
in->plugin_ops.process_file(entry->name);
148+
}
149+
146150
if (in->process_xattrs) {
147151
insertdbgo_xattrs(in, &nda->ed.statuso, entry, ed,
148152
&nda->xattr_db_list, nda->temp_xattr,
@@ -271,6 +275,10 @@ static int processdir(QPTPool_t *ctx, const size_t id, void *data, void *args) {
271275
startdb(nda.db);
272276
}
273277

278+
if (pa->in.plugin_ops.process_dir) {
279+
pa->in.plugin_ops.process_dir(nda.work->name);
280+
}
281+
274282
struct descend_counters ctrs;
275283
descend(ctx, id, pa, nda.in, nda.work, nda.ed.statuso.st_ino, dir, 0,
276284
processdir, process_nondir, &nda,

0 commit comments

Comments
 (0)