Thread: [Libsysio-commit] HEAD: libsysio/src ioctx.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2003-10-13 01:54:07
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv6057 Modified Files: ioctx.c Log Message: Oops. We should not drop the inode reference for fast IO context records. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- ioctx.c 13 Oct 2003 01:04:35 -0000 1.3 +++ ioctx.c 13 Oct 2003 01:53:57 -0000 1.4 @@ -225,8 +225,9 @@ _sysio_ioctx_complete(struct ioctx *ioct free(entry); } - I_RELE(ioctx->ioctx_ino); + if (ioctx->ioctx_fast) + return; - if (!ioctx->ioctx_fast) + I_RELE(ioctx->ioctx_ino); free(ioctx); } |
From: Lee W. <lw...@us...> - 2003-10-13 02:43:23
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv11818/src Modified Files: ioctx.c Log Message: Another oops from the addition of the callback chains... Must not remove the io context record from the global chain if it's marked `fast'. This because it was never put on the list in the first place :-( Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- ioctx.c 13 Oct 2003 01:53:57 -0000 1.4 +++ ioctx.c 13 Oct 2003 02:43:17 -0000 1.5 @@ -202,11 +202,6 @@ _sysio_ioctx_complete(struct ioctx *ioct #endif struct ioctx_callback *entry; - /* - * Unlink from the file record's outstanding request queue. - */ - LIST_REMOVE(ioctx, ioctx_link); - #if 0 /* * Wait for IO to complete and remember completion values. @@ -227,6 +222,11 @@ _sysio_ioctx_complete(struct ioctx *ioct if (ioctx->ioctx_fast) return; + + /* + * Unlink from the file record's outstanding request queue. + */ + LIST_REMOVE(ioctx, ioctx_link); I_RELE(ioctx->ioctx_ino); free(ioctx); |
From: Lee W. <lw...@us...> - 2004-02-26 17:51:38
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12020/src Modified Files: ioctx.c Log Message: Fixed problems in _sysio_enumerate_iovec. It was not applying the limit correctly. It was not moving through the iovec list -- Just using the first entry count times. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- ioctx.c 24 Feb 2004 14:58:26 -0000 1.9 +++ ioctx.c 26 Feb 2004 17:35:43 -0000 1.10 @@ -450,8 +450,8 @@ _sysio_enumerate_iovec(const struct iove assert(limit >= 0); acc = 0; n = limit; - for (indx = 0; indx < count; indx++) { - if (limit < 0 || iov[indx].iov_len < n) { + for (indx = 0; n && indx < count; indx++) { + if (iov[indx].iov_len < n) { cc = (ssize_t )iov[indx].iov_len; if (cc < 0) return -EINVAL; @@ -474,8 +474,8 @@ _sysio_enumerate_iovec(const struct iove continue; } n = - limit < 0 || iov[indx].iov_len < (size_t )limit - ? iov[indx].iov_len + iov->iov_len < (size_t )limit + ? iov->iov_len : (size_t )limit; cc = (*f)(iov->iov_base, n, off, arg); if (cc <= 0) { @@ -483,12 +483,13 @@ _sysio_enumerate_iovec(const struct iove return acc; return cc; } + limit -= cc; remain = iov->iov_len - cc; cc += acc; if (acc && cc <= acc) abort(); /* bad driver! */ acc = cc; - if (remain) + if (remain || !limit) break; /* short/limited read */ iov++; } while (--count); |
From: Lee W. <lw...@us...> - 2004-03-01 19:22:50
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11457 Modified Files: ioctx.c Log Message: Can't use returned character count in the overflow checks. That content is used later to adjust current xtvec and iovec. Use a temproary variable now. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- ioctx.c 26 Feb 2004 17:35:43 -0000 1.10 +++ ioctx.c 1 Mar 2004 19:03:46 -0000 1.11 @@ -338,7 +338,7 @@ _sysio_enumerate_extents(const struct in void *), void *arg) { - ssize_t acc, cc; + ssize_t acc, tmp, cc; struct iovec iovec; struct intnl_xtvec xtvec; const struct iovec *start; @@ -382,12 +382,12 @@ _sysio_enumerate_extents(const struct in return acc; return cc; } - cc += acc; - if (acc && cc <= acc) - abort(); /* paranoia */ - acc = cc; iovec.iov_base = (char *)iovec.iov_base + cc; iovec.iov_len -= cc; + tmp = cc + acc; + if (acc && tmp <= acc) + abort(); /* paranoia */ + acc = tmp; } else { start = iov; n = xtvec.xtv_len; @@ -419,10 +419,10 @@ _sysio_enumerate_extents(const struct in return cc; } remain -= cc; - cc += acc; - if (acc && cc <= acc) + tmp = cc + acc; + if (acc && tmp <= acc) abort(); /* paranoia */ - acc = cc; + acc = tmp; if (remain) return acc; /* short */ } |
From: Sonja T. <so...@us...> - 2004-03-11 15:07:35
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7290/src Modified Files: ioctx.c Log Message: Fixing buf in enumerate_extents. Added a somewhat less trivial test for strided I/O to test suite. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- ioctx.c 1 Mar 2004 19:03:46 -0000 1.11 +++ ioctx.c 11 Mar 2004 14:40:52 -0000 1.12 @@ -372,6 +372,10 @@ _sysio_enumerate_extents(const struct in } while (xtvec.xtv_len) { if (iovec.iov_len) { + tmp = iovec.iov_len; + if (iovec.iov_len > xtvec.xtv_len) { + iovec.iov_len = xtvec.xtv_len; + } cc = (*f)(&iovec, 1, xtvec.xtv_off, @@ -383,7 +387,7 @@ _sysio_enumerate_extents(const struct in return cc; } iovec.iov_base = (char *)iovec.iov_base + cc; - iovec.iov_len -= cc; + iovec.iov_len = tmp - cc; tmp = cc + acc; if (acc && tmp <= acc) abort(); /* paranoia */ @@ -403,8 +407,11 @@ _sysio_enumerate_extents(const struct in } while (--iovlen); if (iov == start) { iovec = *iov++; - if (iovec.iov_len > n) +#if 0 + if (iovec.iov_len > n) { iovec.iov_len = n; + } +#endif continue; } remain = xtvec.xtv_len - n; @@ -418,11 +425,16 @@ _sysio_enumerate_extents(const struct in return acc; return cc; } - remain -= cc; + tmp = cc + acc; if (acc && tmp <= acc) abort(); /* paranoia */ acc = tmp; + + if (remain && !iovlen) + return acc; + + remain -= cc; if (remain) return acc; /* short */ } |
From: Lee W. <lw...@us...> - 2004-04-27 15:15:00
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21082 Modified Files: ioctx.c Log Message: From Cray SPR 728619; writev(3) only writes the last vector in its iovector. The iovec enumerator function forgot to bump the offset for the next write call. This would lead to the same position being written over and over. Of course, only the final iovec entry length was the remaining data. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- ioctx.c 11 Mar 2004 14:40:52 -0000 1.12 +++ ioctx.c 27 Apr 2004 15:14:50 -0000 1.13 @@ -495,6 +495,7 @@ _sysio_enumerate_iovec(const struct iove return acc; return cc; } + off += cc; limit -= cc; remain = iov->iov_len - cc; cc += acc; |
From: Lee W. <lw...@us...> - 2004-06-16 13:58:36
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29040/src Modified Files: ioctx.c Log Message: Changes from Nik Livic and myself to support accounting on Red Storm. NB: We are tracking chars transferred to/from the underlying driver and not what is moved over the wire. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- ioctx.c 28 May 2004 12:48:26 -0000 1.14 +++ ioctx.c 16 Jun 2004 13:58:27 -0000 1.15 @@ -53,6 +53,12 @@ #include "inode.h" #include "xtio.h" + +#if defined(REDSTORM) +#include "do_iostats.h" +#endif + + /* * Asynchronous IO context support. */ @@ -229,6 +235,10 @@ _sysio_ioctx_complete(struct ioctx *ioct { struct ioctx_callback *entry; + + /* update IO stats */ + _SYSIO_UPDACCT(ioctx->ioctx_write, ioctx); + /* * Run the call-back queue. */ |
From: Lee W. <lw...@us...> - 2004-06-24 19:53:39
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31860/src Modified Files: ioctx.c Log Message: From Kevin Pedretti; Some trivial fixes for the latest accounting mods for Red Storm Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -b -B -p -r1.15 -r1.16 --- ioctx.c 16 Jun 2004 13:58:27 -0000 1.15 +++ ioctx.c 24 Jun 2004 19:53:31 -0000 1.16 @@ -55,7 +55,7 @@ #if defined(REDSTORM) -#include "do_iostats.h" +#include <catamount/do_iostats.h> #endif |
From: Lee W. <lw...@us...> - 2004-07-12 22:52:00
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3641/src Modified Files: ioctx.c Log Message: From Ruth; If, for list IO via {read,write}x an iovec entry was larger or same than a matched xtvec then _sysio_enumerate_extents would go one entry too far. We had forgotten to decrement the vector length in this case. Fixed. By inspection; When trying to satisfy an xtvec, we could deref a bad/invalid ptr. Fixed. Some cleanup to do with spacing and braces -- style stuff. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -w -b -B -p -r1.17 -r1.18 --- ioctx.c 3 Jul 2004 05:47:13 -0000 1.17 +++ ioctx.c 12 Jul 2004 22:51:51 -0000 1.18 @@ -385,9 +385,8 @@ _sysio_enumerate_extents(const struct in while (xtvec.xtv_len) { if (iovec.iov_len) { tmp = iovec.iov_len; - if (iovec.iov_len > xtvec.xtv_len) { + if (iovec.iov_len > xtvec.xtv_len) iovec.iov_len = xtvec.xtv_len; - } cc = (*f)(&iovec, 1, xtvec.xtv_off, @@ -404,7 +403,7 @@ _sysio_enumerate_extents(const struct in if (acc && tmp <= acc) abort(); /* paranoia */ acc = tmp; - } else { + } else if (iovlen) { start = iov; n = xtvec.xtv_len; do { @@ -419,18 +418,14 @@ _sysio_enumerate_extents(const struct in } while (--iovlen); if (iov == start) { iovec = *iov++; -#if 0 - if (iovec.iov_len > n) { - iovec.iov_len = n; - } -#endif + iovlen--; continue; } remain = xtvec.xtv_len - n; cc = (*f)(start, iov - start, xtvec.xtv_off, - xtvec.xtv_len - n, + remain, arg); if (cc <= 0) { if (acc) @@ -443,13 +438,11 @@ _sysio_enumerate_extents(const struct in abort(); /* paranoia */ acc = tmp; - if (remain && !iovlen) - return acc; - remain -= cc; if (remain) return acc; /* short */ - } + } else + return acc; /* short out */ xtvec.xtv_off += cc; xtvec.xtv_len -= cc; } |
From: Lee W. <lw...@us...> - 2005-06-16 21:22:11
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17018 Modified Files: ioctx.c Log Message: From Cray; the UPDACCT call was sending the ioctx ptr and not the number of bytes transferred, as it should. Fix from Cray applied. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -w -b -B -p -r1.23 -r1.24 --- ioctx.c 25 Feb 2005 00:01:06 -0000 1.23 +++ ioctx.c 16 Jun 2005 21:21:42 -0000 1.24 @@ -246,7 +246,7 @@ _sysio_ioctx_complete(struct ioctx *ioct /* update IO stats */ - _SYSIO_UPDACCT(ioctx->ioctx_write, ioctx); + _SYSIO_UPDACCT(ioctx->ioctx_write, ioctx->ioctx_cc); /* * Run the call-back queue. |
From: Lee W. <lw...@us...> - 2007-05-14 15:51:59
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17885 Modified Files: ioctx.c Log Message: The ioctx_pno field has been removed until we are ready to, at least, force a recompile of existing drivers. Right now, we need to be able to use them unaltered for the tracing project. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -w -b -B -p -r1.25 -r1.26 --- ioctx.c 30 Apr 2007 16:52:20 -0000 1.25 +++ ioctx.c 14 May 2007 15:51:55 -0000 1.26 @@ -114,7 +114,11 @@ _sysio_ioctx_new(struct pnode *pno, if (!ioctx) return NULL; +#ifdef not_yet P_REF(pno); +#else + I_REF(pno->p_base->pb_ino); +#endif IOCTX_INIT(ioctx, 0, @@ -184,8 +188,13 @@ _sysio_ioctx_done(struct ioctx *ioctx) if (ioctx->ioctx_done) return 1; +#ifdef not_yet if (!PNOP_IODONE(ioctx->ioctx_pno, ioctx)) return 0; +#else + if ((*ioctx->ioctx_ino->i_ops.inop_iodone)(ioctx)) + return 0; +#endif ioctx->ioctx_done = 1; return 1; } @@ -264,6 +273,10 @@ _sysio_ioctx_complete(struct ioctx *ioct if (ioctx->ioctx_fast) return; +#ifdef not_yet P_RELE(ioctx->ioctx_pno); +#else + I_RELE(ioctx->ioctx_ino); +#endif free(ioctx); } |
From: Ruth K. <rk...@us...> - 2007-05-14 20:43:31
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30037 Modified Files: ioctx.c Log Message: return 1 => done Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -w -b -B -p -r1.26 -r1.27 --- ioctx.c 14 May 2007 15:51:55 -0000 1.26 +++ ioctx.c 14 May 2007 20:43:28 -0000 1.27 @@ -192,7 +192,7 @@ _sysio_ioctx_done(struct ioctx *ioctx) if (!PNOP_IODONE(ioctx->ioctx_pno, ioctx)) return 0; #else - if ((*ioctx->ioctx_ino->i_ops.inop_iodone)(ioctx)) + if (!(*ioctx->ioctx_ino->i_ops.inop_iodone)(ioctx)) return 0; #endif ioctx->ioctx_done = 1; |