From: phil Date: Thu, 27 Nov 2003 06:31:33 +0000 (+0000) Subject: Slightly less obvious, but still very innocent, parts of b_eq: X-Git-Tag: v1_7_0_51~2^9~130 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=a5a022eb00f2d684b9d8f5deb51f7e2e46105c0f;p=fs%2Flustre-release.git Slightly less obvious, but still very innocent, parts of b_eq: - code or includes in the main build, but contained in #if __KERNEL__ - userspace-only portals code - very few and minor other changes, such as renaming a function --- diff --git a/lustre/lvfs/lvfs_userfs.c b/lustre/lvfs/lvfs_userfs.c new file mode 100644 index 0000000..021a0a3 --- /dev/null +++ b/lustre/lvfs/lvfs_userfs.c @@ -0,0 +1,44 @@ +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- + * vim:expandtab:shiftwidth=8:tabstop=8: + * + * lustre/lib/fsfilt_ext3.c + * Lustre filesystem abstraction routines + * + * Copyright (C) 2002, 2003 Cluster File Systems, Inc. + * Author: Andreas Dilger + * + * This file is part of Lustre, http://www.lustre.org. + * + * Lustre is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * Lustre is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Lustre; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include "lvfs_internal.h" + +#include +#include + +/* XXX currently ctxt functions should not be used ?? */ +void push_ctxt(struct obd_run_ctxt *save, struct obd_run_ctxt *new_ctx, + struct obd_ucred *uc) +{ + LBUG(); +} + +void pop_ctxt(struct obd_run_ctxt *saved, struct obd_run_ctxt *new_ctx, + struct obd_ucred *uc) +{ + LBUG(); +} diff --git a/lustre/mdc/mdc_locks.c b/lustre/mdc/mdc_locks.c index 91e6a77..8fbe9b7 100644 --- a/lustre/mdc/mdc_locks.c +++ b/lustre/mdc/mdc_locks.c @@ -135,7 +135,7 @@ void mdc_set_lock_data(__u64 *l, void *data) LASSERT(lock != NULL); l_lock(&lock->l_resource->lr_namespace->ns_lock); -#if !defined(LIBLUSTRE) +#ifdef __KERNEL__ if (lock->l_ast_data && lock->l_ast_data != data) { struct inode *new_inode = data; struct inode *old_inode = lock->l_ast_data; diff --git a/lustre/ptlrpc/ptlrpc_internal.h b/lustre/ptlrpc/ptlrpc_internal.h index 39ffd57..7ec654c 100644 --- a/lustre/ptlrpc/ptlrpc_internal.h +++ b/lustre/ptlrpc/ptlrpc_internal.h @@ -37,10 +37,19 @@ void ptlrpc_daemonize(void); void ptlrpc_request_handle_notconn(struct ptlrpc_request *); void lustre_assert_wire_constants(void); +#ifdef __KERNEL__ void ptlrpc_lprocfs_register_service(struct proc_dir_entry *proc_entry, struct ptlrpc_service *svc); void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc); void ptlrpc_lprocfs_rpc_sent(struct ptlrpc_request *req); +void ptlrpc_lprocfs_do_request_stat (struct ptlrpc_request *req, + long q_usec, long work_usec); +#else +#define ptlrpc_lprocfs_register_service(params...) do{}while(0) +#define ptlrpc_lprocfs_unregister_service(params...) do{}while(0) +#define ptlrpc_lprocfs_rpc_sent(params...) do{}while(0) +#define ptlrpc_lprocfs_do_request_stat(params...) do{}while(0) +#endif /* __KERNEL__ */ /* recovd_thread.c */ int llog_init_commit_master(void); diff --git a/lustre/ptlrpc/ptlrpc_module.c b/lustre/ptlrpc/ptlrpc_module.c index a7d537e..1eeb264 100644 --- a/lustre/ptlrpc/ptlrpc_module.c +++ b/lustre/ptlrpc/ptlrpc_module.c @@ -63,6 +63,7 @@ __init int ptlrpc_init(void) RETURN(0); } +#ifdef __KERNEL__ static void __exit ptlrpc_exit(void) { ldlm_exit(); @@ -197,7 +198,6 @@ EXPORT_SYMBOL(llog_origin_handle_read_header); EXPORT_SYMBOL(llog_origin_handle_close); EXPORT_SYMBOL(llog_client_ops); -#ifdef __KERNEL__ MODULE_AUTHOR("Cluster File Systems, Inc. "); MODULE_DESCRIPTION("Lustre Request Processor and Lock Management"); MODULE_LICENSE("GPL"); diff --git a/lustre/tests/liblustre_sanity_uml.sh b/lustre/tests/liblustre_sanity_uml.sh new file mode 100644 index 0000000..9ba1798 --- /dev/null +++ b/lustre/tests/liblustre_sanity_uml.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +# liblustre sanity test. specially written for UML for now + +LCONF=${LCONF:-../utils/lconf} + +LLIP=127.0.0.1 + +LTREE_KERNEL=${LTREE_KERNEL:-../../lustre} +LTREE_USER=${LTREE_USER:-../../lustre-lib} + +# checking +if [ ! -e $LTREE_KERNEL ]; then + echo "$LTREE_KERNEL dosen't exits" + exit 1 +fi + +if [ ! -e $LTREE_USER ]; then + echo "$LTREE_USER dosen't exits" + exit 1 +fi + +if [ ! -e $LTREE_USER/liblustre/lltest ]; then + echo "$LTREE_USER/liblustre/lltest dosen't exits" + exit 1 +fi + +workdir=`pwd` + +cleanup() +{ + curdir=`pwd` + cd $LTREE_KERNEL/tests + $LCONF --node localhost --cleanup --force $LTREE_USER/tests/$configfile 2>&1 > /dev/null + cd $curdir +} + +configfile=liblustre_sanity_uml.xml + +# generate config file +rm -f $configfile +MDSNODE=localhost OSTNODES=localhost CLIENTS=$LLIP sh uml.sh $configfile +if [ ! -e $configfile ]; then + echo "fail to generate config file $configfile" + exit 1 +fi + +# generate dump file +rm -f /tmp/DUMP_FILE +$LCONF --lctl_dump /tmp/DUMP_FILE --node $LLIP $configfile +if [ ! -e /tmp/DUMP_FILE ]; then + echo "error creating dumpfile" + exit 1 +fi + +#setup lustre server +cd $LTREE_KERNEL/tests +$LCONF --node localhost --reformat $LTREE_USER/tests/$configfile +rc=$? +if [ $rc -ne 0 ]; then + echo "setup lustre server: error $rc" + cleanup + exit 1 +fi +cd $workdir + +#do liblustre testing +$LTREE_USER/liblustre/lltest +rc=$? +if [ $rc -ne 0 ]; then + echo "liblustre test error $rc" + cleanup + exit 1 +fi + +echo "===== liblustre sanity test complete sucessfully =====" + +echo -n "===== cleanup... "; cleanup; echo "done =====" + +cd $workdir + +exit 0