[Libsysio-commit] HEAD: libsysio/include xtio.h dev.h file.h fs.h inode.h module.mk sysio.h
Brought to you by:
lward
|
From: Lee W. <lw...@us...> - 2004-02-06 20:10:46
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29990/include Modified Files: dev.h file.h fs.h inode.h module.mk sysio.h Added Files: xtio.h Log Message: Merging strided-IO branch + Strided-IO infrastructure. Internals altered to move data base don multiple targeted regions in both the file address space and local memory. + Added [i]{read,write}x, calls to perform extent-based or strided-IO directly. + Many bug fixes + Many uocnfig fixes + --with-zero-sum-memory; A config option that causes the shutdown code to carefully release *all* memory acquired from the heap, by the library. Useful for debugging tasks such as leak detection. Index: dev.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/dev.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- dev.h 13 Oct 2003 01:04:34 -0000 1.5 +++ dev.h 6 Feb 2004 20:07:29 -0000 1.6 @@ -109,10 +109,10 @@ extern const struct inode_ops _sysio_nod (int (*)(struct pnode *))_sysio_dev_illop #define _sysio_nodev_inop_rename \ (int (*)(struct pnode *, struct pnode *))_sysio_dev_illop -#define _sysio_nodev_inop_ipreadv \ +#define _sysio_nodev_inop_read \ (int (*)(struct inode *, \ struct ioctx *))_sysio_dev_illop -#define _sysio_nodev_inop_ipwritev \ +#define _sysio_nodev_inop_write \ (int (*)(struct inode *, \ struct ioctx *))_sysio_dev_illop #define _sysio_nodev_inop_iodone \ Index: file.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/file.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- file.h 13 Oct 2003 01:04:35 -0000 1.7 +++ file.h 6 Feb 2004 20:07:29 -0000 1.8 @@ -98,3 +98,6 @@ extern struct file *_sysio_fd_find(int f extern int _sysio_fd_set(struct file *fil, int fd); extern int _sysio_fd_dup2(int oldfd, int newfd); extern int _sysio_fd_close_all(void); +#if ZERO_SUM_MEMORY +extern void _sysio_fd_shutdown(void); +#endif Index: fs.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/fs.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- fs.h 24 Mar 2003 22:09:05 -0000 1.4 +++ fs.h 6 Feb 2004 20:07:29 -0000 1.5 @@ -167,3 +167,6 @@ extern struct filesys * _sysio_fs_new(st unsigned mask, void *private); extern void _sysio_fs_gone(struct filesys *fs); +#if ZERO_SUM_MEMORY +extern void _sysio_fssw_shutdown(void); +#endif Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- inode.h 17 Oct 2003 21:30:29 -0000 1.13 +++ inode.h 6 Feb 2004 20:07:29 -0000 1.14 @@ -99,8 +99,8 @@ struct inode_ops { int (*inop_link)(struct pnode *old, struct pnode *new); int (*inop_unlink)(struct pnode *pno); int (*inop_rename)(struct pnode *old, struct pnode *new); - int (*inop_ipreadv)(struct inode *ino, struct ioctx *ioctx); - int (*inop_ipwritev)(struct inode *ino, struct ioctx *ioctx); + int (*inop_read)(struct inode *ino, struct ioctx *ioctx); + int (*inop_write)(struct inode *ino, struct ioctx *ioctx); int (*inop_iodone)(struct ioctx *iocp); int (*inop_fcntl)(struct inode *ino, int cmd, va_list ap); int (*inop_sync)(struct inode *ino); @@ -314,8 +314,8 @@ struct nameidata { /* * Values for nameidata flags field. */ -#define ND_NOFOLLOW 0x01 -#define ND_NEGOK 0x02 +#define ND_NOFOLLOW 0x01 /* no follow symlinks */ +#define ND_NEGOK 0x02 /* last missing is ok */ #ifdef AUTOMOUNT_FILE_NAME #define _ND_INIT_AUTOMOUNT(nd) ((nd)->nd_amcnt = 0) @@ -360,9 +360,10 @@ struct ioctx { ioctx_done : 1; /* transfer complete */ ioid_t ioctx_id; /* unique ident */ struct inode *ioctx_ino; /* i-node */ - const struct iovec *ioctx_iovec; /* scatter/gather vec */ + const struct iovec *ioctx_iov; /* scatter/gather vec */ size_t ioctx_iovlen; /* iovec length */ - _SYSIO_OFF_T ioctx_offset; /* file offset */ + const struct intnl_xtvec *ioctx_xtv; /* extents */ + size_t ioctx_xtvlen; /* xtv length */ ssize_t ioctx_cc; /* rtn char count */ int ioctx_errno; /* error number */ TAILQ_HEAD(, ioctx_callback) ioctx_cbq; /* callback queue */ @@ -372,15 +373,16 @@ struct ioctx { /* * Init IO context record. */ -#define IOCTX_INIT(ioctx, fast, id, ino, iov, iovlen, off) \ +#define IOCTX_INIT(ioctx, fast, id, ino, iov, iovlen, xtv, xtvlen) \ do { \ (ioctx)->ioctx_fast = (fast); \ (ioctx)->ioctx_done = 0; \ (ioctx)->ioctx_id = (id); \ (ioctx)->ioctx_ino = (ino); \ - (ioctx)->ioctx_iovec = (iov); \ + (ioctx)->ioctx_iov = (iov); \ (ioctx)->ioctx_iovlen = (iovlen); \ - (ioctx)->ioctx_offset = (off); \ + (ioctx)->ioctx_xtv = (xtv); \ + (ioctx)->ioctx_xtvlen = (xtvlen); \ (ioctx)->ioctx_cc = 0; \ (ioctx)->ioctx_errno = 0; \ TAILQ_INIT(&(ioctx)->ioctx_cbq); \ @@ -405,6 +407,9 @@ extern TAILQ_HEAD(inodes_head, inode) _s extern TAILQ_HEAD(pnodes_head, pnode) _sysio_pnodes; extern int _sysio_i_init(void); +#if ZERO_SUM_MEMORY +extern void _sysio_i_shutdown(void); +#endif extern struct inode *_sysio_i_new(struct filesys *fs, struct file_identifier *fid, mode_t type, @@ -448,14 +453,43 @@ extern int _sysio_namei(struct pnode *pn struct pnode **pnop); extern int _sysio_p_chdir(struct pnode *pno); extern int _sysio_ioctx_init(void); +extern void _sysio_ioctx_enter(struct ioctx *ioctx); extern struct ioctx *_sysio_ioctx_new(struct inode *ino, const struct iovec *iov, size_t iovlen, - _SYSIO_OFF_T offset); + const struct intnl_xtvec *xtv, + size_t xtvlen); extern int _sysio_ioctx_cb(struct ioctx *ioctx, void (*f)(struct ioctx *, void *), void *data); +extern void _sysio_ioctx_cb_free(struct ioctx_callback *cb); extern struct ioctx *_sysio_ioctx_find(ioid_t id); extern ssize_t _sysio_ioctx_wait(struct ioctx *ioctx); extern void _sysio_ioctx_complete(struct ioctx *ioctx); +extern ssize_t _sysio_validx(const struct intnl_xtvec *xtv, size_t xtvlen, + const struct iovec *iov, size_t iovlen, + _SYSIO_OFF_T limit); +extern ssize_t _sysio_enumerate_extents(const struct intnl_xtvec *xtv, + size_t xtvlen, + const struct iovec *iov, + size_t iovlen, + ssize_t (*f)(const struct iovec *, + int, + _SYSIO_OFF_T, + ssize_t, + void *), + void *arg); +extern ssize_t _sysio_enumerate_iovec(const struct iovec *iov, + size_t count, + _SYSIO_OFF_T off, + ssize_t limit, + ssize_t (*f)(void *, + size_t, + _SYSIO_OFF_T, + void *), + void *arg); +extern ssize_t _sysio_doio(const struct intnl_xtvec *xtv, size_t xtvlen, + const struct iovec *iov, size_t iovlen, + ssize_t (*f)(void *, size_t, _SYSIO_OFF_T, void *), + void *arg); extern int _sysio_open(struct pnode *pno, int flags, mode_t mode); Index: module.mk =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/module.mk,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -b -B -p -r1.1 -r1.2 --- module.mk 16 Dec 2003 15:43:14 -0000 1.1 +++ module.mk 6 Feb 2004 20:07:29 -0000 1.2 @@ -1,3 +1,4 @@ INCLUDE_EXTRA = include/dev.h include/file.h include/fs.h \ include/inode.h include/mount.h include/sysio.h \ - include/sysio-symbols.h include/cplant-yod.h include/module.mk + include/sysio-symbols.h include/cplant-yod.h \ + include/module.mk include/xtio.h Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -b -B -p -r1.15 -r1.16 --- sysio.h 21 Jan 2004 14:44:53 -0000 1.15 +++ sysio.h 6 Feb 2004 20:07:29 -0000 1.16 @@ -45,6 +45,7 @@ * System IO common information. */ +#include <limits.h> #include <stdarg.h> #ifndef _IOID_T_DEFINED @@ -81,18 +82,27 @@ typedef void *ioid_t; #ifndef _LARGEFILE64_SOURCE /* - * Not glibc. Define this ourselves. + * Not glibc I guess. Define this ourselves. */ #define _LARGEFILE64_SOURCE 0 #endif /* - * Define internal file-offset type. + * Define internal file-offset type and it's maximum value. */ #if _LARGEFILE64_SOURCE #define _SYSIO_OFF_T off64_t +#ifdef LLONG_MAX +#define _SYSIO_OFF_T_MAX (LLONG_MAX) +#else +/* + * Don't have LLONG_MAX before C99. We'll need to define it ourselves. + */ +#define _SYSIO_OFF_T_MAX (9223372036854775807LL) +#endif #else #define _SYSIO_OFF_T off_t +#define _SYSIO_OFF_T_MAX LONG_MAX #endif /* @@ -127,6 +137,18 @@ struct stat; struct statvfs; struct intnl_statvfs; #endif + +/* + * Internally, all file status is carried in the 64-bit capable + * structure. + */ +#if _LARGEFILE64_SOURCE +#define intnl_xtvec xtvec64 +#else +#define intnl_xtvec xtvec +#endif +struct intnl_xtvec; + struct iovec; struct utimbuf; @@ -219,10 +241,21 @@ extern int iodone(ioid_t ioid); extern ssize_t iowait(ioid_t ioid); extern int iodone(ioid_t ioid); extern ioid_t ipreadv(int fd, const struct iovec *iov, size_t count, - _SYSIO_OFF_T offset); -extern ioid_t ipread(int fd, void *buf, size_t count, _SYSIO_OFF_T offset); + off_t offset); +#if _LARGEFILE64_SOURCE +extern ioid_t ipread64v(int fd, const struct iovec *iov, size_t count, + off64_t offset); +#endif +extern ioid_t ipread(int fd, void *buf, size_t count, off_t offset); +#if _LARGEFILE64_SOURCE +extern ioid_t ipread64(int fd, void *buf, size_t count, off64_t offset); +#endif extern ssize_t preadv(int fd, const struct iovec *iov, size_t count, - _SYSIO_OFF_T offset); + off_t offset); +#if _LARGEFILE64_SOURCE +extern ssize_t pread64v(int fd, const struct iovec *iov, size_t count, + off64_t offset); +#endif extern ssize_t pread(int fd, void *buf, size_t count, off_t offset); #if _LARGEFILE64_SOURCE extern ssize_t pread64(int fd, void *buf, size_t count, off64_t offset); @@ -231,15 +264,22 @@ extern ioid_t ireadv(int fd, const struc extern ioid_t iread(int fd, void *buf, size_t count); extern ssize_t readv(int fd, const struct iovec *iov, int count); extern ssize_t read(int fd, void *buf, size_t count); +extern ioid_t ipwritev(int fd, const struct iovec *iov, size_t count, + off_t offset); #if _LARGEFILE64_SOURCE -extern ssize_t read64(int fd, void *buf, size_t count); +extern ioid_t ipwrite64v(int fd, const struct iovec *iov, size_t count, + off64_t offset); +#endif +extern ioid_t ipwrite(int fd, const void *buf, size_t count, off_t offset); +#if _LARGEFILE64_SOURCE +extern ioid_t ipwrite64(int fd, const void *buf, size_t count, off64_t offset); #endif -extern ioid_t ipwritev(int fd, const struct iovec *iov, size_t count, - _SYSIO_OFF_T offset); -extern ioid_t ipwrite(int fd, const void *buf, size_t count, - _SYSIO_OFF_T offset); extern ssize_t pwritev(int fd, const struct iovec *iov, size_t count, - _SYSIO_OFF_T offset); + off_t offset); +#if _LARGEFILE64_SOURCE +extern ssize_t pwrite64v(int fd, const struct iovec *iov, size_t count, + off64_t offset); +#endif extern ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset); #if _LARGEFILE64_SOURCE extern ssize_t pwrite64(int fd, const void *buf, size_t count, off64_t offset); @@ -248,9 +288,6 @@ extern ioid_t iwritev(int fd, const stru extern ioid_t iwrite(int fd, const void *buf, size_t count); extern ssize_t writev(int fd, const struct iovec *iov, int count); extern ssize_t write(int fd, const void *buf, size_t count); -#if _LARGEFILE64_SOURCE -extern ssize_t write64(int fd, const void *buf, size_t count); -#endif extern int mknod(const char *path, mode_t mode, dev_t dev); extern int utime(const char *path, const struct utimbuf *buf); extern int mount(const char *source, const char *target, |