From: Nathaniel Clark Date: Wed, 28 May 2014 15:32:43 +0000 (-0400) Subject: LU-5102 utils: Look for modules in $LUSTRE/utils/.libs X-Git-Tag: 2.5.60~21 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=47cde804ddc9019ff0793229030211d536d0612f LU-5102 utils: Look for modules in $LUSTRE/utils/.libs This allows locally built lustre utils to look for files outside of the normal libdir location, and thus be tested without a full install. Signed-off-by: Nathaniel Clark Change-Id: I0f3c3446ddc9aed3cf494c597f4c0a4c432478de Reviewed-on: http://review.whamcloud.com/10468 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: wangdi Reviewed-by: Oleg Drokin --- diff --git a/lustre/utils/mount_utils.c b/lustre/utils/mount_utils.c index bb83f45..8054b07 100644 --- a/lustre/utils/mount_utils.c +++ b/lustre/utils/mount_utils.c @@ -459,8 +459,23 @@ struct module_backfs_ops *load_backfs_module(enum ldd_mount_type mount_type) snprintf(filename, sizeof(filename), PLUGIN_DIR"/mount_%s.so", fsname); handle = dlopen(filename, RTLD_LAZY); + + /* Check for $LUSTRE environment variable from test-framework. + * This allows using locally built modules to be used. + */ + if (handle == NULL) { + char *dirname; + dirname = getenv("LUSTRE"); + if (dirname) { + snprintf(filename, sizeof(filename), + "%s/utils/.libs/mount_%s.so", + dirname, fsname); + handle = dlopen(filename, RTLD_LAZY); + } + } + + /* Do not clutter up console with missing types */ if (handle == NULL) - /* Do not clutter up console with missing types */ return NULL; ops = malloc(sizeof(*ops));