+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2000 Silicon Graphics, Inc.
* All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would 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 this program; if not, write the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* iogen - a tool for generating file/sds io for a doio process
int Naio_Strat_Types = 0; /* # async io completion types */
struct strmap *Aio_Strat_List[128]; /* Async io completion types */
-void startup_info();
+void startup_info(FILE *stream, int seed);
/*
* Map async io completion modes (-a args) names to values. Macros are
void
startup_info(FILE *stream, int seed)
{
- char *value_to_string(), *type;
+ char *value_to_string(struct strmap *map, int val), *type;
int i;
fprintf(stream, "\n");
rec->f_riou = BSIZE;
if( (fd = open(rec->f_path, O_RDWR|O_DIRECT, 0)) != -1 ) {
+ char *dio_env;
#ifdef XFS_IOC_DIOINFO
if(xfsctl(rec->f_path, fd, XFS_IOC_DIOINFO, &finfo) != -1) {
#else
bozo!
#endif
#endif
+ dio_env = getenv("XFS_DIO_MIN");
+ if (dio_env)
+ finfo.d_mem = finfo.d_miniosz = atoi(dio_env);
+
rec->f_riou = finfo.d_miniosz;
} else {
fprintf(stderr,
if(Owrite == 2) {
close(fd);
if( (fd = open(path, O_CREAT|O_RDWR|O_DIRECT, 0)) != -1 ) {
+ char *dio_env;
#ifdef XFS_IOC_DIOINFO
if(xfsctl(path, fd, XFS_IOC_DIOINFO, &finfo) == -1) {
#else
/*fprintf(stderr, "%s: miniosz=%d\n",
path, finfo.d_miniosz);*/
}
+
+ dio_env = getenv("XFS_DIO_MIN");
+ if (dio_env)
+ finfo.d_mem = finfo.d_miniosz = atoi(dio_env);
} else {
fprintf(stderr, "iogen%s: Error %s (%d) opening file %s with flags O_CREAT|O_RDWR|O_DIRECT\n",
TagName, SYSERR, errno, path);
break;
case 'N':
- sprintf( TagName, "(%.39s)", optarg );
+ sprintf( TagName, "(%.37s)", optarg );
break;
case 'o':