From eae1bba94f94877c9ae3749000dafa315dfe345e Mon Sep 17 00:00:00 2001 From: shaver Date: Sat, 14 Dec 2002 23:09:31 +0000 Subject: [PATCH] Updating from HEAD, in preparation for landing. --- lustre/obdecho/echo_client.c | 4 +++- lustre/scripts/lustre | 28 +++++++++++++++++++++++----- lustre/tests/fsx.c | 23 ++++++++++++++++++++++- 3 files changed, 48 insertions(+), 7 deletions(-) diff --git a/lustre/obdecho/echo_client.c b/lustre/obdecho/echo_client.c index 4ccc043..3d2f222 100644 --- a/lustre/obdecho/echo_client.c +++ b/lustre/obdecho/echo_client.c @@ -57,8 +57,10 @@ static int echo_iocontrol(unsigned int cmd, struct lustre_handle *obdconn, int l case OBD_IOC_CREATE: { struct lov_stripe_md *tmp_lsm = NULL; rc = obd_create(&ec->conn, &data->ioc_obdo1, &tmp_lsm); - if (lsm) + if (lsm && tmp_lsm ) { memcpy(lsm, tmp_lsm, sizeof(*tmp_lsm)); + data->ioc_conn2 = 1; + } GOTO(out, rc); } diff --git a/lustre/scripts/lustre b/lustre/scripts/lustre index b62dc4c..95c1d06 100755 --- a/lustre/scripts/lustre +++ b/lustre/scripts/lustre @@ -35,19 +35,37 @@ fi [ -x ${LCONF} -a -f ${LUSTRE_CONFIG_XML} ] || exit 0 +# Create /var/lustre directory +# This is used by snmp agent for checking lustre services \ +# status online/offline/online pending/offline pending. + +[ -d ${STATUS_DIR:=/var/lustre} ] || mkdir -p $STATUS_DIR +STATUS=${STATUS_DIR}/sysStatus + start() { echo -n "Starting $SERVICE: " - ${LCONF} ${LCONF_START_ARGS} + ${LCONF} ${LCONF_START_ARGS} RETVAL=$? echo $SERVICE - [ $RETVAL -eq 0 ] && touch $LOCK + if [ $RETVAL -eq 0 ]; then + touch $LOCK + echo "online" >$STATUS + else + echo "online pending" >$STATUS + fi } stop() { echo -n "Shutting down $SERVICE: " - ${LCONF} ${LCONF_STOP_ARGS} - echo $SERVICE - rm -f $LOCK + ${LCONF} ${LCONF_STOP_ARGS} + RETVAL=$? + echo $SERVICE + rm -f $LOCK + if [ $RETVAL -eq 0 ]; then + echo "offline" >$STATUS + else + echo "offline pending" >$STATUS + fi } restart() { diff --git a/lustre/tests/fsx.c b/lustre/tests/fsx.c index aba33d5..859f40a 100644 --- a/lustre/tests/fsx.c +++ b/lustre/tests/fsx.c @@ -532,6 +532,13 @@ domapread(unsigned offset, unsigned size) prterr("domapread: mmap"); report_failure(190); } + if (!quiet && (debug > 1 && + (monitorstart == -1 || + (offset + size > monitorstart && + (monitorend == -1 || offset <= monitorend))))) { + gettimeofday(&t, NULL); + prt(" %lu.%06lu mmap done\n", t.tv_sec, t.tv_usec); + } memcpy(temp_buf, p + pg_offset, size); if (!quiet && (debug > 1 && (monitorstart == -1 || @@ -683,6 +690,13 @@ domapwrite(unsigned offset, unsigned size) prterr("domapwrite: ftruncate"); exit(201); } + if (!quiet && (debug > 1 && + (monitorstart == -1 || + (offset + size > monitorstart && + (monitorend == -1 || offset <= monitorend))))) { + gettimeofday(&t, NULL); + prt(" %lu.%06lu truncate done\n", t.tv_sec, t.tv_usec); + } } pg_offset = offset & page_mask; map_size = pg_offset + size; @@ -693,6 +707,13 @@ domapwrite(unsigned offset, unsigned size) prterr("domapwrite: mmap"); report_failure(202); } + if (!quiet && (debug > 1 && + (monitorstart == -1 || + (offset + size > monitorstart && + (monitorend == -1 || offset <= monitorend))))) { + gettimeofday(&t, NULL); + prt(" %lu.%06lu mmap done\n", t.tv_sec, t.tv_usec); + } memcpy(p + pg_offset, good_buf + offset, size); if (!quiet && (debug > 1 && (monitorstart == -1 || @@ -821,7 +842,7 @@ docloseopen(void) } if (!quiet && debug > 1) { gettimeofday(&t, NULL); - prt(" %lu.%06lu opendone\n", t.tv_sec, t.tv_usec); + prt(" %lu.%06lu open done\n", t.tv_sec, t.tv_usec); } } -- 1.8.3.1