diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2007-06-27 02:42:13 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2007-06-27 02:42:13 +0000 |
commit | 1f395845fb471e216bce50e92119bf7821da7128 (patch) | |
tree | 212baec97203da6f0ae1c9a4a4a97da14a0b3b8b /archive | |
parent | 8bd276c9b79265c508d29c43e029df034c7f7987 (diff) | |
download | sg3_utils-1f395845fb471e216bce50e92119bf7821da7128.tar.gz |
Load sg3_utils-0.95 into trunk/.
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@14 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'archive')
-rw-r--r-- | archive/sgq_dd.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/archive/sgq_dd.c b/archive/sgq_dd.c index 5b1b3f08..235e561b 100644 --- a/archive/sgq_dd.c +++ b/archive/sgq_dd.c @@ -47,7 +47,7 @@ typedef unsigned char u_char; /* horrible, for scsi.h */ */ -static char * version_str = "0.51 20010114"; +static char * version_str = "0.52 20010819"; #define DEF_BLOCK_SIZE 512 #define DEF_BLOCKS_PER_TRANSFER 128 @@ -137,6 +137,8 @@ static struct pollfd in_pollfd_arr[MAX_NUM_THREADS]; static struct pollfd out_pollfd_arr[MAX_NUM_THREADS]; static int dd_count = -1; +static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio"; + int sg_fin_in_operation(Rq_coll * clp, Rq_elem * rep); int sg_fin_out_operation(Rq_coll * clp, Rq_elem * rep); int normal_in_operation(Rq_coll * clp, Rq_elem * rep, int blocks); @@ -1112,9 +1114,21 @@ int main(int argc, char * argv[]) res = 2; } print_stats(); - if (rcoll.dio_incomplete) + if (rcoll.dio_incomplete) { + int fd; + char c; + fprintf(stderr, ">> Direct IO requested but incomplete %d times\n", - rcoll.dio_incomplete); + rcoll.dio_incomplete); + if ((fd = open(proc_allow_dio, O_RDONLY)) >= 0) { + if (1 == read(fd, &c, 1)) { + if ('0' == c) + fprintf(stderr, ">>> %s set to '0' but should be set " + "to '1' for direct IO\n", proc_allow_dio); + } + close(fd); + } + } if (rcoll.sum_of_resids) fprintf(stderr, ">> Non-zero sum of residual counts=%d\n", rcoll.sum_of_resids); |