merge irix dmapi test changes

merge irix changes
This commit is contained in:
Dean Roehrich
2001-03-08 17:52:41 +00:00
parent 79a080ec49
commit ed3a28a5f3
74 changed files with 152 additions and 309 deletions
-2
View File
@@ -34,11 +34,9 @@
#include <lib/hsm.h>
#ifdef linux
#include <string.h>
#include <malloc.h>
#include <unistd.h>
#endif
/*---------------------------------------------------------------------------
-2
View File
@@ -32,10 +32,8 @@
#include <lib/hsm.h>
#ifdef linux
#include <string.h>
#include <getopt.h>
#endif
/*---------------------------------------------------------------------------
@@ -32,10 +32,8 @@
#include <lib/hsm.h>
#ifdef linux
#include <string.h>
#include <getopt.h>
#endif
/*---------------------------------------------------------------------------
-2
View File
@@ -32,11 +32,9 @@
#include <lib/hsm.h>
#ifdef linux
#include <string.h>
#include <malloc.h>
#include <getopt.h>
#endif
/*---------------------------------------------------------------------------
-2
View File
@@ -32,9 +32,7 @@
#include <lib/hsm.h>
#ifdef linux
#include <string.h>
#endif
/*******************************************************************************
*
+1 -1
View File
@@ -38,8 +38,8 @@
#include <lib/hsm.h>
#ifdef linux
#include <string.h>
#ifdef linux
#define MAXNAMELEN 256
#endif
+26 -25
View File
@@ -26,9 +26,10 @@
#include <lib/hsm.h>
#ifdef linux
#include <string.h>
#include <time.h>
#ifdef linux
#include <stdint.h>
#define S_IAMB (S_IRWXU|S_IRWXG|S_IRWXO)
#endif
@@ -577,16 +578,17 @@ validate_state(
if (dmstat->dt_dev != statb.st_dev) {
if (report_errors) {
fprintf(stdout, "ERROR:dmstat->dt_dev 0x%x, "
"statb.st_dev 0x%x\n", dmstat->dt_dev,
statb.st_dev);
fprintf(stdout, "ERROR:dmstat->dt_dev 0x%llx, "
"statb.st_dev 0x%llx\n",
(uint64_t)dmstat->dt_dev,
(uint64_t)statb.st_dev);
}
errors++;
}
if (dmstat->dt_ino != statb.st_ino) {
if (report_errors) {
fprintf(stdout, "ERROR:dmstat->dt_ino %llx, "
#if defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#if defined(linux) || (defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32))
"statb.st_ino %llx\n",
#else
"statb.st_ino %x\n",
@@ -639,16 +641,17 @@ validate_state(
}
if (dmstat->dt_rdev != statb.st_rdev) {
if (report_errors) {
fprintf(stdout, "ERROR:dmstat->dt_rdev 0x%x, "
"statb.st_rdev 0x%x\n", dmstat->dt_rdev,
statb.st_rdev);
fprintf(stdout, "ERROR:dmstat->dt_rdev 0x%llx, "
"statb.st_rdev 0x%llx\n",
(uint64_t)dmstat->dt_rdev,
(uint64_t)statb.st_rdev);
}
errors++;
}
if (dmstat->dt_size != statb.st_size) {
if (report_errors) {
fprintf(stdout, "ERROR:dmstat->dt_size %lld, "
#if defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#if defined(linux) || (defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32))
"statb.st_size %lld\n",
#else
"statb.st_size %d\n",
@@ -659,32 +662,32 @@ validate_state(
}
if (dmstat->dt_atime != statb.st_atime) {
if (report_errors) {
fprintf(stdout, "ERROR:dmstat->dt_atime %d, "
"statb.st_atime %d\n", dmstat->dt_atime,
fprintf(stdout, "ERROR:dmstat->dt_atime %ld, "
"statb.st_atime %ld\n", dmstat->dt_atime,
statb.st_atime);
}
errors++;
}
if (dmstat->dt_mtime != statb.st_mtime) {
if (report_errors) {
fprintf(stdout, "ERROR:dmstat->dt_mtime %d, "
"statb.st_mtime %d\n", dmstat->dt_mtime,
fprintf(stdout, "ERROR:dmstat->dt_mtime %ld, "
"statb.st_mtime %ld\n", dmstat->dt_mtime,
statb.st_mtime);
}
errors++;
}
if (dmstat->dt_ctime != statb.st_ctime) {
if (report_errors) {
fprintf(stdout, "ERROR:dmstat->dt_ctime %d, "
"statb.st_ctime %d\n", dmstat->dt_ctime,
fprintf(stdout, "ERROR:dmstat->dt_ctime %ld, "
"statb.st_ctime %ld\n", dmstat->dt_ctime,
statb.st_ctime);
}
errors++;
}
if (dmstat->dt_dtime != statb.st_ctime) {
if (report_errors) {
fprintf(stdout, "ERROR:dmstat->dt_dtime %d, "
"statb.st_ctime %d\n", dmstat->dt_dtime,
fprintf(stdout, "ERROR:dmstat->dt_dtime %ld, "
"statb.st_ctime %ld\n", dmstat->dt_dtime,
statb.st_ctime);
}
errors++;
@@ -692,7 +695,7 @@ validate_state(
if (dmstat->dt_blksize != statb.st_blksize) {
if (report_errors) {
fprintf(stdout, "ERROR:dmstat->dt_blksize %d, "
"statb.st_blksize %d\n", dmstat->dt_blksize,
"statb.st_blksize %ld\n", dmstat->dt_blksize,
statb.st_blksize);
}
errors++;
@@ -700,7 +703,7 @@ validate_state(
if (dmstat->dt_blocks != statb.st_blocks) {
if (report_errors) {
fprintf(stdout, "ERROR:dmstat->dt_blocks %lld, "
#if defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#if defined(linux) || (defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32))
"statb.st_blocks %lld\n",
#else
"statb.st_blocks %d\n",
@@ -890,7 +893,7 @@ print_state(
{
/* Print all the stat block fields. */
fprintf(stdout, "dt_dev 0x%x\n", dmstat->dt_dev);
fprintf(stdout, "dt_dev 0x%llx\n", (uint64_t)dmstat->dt_dev);
fprintf(stdout, "dt_ino %llx\n", dmstat->dt_ino);
fprintf(stdout, "dt_mode (type) %s\n",
mode_to_string(dmstat->dt_mode));
@@ -898,7 +901,7 @@ print_state(
fprintf(stdout, "dt_nlink %d\n", dmstat->dt_nlink);
fprintf(stdout, "dt_uid %d\n", dmstat->dt_uid);
fprintf(stdout, "dt_gid %d\n", dmstat->dt_gid);
fprintf(stdout, "dt_rdev 0x%x\n", dmstat->dt_rdev);
fprintf(stdout, "dt_rdev 0x%llx\n", (uint64_t)dmstat->dt_rdev);
fprintf(stdout, "dt_size %lld\n", dmstat->dt_size);
fprintf(stdout, "dt_atime %s\n",
@@ -939,14 +942,14 @@ extern void
print_line(
dm_stat_t *dmstat)
{
fprintf(stdout, "0x%x|", dmstat->dt_dev);
fprintf(stdout, "0x%llx|", (uint64_t)dmstat->dt_dev);
fprintf(stdout, "%llx|", dmstat->dt_ino);
fprintf(stdout, "%s|", mode_to_string(dmstat->dt_mode));
fprintf(stdout, "0%o|", dmstat->dt_mode & S_MASK);
fprintf(stdout, "%d|", dmstat->dt_nlink);
fprintf(stdout, "%d|", dmstat->dt_uid);
fprintf(stdout, "%d|", dmstat->dt_gid);
fprintf(stdout, "0x%x|", dmstat->dt_rdev);
fprintf(stdout, "0x%llx|", (uint64_t)dmstat->dt_rdev);
fprintf(stdout, "%lld|", dmstat->dt_size);
fprintf(stdout, "%s|", date_to_string(dmstat->dt_atime));
@@ -956,13 +959,11 @@ print_line(
fprintf(stdout, "%d|", dmstat->dt_blksize);
fprintf(stdout, "%lld|", dmstat->dt_blocks);
#ifdef __sgi
fprintf(stdout, "%d|", dmstat->dt_xfs_igen);
fprintf(stdout, "%s|", xflags_to_string(dmstat->dt_xfs_xflags));
fprintf(stdout, "%d|", dmstat->dt_xfs_extsize);
fprintf(stdout, "%d|", dmstat->dt_xfs_extents);
fprintf(stdout, "%d|", dmstat->dt_xfs_aextents);
#endif
/* Print all other fields. */
-2
View File
@@ -30,9 +30,7 @@
#include <lib/hsm.h>
#ifdef linux
#include <getopt.h>
#endif
#define NUMLEN 16 /* arbitrary max len of input size */
#define MAX_K (((u_int)LONG_MAX + 1) / 1024)
-2
View File
@@ -25,10 +25,8 @@
#include <lib/dmport.h>
#ifdef linux
#include <string.h>
#include <getopt.h>
#endif
extern char *optarg;
extern int optind, opterr, optopt;
+1 -1
View File
@@ -32,9 +32,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/errno.h>
#include <getopt.h>
#ifdef linux
#include <dmapi.h>
#include <getopt.h>
#else
#include <sys/dmi.h>
#endif
+1 -1
View File
@@ -32,9 +32,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/errno.h>
#include <getopt.h>
#ifdef linux
#include <dmapi.h>
#include <getopt.h>
#else
#include <sys/dmi.h>
#endif
+1 -1
View File
@@ -32,9 +32,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/errno.h>
#include <getopt.h>
#ifdef linux
#include <dmapi.h>
#include <getopt.h>
#else
#include <sys/dmi.h>
#endif
+1 -1
View File
@@ -34,9 +34,9 @@
#include <sys/errno.h>
#include <string.h>
#include <malloc.h>
#include <getopt.h>
#ifdef linux
#include <dmapi.h>
#include <getopt.h>
#else
#include <sys/dmi.h>
#endif
+1 -1
View File
@@ -33,9 +33,9 @@
#include <stdlib.h>
#include <sys/errno.h>
#include <malloc.h>
#include <getopt.h>
#ifdef linux
#include <dmapi.h>
#include <getopt.h>
#else
#include <sys/dmi.h>
#endif
+1 -1
View File
@@ -32,9 +32,9 @@
#include <stdlib.h>
#include <stdio.h>
#include <sys/errno.h>
#include <getopt.h>
#ifdef linux
#include <dmapi.h>
#include <getopt.h>
#else
#include <sys/dmi.h>
#endif
+1 -5
View File
@@ -32,9 +32,8 @@
#include <lib/hsm.h>
#ifdef linux
#include <string.h>
#endif
#include <getopt.h>
/*---------------------------------------------------------------------------
@@ -60,8 +59,6 @@ char *Progname;
static void
usage(void)
{
int i;
fprintf(stderr, "usage:\t%s [-s sid] string\n", Progname);
exit(1);
}
@@ -77,7 +74,6 @@ main(
dm_token_t token;
char *name;
int opt;
int i;
if (Progname = strrchr(argv[0], '/')) {
Progname++;
+1 -9
View File
@@ -38,9 +38,7 @@
#include <lib/hsm.h>
#ifdef linux
#include <string.h>
#endif
/*---------------------------------------------------------------------------
@@ -73,13 +71,6 @@ Tested DMAPI functions are:
char *Progname;
static void
usage(void)
{
fprintf(stderr, "usage:\t%s pathname\n", Progname);
exit(1);
}
int
main(
@@ -280,4 +271,5 @@ main(
dm_handle_free(fshanp1, fshlen1);
dm_handle_free(fshanp2, fshlen2);
dm_handle_free(fshanp3, fshlen3);
exit(0);
}
+2 -2
View File
@@ -32,9 +32,8 @@
#include <lib/hsm.h>
#ifdef linux
#include <string.h>
#endif
#include <getopt.h>
/*---------------------------------------------------------------------------
@@ -149,4 +148,5 @@ main(
}
dm_handle_free(hanp, hlen);
exit(0);
}
+2
View File
@@ -42,6 +42,7 @@
#include <lib/dmport.h>
#include <string.h>
static void
hantoa(
@@ -88,4 +89,5 @@ main(
hantoa(hanp, hlen, buffer);
fprintf(stdout, "handle %s, path %s\n", buffer, argv[1]);
exit(0);
}
-31
View File
@@ -39,9 +39,7 @@
#include <lib/hsm.h>
#ifdef linux
#include <string.h>
#endif
/*---------------------------------------------------------------------------
@@ -252,11 +250,7 @@ print_alloc(
char *type = NULL;
int rc;
#ifdef __sgi
fprintf(stdout, "%s: starting offset %lld\n", pathname, startoff);
#else
fprintf(stdout, "%s: starting offset %d\n", pathname, startoff);
#endif
/* Allocate space for the number of extents requested by the user. */
@@ -302,32 +296,20 @@ print_alloc(
}
if (!Dflag) {
#if __sgi
fprintf(stdout, "\t%d: [%lld..%lld]: %s", num,
#else
fprintf(stdout, "\t%d: [%d..%d]: %s", num,
#endif
extent[i].ex_offset / 512,
(extent[i].ex_offset +
extent[i].ex_length - 1) / 512, type);
if ((extent[i].ex_offset % 512 != 0) ||
(endoff % 512 != 0)) {
#if __sgi
fprintf(stdout, "\t[%lld..%lld]\n",
#else
fprintf(stdout, "\t[%d..%d]\n",
#endif
extent[i].ex_offset % 512,
(endoff-1) % 512);
} else {
fprintf(stdout, "\n");
}
} else {
#ifdef __sgi
fprintf(stdout, "%5s %13lld %13lld\n",
#else
fprintf(stdout, "%5s %13d %13d\n",
#endif
type, extent[i].ex_offset,
extent[i].ex_length);
}
@@ -340,22 +322,13 @@ print_alloc(
*/
if (extent[i].ex_offset != endoff) {
#ifdef __sgi
fprintf(stderr, "new extent (%lld)is not "
"adjacent to previous one (%lld)\n",
#else
fprintf(stderr, "new extent (%d)is not "
"adjacent to previous one (%d)\n",
#endif
extent[i].ex_offset, endoff);
return(1);
}
if (num && (extent[i].ex_offset % 512) != 0) {
#ifdef __sgi
fprintf(stderr, "non-initial ex_offset (%lld) "
#else
fprintf(stderr, "non-initial ex_offset (%d) "
#endif
"is not a 512-byte multiple\n",
extent[i].ex_offset);
return(1);
@@ -383,11 +356,7 @@ print_alloc(
*/
if (rc && startoff != endoff) {
#ifdef __sgi
fprintf(stderr, "startoff is %lld, should be %lld\n",
#else
fprintf(stderr, "startoff is %d, should be %d\n",
#endif
startoff, endoff);
return(1);
}

Some files were not shown because too many files have changed in this diff Show More