And for those folks who use SunOS [45].x, here's a code snippet that changes
a file-system to have async metadata semantics on the fly. Just add a -DSYSV
to the cc line for SunOS 5.x.
Usage: ufsdio mountpoint [0|1]
0 makes metadata operations sync, 1 makes them async, no arg reports the
current state.
ufsdio.c:
#include <stdio.h>
#include <sys/filio.h>
#include <unistd.h>
#include <dirent.h>
main(int argc, char *argv[])
{
DIR *dd;
int doset=0;
int io_op;
long on=0;
if (argc < 2 )
exit( 1 );
if ( argc > 2 ) {
doset = 1;
on = atoi(argv[2]);
}
if ((dd = opendir(argv[1])) == (DIR *)NULL)
{
perror( argv[1] );
exit( 1);
}
#ifdef SYSV
io_op = doset ? _FIOSDIO : _FIOGDIO;
#else
io_op = doset ? FIODIO : FIODIOS;
#endif
if (ioctl( dd->dd_fd, io_op, &on )==-1)
{
perror( "ioctl: FIODIO" );
exit(1);
}
if (! doset)
printf ("Async flag for directory %s = %d\n", argv[1], on);
exit( 0 );
}
Received on Tue Mar 18 1997 - 15:05:52 MST
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:34:43 MST