From: Matthew Mondor Date: Thu, 1 Mar 2007 11:18:01 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: pgsql-branch-merge~6 X-Git-Url: http://git.pulsar-zone.net/?a=commitdiff_plain;h=fc9afc20105b1d9ffece1afaa6981fffa672cfb4;p=mmondor.git *** empty log message *** --- diff --git a/tests/rlookup/main.c b/tests/rlookup/main.c index 850b67b..7e96976 100644 --- a/tests/rlookup/main.c +++ b/tests/rlookup/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.1 2007/03/01 03:51:20 mmondor Exp $ */ +/* $Id: main.c,v 1.2 2007/03/01 11:18:01 mmondor Exp $ */ /* * Copyright (c) 2007, Matthew Mondor @@ -19,6 +19,10 @@ +#define PATH "/nfs/hal/usr/pkgsrc" + + + int main(void); @@ -26,20 +30,36 @@ int main(void); int main(void) { + unsigned long long l1, l2; + int i; (void) printf("Initializing\n"); if (rlc_init() == -1) exit(EXIT_FAILURE); (void) printf("Adding\n"); - if (rlc_device_add("/nfs/hal/usr/pkgsrc") == -1) + if (rlc_device_add(PATH) == -1) exit(EXIT_FAILURE); - (void) printf("Sleeping\n"); - sleep(60); + (void) printf("Query testing\n"); + while ((i = scanf("%llu,%llu", &l1, &l2)) != EOF) { + rlc_results_t *r; + + if (i != 2) { + (void) printf("Format: dev_t, ino_t\n"); + (void) fpurge(stdin); + continue; + } + if ((r = rlc_lookup((dev_t)l1, (ino_t)l2)) != NULL) { + for (i = 0; i < r->results; i++) + (void) printf(" -> %s\n", r->result[i]); + rlc_free_results(r); + } else + (void) printf("No match\n"); + } (void) printf("Removing\n"); - if (rlc_device_rem("/nfs/hal/usr/pkgsrc") == -1) + if (rlc_device_rem(PATH) == -1) exit(EXIT_FAILURE); (void) printf("Done, exiting\n"); diff --git a/tests/rlookup/rlc.c b/tests/rlookup/rlc.c index 7344eba..83e1a61 100644 --- a/tests/rlookup/rlc.c +++ b/tests/rlookup/rlc.c @@ -1,4 +1,4 @@ -/* $Id: rlc.c,v 1.1 2007/03/01 03:51:20 mmondor Exp $ */ +/* $Id: rlc.c,v 1.2 2007/03/01 11:18:01 mmondor Exp $ */ /* * Copyright (c) 2007, Matthew Mondor @@ -527,6 +527,9 @@ rlc_device_add(const char *mp) sizeof(dev_t), FALSE)) goto err; + /* XXX */ (void) printf("Added device: %llu (%llu entries)\n", + (unsigned long long)dev, + (unsigned long long)HASHTABLE_NODES(&dn->inode_table)); return 0; err: