[Libsysio-commit] HEAD: libsysio/drivers/yod fs_yod.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2003-10-13 01:04:43
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1:/tmp/cvs-serv31768/drivers/yod Modified Files: fs_yod.c Log Message: The IO context record supported one call-back. It now supports a chain. This was changed to accommodate the Sandia-PVFS driver. Also, it's needed for the, coming, {read,write}_strided calls. To add a callback to the chain use: _sysio_ioctx_cb(struct ioctx *ioctx, void (*func)(struct ioctx *, void *), void *data) Callbacks are added to the end of the existing chain. When called, by _sysio_io_complete, they are run in order. So... If you're freeing things using callbacks be careful not to depend on something in a later callback that you previously free'd. Also, _sysio_io_complete no longer waits for the driver. To call this, now, is to signal completion. Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- fs_yod.c 14 Aug 2003 18:39:33 -0000 1.2 +++ fs_yod.c 13 Oct 2003 01:04:34 -0000 1.3 @@ -169,11 +169,9 @@ static int yod_inop_open(struct pnode *p static int yod_inop_close(struct inode *ino); static int yod_inop_unlink(struct pnode *pno); static int yod_inop_ipreadv(struct inode *ino, - struct io_arguments *ioargs, - struct ioctx **ioctxp); + struct ioctx *ioctx); static int yod_inop_ipwritev(struct inode *ino, - struct io_arguments *ioargs, - struct ioctx **ioctxp); + struct ioctx *ioctx); static int yod_inop_iodone(struct ioctx *ioctx); static int yod_inop_fcntl(struct inode *ino, int cmd, va_list ap); static int yod_inop_sync(struct inode *ino); @@ -958,26 +956,17 @@ yod_inop_unlink(struct pnode *pno) static int doio(ssize_t (*f)(int, const struct iovec *, int), struct inode *ino, - struct io_arguments *ioargs, - struct ioctx **ioctxp) + struct ioctx *ioctx) { struct yod_inode *nino = I2NI(ino); - struct ioctx *ioctx; loff_t result; assert(nino->ni_fd >= 0); - if (ioargs->ioarg_iovlen && (int )ioargs->ioarg_iovlen < 0) + if (ioctx->ioctx_iovlen && (int )ioctx->ioctx_iovlen < 0) return -EINVAL; /* - * Get a new IO context. - */ - ioctx = _sysio_ioctx_new(ino, ioargs); - if (!ioctx) - return -ENOMEM; - - /* * This implementation first positions the real system descriptor, then * performs the operation. This is silly because it's not atomic. * @@ -1013,7 +1002,6 @@ doio(ssize_t (*f)(int, const struct iove nino->ni_fpos += ioctx->ioctx_cc; } - *ioctxp = ioctx; return 0; } @@ -1030,11 +1018,10 @@ _readv(int fd, const struct iovec *vecto static int yod_inop_ipreadv(struct inode *ino, - struct io_arguments *ioargs, - struct ioctx **ioctxp) + struct ioctx *ioctx) { - return doio(_readv, ino, ioargs, ioctxp); + return doio(_readv, ino, ioctx); } /* @@ -1055,11 +1042,10 @@ _writev(int fd, const struct iovec *vect static int yod_inop_ipwritev(struct inode *ino, - struct io_arguments *ioargs, - struct ioctx **ioctxp) + struct ioctx *ioctx) { - return doio(_writev, ino, ioargs, ioctxp); + return doio(_writev, ino, ioctx); } static int |