Whamcloud - gitweb
Merged from HEAD on 12/11/2002.
authorthantry <thantry>
Wed, 11 Dec 2002 18:59:18 +0000 (18:59 +0000)
committerthantry <thantry>
Wed, 11 Dec 2002 18:59:18 +0000 (18:59 +0000)
lustre/scripts/version_tag.pl
lustre/tests/llmount2-hack.sh
lustre/tests/setuid.c [deleted file]
lustre/utils/lfind.c

index e810f3f..a92fef4 100644 (file)
@@ -135,7 +135,8 @@ sub generate_ver($$$)
       localtime($mtime);
     $year += 1900;
     $mon++;
-    my $show_last = $year . $mon . $mday . $hour . $min . $sec;
+    my $show_last = sprintf("%04d%02d%02d%02d%02d%02d", $year, $mon, $mday,
+                            $hour, $min, $sec);
 
     print "#define BUILD_VERSION \"";
     if ($pristine) {
index d17805a..495626c 100644 (file)
@@ -2,16 +2,11 @@
 # suggested boilerplate for test script
 
 LCONF=${LCONF:-../utils/lconf}
-NAME=${NAME:-local2}
+NAME=${NAME:-local2-hack}
 
 config=$NAME.xml
-mkconfig=./$NAME.sh
 
-if [ ! -f $config -o $mkconfig -nt $config ]; then
-   sh $mkconfig $config || exit 1
-fi
-
-${LCONF} -v --reformat --gdb $config || exit 2
+${LCONF}  --reformat --gdb $config || exit 2
 
 ../utils/lctl <<EOF
 newdev
diff --git a/lustre/tests/setuid.c b/lustre/tests/setuid.c
deleted file mode 100644 (file)
index 04dba5e..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <errno.h>
-#include <string.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/fsuid.h>
-
-int main(int argc, char ** argv)
-{
-        int rc, fsuid;
-
-        if (argc < 2) { 
-                printf("Usage %s fsuid\n", argv[0]);
-                return 1;
-        }
-
-        fsuid = strtoul(argv[2], NULL, 0);
-        rc = setfsuid(fsuid);
-        if (rc) { 
-                printf("mknod(%s) error: %s\n", argv[1], strerror(errno));
-        }
-        return rc;
-} 
index d488748..26f6a3f 100644 (file)
@@ -24,7 +24,7 @@ char *                cmd;
 struct option  longOpts[] = {
                        {"help", 0, 0, 'h'},
                        {"obd", 1, 0, 'o'},
-                       {"query", 0, 0, 'o'},
+                       {"query", 0, 0, 'q'},
                        {"verbose", 0, 0, 'v'},
                        {0, 0, 0, 0}
                };
@@ -217,12 +217,12 @@ processFile(const char *path, const struct stat *sp, int flag, struct FTW *ftwp)
 
        close(fd);
 
-       if (query || verbose)
-               printf("\n%s:\n", path);
+       if (query || verbose || lmm->lmm_objects[obdindex].l_object_id)
+               printf("%s\n", path);
 
        if (verbose) {
                printf("lmm_magic:          0x%x\n", lmm->lmm_magic);
-               printf("lmm_object_id:      0x%llx\n", lmm->lmm_object_id);
+               printf("lmm_object_id:      "LPX64"\n", lmm->lmm_object_id);
                printf("lmm_stripe_offset:  %d\n", lmm->lmm_stripe_offset);
                printf("lmm_stripe_count:   %d\n", lmm->lmm_stripe_count);
                printf("lmm_ost_count:      %d\n", lmm->lmm_ost_count);
@@ -232,24 +232,26 @@ processFile(const char *path, const struct stat *sp, int flag, struct FTW *ftwp)
        count = lmm->lmm_ost_count;
 
        if (query || verbose) {
-               struct lov_object_id *loi;
-               __u64 oid;
-
-               loi = lmm->lmm_objects;
-
-               printf("obdidx\tobjid\n");
-
-               for (i = 0; i < count; i++, loi++)
-                       if ((oid = loi->l_object_id))
-                               printf("%6d\t%5lld\n", i, oid);
+               long long oid;
+               int ost = lmm->lmm_stripe_offset;
+               int header = 1;
+
+               for (i = 0; i < count; i++, ost++) {
+                       ost %= lmm->lmm_ost_count;
+                       if ((oid = lmm->lmm_objects[ost].l_object_id)) {
+                               if (header) {
+                                       printf("\tobdidx\t   objid\n");
+                                       header = 0;
+                               }
+                               printf("\t%6u\t%8llu%s\n",
+                                      ost, oid, obdindex == ost ? " *" : "");
+                       }
+               }
 
                if (query)
                        return(0);
        }
 
-       if (lmm->lmm_objects[obdindex].l_object_id)
-               printf("%s\n", path);
-
        return(0);
 }
 
@@ -297,7 +299,7 @@ getobdindex(const char *path)
 
         obdcount = desc.ld_tgt_count;
 
-       if (query) {
+       if (query || verbose) {
                printf("OBDS:\n");
                for (i = 0, uuidp = uuids; i < obdcount; i++, uuidp++)
                        printf("%4d: %s\n", i, (char *)uuidp);