/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
#include <afsconfig.h>
#include <afs/param.h>
-RCSID
- ("$Header$");
+#include <roken.h>
-#include <signal.h>
-#include <sys/errno.h>
#include <afs/afs_args.h>
-#include <sys/file.h>
-#include <sys/ioctl.h>
-#if defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
-#include <unistd.h>
-#else
-#include <stdio.h>
-#endif
-#ifdef AFS_SUN5_ENV
-#include <fcntl.h>
-#endif
+
#ifdef AFS_SGI_XFS_IOPS_ENV
-#include "xfsattrs.h"
+# include "xfsattrs.h"
#endif
-#include <errno.h>
#include "afssyscalls.h"
#ifdef AFS_DEBUG_IOPS
#else
#if defined(AFS_SGI_ENV)
-#ifdef AFS_SGI61_ENV
-#include <sys/types.h>
-#endif /* AFS_SGI61_ENV */
#pragma weak xicreate = icreate
#pragma weak xiinc = iinc
#pragma weak xidec = idec
#pragma weak xiopen = iopen
-#pragma weak xlsetpag = lsetpag
-#pragma weak xlpioctl = lpioctl
#ifdef notdef
#pragma weak xiread = iread
#pragma weak xiwrite = iwrite
}
#endif /* notdef */
-int
-lsetpag(void)
-{
- return (syscall(AFS_SETPAG));
-}
-
-int
-lpioctl(char *path, int cmd, char *cmarg, int follow)
-{
- return (syscall(AFS_PIOCTL, path, cmd, cmarg, follow));
-}
#else /* AFS_SGI_ENV */
#ifndef AFS_NAMEI_ENV
#endif /* AFS_NAMEI_ENV */
-#if defined(AFS_DARWIN80_ENV)
-int ioctl_afs_syscall(long syscall, long param1, long param2, long param3,
- long param4, long param5, long param6, int *rval) {
- struct afssysargs syscall_data;
- int code;
- int fd = open(SYSCALL_DEV_FNAME, O_RDWR);
- if(fd < 0)
- return -1;
-
- syscall_data.syscall = syscall;
- syscall_data.param1 = param1;
- syscall_data.param2 = param2;
- syscall_data.param3 = param3;
- syscall_data.param4 = param4;
- syscall_data.param5 = param5;
- syscall_data.param6 = param6;
-
- code = ioctl(fd, VIOC_SYSCALL, &syscall_data);
-
- close(fd);
- if (code)
- return code;
- *rval=syscall_data.retval;
- return 0;
-}
-#endif
-#if defined(AFS_LINUX20_ENV)
-int proc_afs_syscall(long syscall, long param1, long param2, long param3,
- long param4, int *rval) {
- struct afsprocdata syscall_data;
- int fd = open(PROC_SYSCALL_FNAME, O_RDWR);
- if(fd < 0)
- fd = open(PROC_SYSCALL_ARLA_FNAME, O_RDWR);
- if(fd < 0)
- return -1;
-
- syscall_data.syscall = syscall;
- syscall_data.param1 = param1;
- syscall_data.param2 = param2;
- syscall_data.param3 = param3;
- syscall_data.param4 = param4;
-
- *rval = ioctl(fd, VIOC_SYSCALL, &syscall_data);
-
- close(fd);
-
- return 0;
-}
-#endif
-
-int
-lsetpag(void)
-{
- int errcode, rval;
-
-#if defined(AFS_LINUX20_ENV)
- rval = proc_afs_syscall(AFSCALL_SETPAG,0,0,0,0,&errcode);
-
- if(rval)
- errcode = syscall(AFS_SYSCALL, AFSCALL_SETPAG);
-#elif defined(AFS_DARWIN80_ENV)
- if (ioctl_afs_syscall(AFSCALL_SETPAG,0,0,0,0,0,0,&errcode))
- errcode=ENOSYS;
-#else
- errcode = syscall(AFS_SYSCALL, AFSCALL_SETPAG);
-#endif
-
- return (errcode);
-}
-
-int
-lpioctl(char *path, int cmd, char *cmarg, int follow)
-{
- int errcode, rval;
-
-#if defined(AFS_LINUX20_ENV)
- rval = proc_afs_syscall(AFSCALL_PIOCTL, (long)path, cmd, (long)cmarg, follow, &errcode);
-
- if(rval)
- errcode = syscall(AFS_SYSCALL, AFSCALL_PIOCTL, path, cmd, cmarg, follow);
-#elif defined(AFS_DARWIN80_ENV)
- if (ioctl_afs_syscall(AFSCALL_PIOCTL,(long)path,cmd,(long)cmarg,follow,0,0,&errcode))
- errcode=ENOSYS;
-#else
- errcode = syscall(AFS_SYSCALL, AFSCALL_PIOCTL, path, cmd, cmarg, follow);
-#endif
-
- return (errcode);
-}
-
#endif /* !AFS_SGI_ENV */
#endif /* !AFS_AIX32_ENV */
#define IOPS_DEBUG_MALLOC_STEP 64
/* check_iops
- * Returns 1 if first time we've seen this file/line.
+ * Returns 1 if first time we've seen this file/line.
* Puts file/line in array so we only print the first time we encounter
* this entry.
*/
iops_debug[index] =
(iops_debug_t *) malloc(avail * sizeof(iops_debug_t));
else
- iops_debug[index] =
- (iops_debug_t *) realloc(*iops, avail * sizeof(iops_debug_t));
+ iops_debug[index] = realloc(*iops, avail * sizeof(iops_debug_t));
if (!iops_debug[index]) {
printf("check_iops: Can't %salloc %lu bytes for index %d\n",
(avail == IOPS_DEBUG_MALLOC_STEP) ? "m" : "re",