[Libsysio-commit] HEAD: libsysio/include inode.h sysio-cmn.h xtio.h
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2009-12-07 22:00:34
|
Update of /cvsroot/libsysio/libsysio/include In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv2260/include Modified Files: inode.h sysio-cmn.h xtio.h Log Message: Added ifsync and ifdatasync. These are asynchronous versions of the standard calls. In fact, the core has been reworked so that the async versions are the core implementation. For backward compatibility, if your driver has old versions you may set the new inop_isync ad inop_idatasync fields to NULL and retain the old interface and, synchronous, semantics. The existing fields were renamed to inop_old_sync and inop_old_datasync and will be deprecated in the future. One important, related, change is that the ioctx record has a new field, called ioctx_args, which is a void * type. It's only used to pass the real function to call aby the code that is faking the async API but using the old fsync and fdatasync. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.63 retrieving revision 1.64 diff -u -w -b -B -p -r1.63 -r1.64 --- inode.h 22 Sep 2009 22:33:37 -0000 1.63 +++ inode.h 7 Dec 2009 22:00:23 -0000 1.64 @@ -117,8 +117,10 @@ struct inode_ops { (*inop_pos)(struct pnode *pno, _SYSIO_OFF_T off); int (*inop_iodone)(struct ioctx *ioctx); int (*inop_fcntl)(struct pnode *pno, int cmd, va_list ap, int *rtn); - int (*inop_sync)(struct pnode *pno); - int (*inop_datasync)(struct pnode *pno); + int (*inop_isync)(struct ioctx *ioctx); + int (*inop_old_sync)(struct pnode *pno); + int (*inop_idatasync)(struct ioctx *ioctx); + int (*inop_old_datasync)(struct pnode *pno); int (*inop_ioctl)(struct pnode *pno, unsigned long int request, va_list ap); @@ -748,8 +750,7 @@ struct ioctx { LIST_ENTRY(ioctx) ioctx_link; /* AIO list link */ unsigned ioctx_fast:1, /* from stack space */ - ioctx_done:1, /* transfer complete */ - ioctx_write:1; /* op is a write */ + ioctx_done:1; /* transfer complete */ struct pnode *ioctx_pno; /* p-node */ const struct iovec *ioctx_iov; /* scatter/gather vec */ size_t ioctx_iovlen; /* iovec length */ @@ -757,6 +758,7 @@ struct ioctx { size_t ioctx_xtvlen; /* xtv length */ ssize_t ioctx_cc; /* rtn char count */ int ioctx_errno; /* error number */ + void *ioctx_args; /* op args */ TAILQ_HEAD(, ioctx_callback) ioctx_cbq; /* callback queue */ void *ioctx_private; /* driver data */ }; @@ -764,11 +766,10 @@ struct ioctx { /* * Init IO context record. */ -#define IOCTX_INIT(ioctx, fast, wr, pno, iov, iovlen, xtv, xtvlen) \ +#define IOCTX_INIT(ioctx, fast, pno, iov, iovlen, xtv, xtvlen, args) \ do { \ (ioctx)->ioctx_fast = (fast); \ (ioctx)->ioctx_done = 0; \ - (ioctx)->ioctx_write = (wr) ? 1 : 0; \ (ioctx)->ioctx_pno = (pno); \ (ioctx)->ioctx_iov = (iov); \ (ioctx)->ioctx_iovlen = (iovlen); \ @@ -776,6 +777,7 @@ struct ioctx { (ioctx)->ioctx_xtvlen = (xtvlen); \ (ioctx)->ioctx_cc = 0; \ (ioctx)->ioctx_errno = 0; \ + (ioctx)->ioctx_args = (args); \ TAILQ_INIT(&(ioctx)->ioctx_cbq); \ (ioctx)->ioctx_private = NULL; \ } while (0) @@ -854,6 +856,7 @@ extern int _sysio_p_iiox(int (*f)(struct void (*release_xtv)(struct ioctx *, void *), void (*completio)(struct ioctx *, void *), void *data, + void *args, struct ioctx **ioctxp); extern void _sysio_do_noop(void); extern void _sysio_do_illop(void); @@ -879,11 +882,11 @@ extern int _sysio_p_chdir(struct pnode * extern int _sysio_ioctx_init(void); extern void _sysio_ioctx_enter(struct ioctx *ioctx); extern struct ioctx *_sysio_ioctx_new(struct pnode *pno, - int wr, const struct iovec *iov, size_t iovlen, const struct intnl_xtvec *xtv, - size_t xtvlen); + size_t xtvlen, + void *args); extern int _sysio_ioctx_cb(struct ioctx *ioctx, void (*f)(struct ioctx *, void *), void *data); Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -w -b -B -p -r1.22 -r1.23 --- sysio-cmn.h 10 Sep 2009 20:38:39 -0000 1.22 +++ sysio-cmn.h 7 Dec 2009 22:00:23 -0000 1.23 @@ -9,7 +9,7 @@ * terms of the GNU Lesser General Public License * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html) * - * Cplant(TM) Copyright 1998-2006 Sandia Corporation. + * Cplant(TM) Copyright 1998-2009 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the US Government. * Export of this program may require a license from the United States @@ -36,7 +36,7 @@ * Lee Ward * Sandia National Laboratories, New Mexico * P.O. Box 5800 - * Albuquerque, NM 87185-1110 + * Albuquerque, NM 87185-1319 * * le...@sa... */ @@ -179,8 +179,8 @@ typedef enum { SYSIO_TTAG(dup2), SYSIO_TTAG(dup), SYSIO_TTAG(vfcntl), - SYSIO_TTAG(fsync), - SYSIO_TTAG(fdatasync), + SYSIO_TTAG(ifsync), + SYSIO_TTAG(ifdatasync), SYSIO_TTAG(getdirentries), #ifdef _LARGEFILE64_SOURCE SYSIO_TTAG(getdirentries64), Index: xtio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/xtio.h,v retrieving revision 2.3 retrieving revision 2.4 diff -u -w -b -B -p -r2.3 -r2.4 --- xtio.h 1 May 2007 16:33:52 -0000 2.3 +++ xtio.h 7 Dec 2009 22:00:23 -0000 2.4 @@ -9,7 +9,7 @@ * terms of the GNU Lesser General Public License * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html) * - * Cplant(TM) Copyright 1998-2004 Sandia Corporation. + * Cplant(TM) Copyright 1998-2009 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the US Government. * Export of this program may require a license from the United States @@ -36,7 +36,7 @@ * Lee Ward * Sandia National Laboratories, New Mexico * P.O. Box 5800 - * Albuquerque, NM 87185-1110 + * Albuquerque, NM 87185-1319 * * le...@sa... */ @@ -336,4 +336,14 @@ extern ssize_t SYSIO_INTERFACE_NAME(writ const struct xtvec64 *xtv, size_t xtv_count); #endif + +/* + * Sync file + */ +extern ioid_t SYSIO_INTERFACE_NAME(ifsync)(int fd); + +/* + * Sync file data + */ +extern ioid_t SYSIO_INTERFACE_NAME(ifdatasync)(int fd); #endif /* ! _XTIO_H_ */ |