libsysio-commit Mailing List for libsysio
Brought to you by:
lward
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(25) |
May
(28) |
Jun
(25) |
Jul
(30) |
Aug
(60) |
Sep
(52) |
Oct
(100) |
Nov
(15) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(89) |
Feb
(48) |
Mar
(22) |
Apr
(59) |
May
(16) |
Jun
(15) |
Jul
(50) |
Aug
(26) |
Sep
(40) |
Oct
(27) |
Nov
(12) |
Dec
|
2005 |
Jan
(24) |
Feb
(11) |
Mar
|
Apr
|
May
(3) |
Jun
(6) |
Jul
|
Aug
(14) |
Sep
(21) |
Oct
(10) |
Nov
|
Dec
|
2006 |
Jan
(8) |
Feb
(5) |
Mar
(2) |
Apr
(6) |
May
(11) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2007 |
Jan
(3) |
Feb
(5) |
Mar
(20) |
Apr
(41) |
May
(21) |
Jun
(3) |
Jul
(5) |
Aug
(12) |
Sep
(21) |
Oct
(5) |
Nov
(16) |
Dec
|
2008 |
Jan
|
Feb
(2) |
Mar
(4) |
Apr
(23) |
May
|
Jun
(22) |
Jul
(13) |
Aug
|
Sep
|
Oct
(9) |
Nov
(3) |
Dec
(13) |
2009 |
Jan
(14) |
Feb
(10) |
Mar
(2) |
Apr
(11) |
May
(7) |
Jun
(1) |
Jul
(1) |
Aug
(36) |
Sep
(12) |
Oct
|
Nov
|
Dec
(10) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Lee W. <lw...@us...> - 2014-09-12 00:29:16
|
Update of /cvsroot/libsysio/libsysio/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20116 Modified Files: Makefile.am Added Files: test_acopy.c Log Message: Added asynchronous IO copy file test and changed the Makefile to build it.. --- NEW FILE --- /* * This Cplant(TM) source code is the property of Sandia National * Laboratories. * * This Cplant(TM) source code is copyrighted by Sandia National * Laboratories. * * The redistribution of this Cplant(TM) source code is subject to the * terms of the GNU Lesser General Public License * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html) * * Cplant(TM) Copyright 1998-2014 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 * Government. */ /* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Questions or comments about this library should be sent to: * * Lee Ward * Sandia National Laboratories, New Mexico * P.O. Box 5800 * Albuquerque, NM 87185-1110 * * le...@sa... */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <sys/uio.h> #include <sys/queue.h> #include <getopt.h> #if defined(SYSIO_LABEL_NAMES) #include "sysio.h" #endif #include "xtio.h" #include "test.h" /* * Copy one file to another. * * Usage: test_copy [-o] <src> <dest> * * Destination will not be overwritten if it already exist. */ static int overwrite = 0; /* over-write? */ static unsigned nrqst = 8; static size_t bufsiz = 64 * 1024; void usage(void); int copy_file(const char *spath, const char *dpath); int main(int argc, char * const argv[]) { int i; int err; const char *spath, *dpath; /* * Parse command-line args. */ while ((i = getopt(argc, argv, "o" )) != -1) switch (i) { case 'o': overwrite = 1; break; default: usage(); } if (!(argc - optind)) usage(); err = _test_sysio_startup(); if (err) { errno = -err; perror("sysio startup"); exit(1); } /* * Source */ spath = argv[optind++]; if (!(argc - optind)) usage(); /* * Destination */ dpath = argv[optind++]; if (argc - optind) usage(); err = copy_file(spath, dpath); _test_sysio_shutdown(); return err; } void usage() { (void )fprintf(stderr, "Usage: test_copy " " source destination\n"); exit(1); } int open_file(const char *path, int flags, mode_t mode) { int fd; fd = SYSIO_INTERFACE_NAME(open)(path, flags, mode); if (fd < 0) perror(path); return fd; } static long gcd(long a, long b) { long c; if (a < 0) a = -a; if (b < 0) b = -b; if (a < b) { c = a; a = b; b = c; } while ((c = a % b)) { a = b; b = c; } return b; } static long lcm(long a, long b) { if (a < 0) a = -a; if (b < 0) b = -b; a /= gcd(a, b); if (LONG_MAX / a < b) { errno = ERANGE; return -1; } return a * b; } struct request { const char *path; int fd; char *buf; size_t len; size_t remain; off_t off; ioid_t ioid; }; int copy_file(const char *spath, const char *dpath) { int sfd, dfd; int flags; int rtn; struct stat stat; long l; size_t siz, tmp; off_t tail, nxttail; struct request *requests, *rqst; unsigned n, u, count, nxtu; ssize_t cc; ioid_t (*f)(int, void *, size_t, off_t); sfd = dfd = -1; requests = NULL; rtn = -1; sfd = open_file(spath, O_RDONLY, 0); if (sfd < 0) goto out; flags = O_CREAT|O_WRONLY; if (!overwrite) flags |= O_EXCL; dfd = open_file(dpath, flags, 0666); if (dfd < 0) goto out; rtn = SYSIO_INTERFACE_NAME(fstat)(dfd, &stat); if (rtn != 0) { perror(dpath); goto out; } l = (long )stat.st_blksize; rtn = SYSIO_INTERFACE_NAME(fstat)(sfd, &stat); if (rtn != 0) { perror(dpath); goto out; } if ((l = lcm(l, (long )stat.st_blksize)) < 0 || (l = lcm(l, (long )bufsiz)) < 0) { perror("Can't calculate required buffer size"); goto out; } siz = l; if (siz != bufsiz) (void )fprintf(stderr, "Buffer size reset to %zu\n", siz); requests = malloc(nrqst * sizeof(struct request)); if (requests == NULL) { perror(dpath); goto out; } count = 0; tail = 0; n = nrqst; for (u = 0, rqst = requests; u < n; u++, rqst++) { if (!(tail < stat.st_size)) break; rqst->buf = malloc(siz); if (rqst->buf == NULL) { perror("Cannot allocate request buffer"); break; } rqst->fd = sfd; rqst->remain = rqst->len = siz; rqst->off = tail; tail += siz; rqst->ioid = SYSIO_INTERFACE_NAME(ipread)(rqst->fd, rqst->buf, siz, rqst->off); if (rqst->ioid == IOID_FAIL) { perror(spath); break; } count++; } n = u; nxtu = 0; while (count) { u = nxtu++; if (!(nxtu < n)) nxtu = 0; rqst = &requests[u]; if (rqst->ioid == IOID_FAIL) continue; if (!SYSIO_INTERFACE_NAME(iodone)(rqst->ioid)) continue; cc = SYSIO_INTERFACE_NAME(iowait)(rqst->ioid); count--; rqst->ioid = IOID_FAIL; if (cc < 0) { perror(rqst->fd == sfd ? spath : dpath); continue; } nxttail = tail; rqst->remain -= (size_t )cc; if (rqst->fd == dfd) { do { if (rqst->remain) break; rqst->fd = sfd; rqst->remain = rqst->len = siz; rqst->off = tail; nxttail += siz; } while (0); if (!(rqst->off < stat.st_size)) { assert(rqst->fd == sfd); continue; } } else { assert(rqst->fd == sfd); if (!(cc || rqst->len - rqst->remain)) continue; do { if (rqst->remain && cc) break; rqst->fd = dfd; rqst->remain = rqst->len = siz - rqst->remain; } while (0); } tmp = rqst->len - rqst->remain; if (rqst->fd == sfd) f = (ioid_t (*)(int, void *, size_t, off_t))SYSIO_INTERFACE_NAME(ipread); else f = (ioid_t (*)(int, void *, size_t, off_t))SYSIO_INTERFACE_NAME(ipwrite); rqst->ioid = (*f)(rqst->fd, (char *)rqst->buf + tmp, rqst->remain, rqst->off + tmp); if (rqst->ioid == IOID_FAIL) { perror(rqst->fd == sfd ? spath : dpath); assert(0); continue; } tail = nxttail; count++; } out: if (requests != NULL) { for (u = 0, rqst = requests; u < n; u++, rqst++) { assert(rqst->ioid == IOID_FAIL); free(rqst->buf); } free(requests); } if (sfd >= 0 && SYSIO_INTERFACE_NAME(close)(sfd) != 0) perror(spath); if (dfd >= 0 && (SYSIO_INTERFACE_NAME(fsync)(dfd) != 0 || SYSIO_INTERFACE_NAME(close)(dfd) != 0)) perror(dpath); return 0; } Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/Makefile.am,v retrieving revision 1.36 retrieving revision 1.37 diff -u -w -b -B -p -r1.36 -r1.37 --- Makefile.am 17 Aug 2009 23:37:08 -0000 1.36 +++ Makefile.am 12 Sep 2014 00:29:11 -0000 1.37 @@ -12,7 +12,7 @@ else FHI_PROG= endif -noinst_PROGRAMS = test_copy test_stats test_path test_list \ +noinst_PROGRAMS = test_copy test_acopy test_stats test_path test_list \ test_getcwd test_link test_unlink test_symlink \ test_rename test_regions test_stddir test_fcntl_lock test_mknod \ test_mkdir test_chown $(STATVFS_PROG) $(FHI_PROG) @@ -51,6 +51,10 @@ test_copy_SOURCES=test_copy.c $(CMNSRC) test_copy_CFLAGS=$(CFL) test_copy_DEPENDENCIES=$(LIBS) +test_acopy_SOURCES=test_acopy.c $(CMNSRC) +test_acopy_CFLAGS=$(CFL) +test_acopy_DEPENDENCIES=$(LIBS) + test_stats_SOURCES=test_stats.c $(CMNSRC) test_stats_CFLAGS=$(CFL) test_stats_DEPENDENCIES=$(LIBS) |
From: Lee W. <lw...@us...> - 2010-07-16 12:16:46
|
Update of /cvsroot/libsysio/libsysio/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv19833 Modified Files: file.c Log Message: Fixed format in a cprintf, it had a missing percent-sign. Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -w -b -B -p -r1.25 -r1.26 --- file.c 6 Dec 2008 18:29:13 -0000 1.25 +++ file.c 16 Jul 2010 12:16:20 -0000 1.26 @@ -114,9 +114,10 @@ _sysio_fgone(struct file *fil) PATH_SEPARATOR, &path) != 0) path = error_path; - _sysio_cprintf("[lu]\"%s\" pnode won't close (%d)\n", + _sysio_cprintf("[%lu]\"%s\" pnode won't close (%d)\n", fil->f_pno->p_mount->mnt_fs->fs_id, - path); + path, + err); if (path != error_path) free(path); break; |
From: Lee W. <le...@sa...> - 2009-12-17 17:45:41
|
Sorry, just did a commit from a box without mail. Fixed 32-bit internal builds to support 64-bit external interfaces for getdirentries64 and fhi_getdirentries64. See the status for both files for the full message. --Lee |
From: Lee W. <lw...@us...> - 2009-12-17 17:41:28
|
Update of /cvsroot/libsysio/libsysio/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20980/src Modified Files: getdirentries.c Log Message: Fixed for 32-bit build. The 64-bit getdirentries routines in both the regular source and the file handles interface assumed 64-bit _SYSIO_OFF_T. Fixed, now. They will return (-1, EINVAL) if given a base pointer outside what is supported by the internal offset. Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 2.1 retrieving revision 2.2 diff -u -w -b -B -p -r2.1 -r2.2 --- getdirentries.c 25 Sep 2009 22:23:29 -0000 2.1 +++ getdirentries.c 17 Dec 2009 17:41:17 -0000 2.2 @@ -255,10 +255,26 @@ static ssize_t PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries64))(int fd, char *buf, size_t nbytes, - off_t * __restrict basep) + off64_t * __restrict basep) { + _SYSIO_OFF_T ibase; + ssize_t cc; + + ibase = *basep; + if (ibase != *basep) { + errno = EINVAL; + return -1; + } - return getdirentries_common(fd, buf, nbytes, basep, (filldir_t )filldir64); + cc = + getdirentries_common(fd, + buf, + nbytes, + &ibase, + (filldir_t )filldir64); + if (cc >= 0) + *basep = ibase; + return cc; } #undef getdirentries64 |
From: Lee W. <lw...@us...> - 2009-12-17 17:41:26
|
Update of /cvsroot/libsysio/libsysio/misc In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20980/misc Modified Files: fhi.c Log Message: Fixed for 32-bit build. The 64-bit getdirentries routines in both the regular source and the file handles interface assumed 64-bit _SYSIO_OFF_T. Fixed, now. They will return (-1, EINVAL) if given a base pointer outside what is supported by the internal offset. Index: fhi.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/misc/fhi.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- fhi.c 7 Dec 2009 22:00:23 -0000 1.10 +++ fhi.c 17 Dec 2009 17:41:17 -0000 1.11 @@ -1031,8 +1031,9 @@ ssize_t SYSIO_INTERFACE_NAME(fhi_getdirentries64)(struct file_handle_info *fhi, char *buf, size_t nbytes, - off_t * __restrict basep) + off64_t * __restrict basep) { + _SYSIO_OFF_T ibase; struct pnode *pno; int err; ssize_t cc; @@ -1045,6 +1046,11 @@ SYSIO_INTERFACE_NAME(fhi_getdirentries64 basep); do { + ibase = *basep; + if (ibase != *basep) { + cc =- EINVAL; + break; + } err = find_alias(fhi, &pno); if (err) { cc = -ESTALE; @@ -1054,10 +1060,13 @@ SYSIO_INTERFACE_NAME(fhi_getdirentries64 cc = _sysio_open(pno, O_RDONLY, 0); if (cc) break; - cc = _sysio_p_filldirentries(pno, buf, nbytes, basep); + cc = _sysio_p_filldirentries(pno, buf, nbytes, &ibase); if (PNOP_CLOSE(pno) != 0) abort(); P_PUT(pno); + if (cc < 0) + break; + *basep = ibase; } while (0); SYSIO_INTERFACE_RETURN(cc, |
From: Lee W. <lw...@us...> - 2009-12-07 22:00:40
|
Update of /cvsroot/libsysio/libsysio/dev In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv2260/dev Modified Files: stddev.c 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: stddev.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/dev/stddev.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- stddev.c 24 Jun 2009 15:38:51 -0000 1.4 +++ stddev.c 7 Dec 2009 22:00:22 -0000 1.5 @@ -83,7 +83,7 @@ _sysio_stddev_init() stddev_operations.inop_read = stddev_read; stddev_operations.inop_write = stddev_write; stddev_operations.inop_iodone = stddev_iodone; - stddev_operations.inop_datasync = stddev_datasync; + stddev_operations.inop_old_datasync = stddev_datasync; stddev_operations.inop_ioctl = stddev_ioctl; mjr = |
From: Lee W. <lw...@us...> - 2009-12-07 22:00:39
|
Update of /cvsroot/libsysio/libsysio/dev/stdfd In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv2260/dev/stdfd Modified Files: stdfd.c 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: stdfd.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/dev/stdfd/stdfd.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -w -b -B -p -r1.17 -r1.18 --- stdfd.c 15 Oct 2008 22:01:01 -0000 1.17 +++ stdfd.c 7 Dec 2009 22:00:23 -0000 1.18 @@ -91,7 +91,7 @@ _sysio_stdfd_init() stdfd_operations.inop_write = stdfd_write; stdfd_operations.inop_iodone = stdfd_iodone; stdfd_operations.inop_fcntl = stdfd_fcntl; - stdfd_operations.inop_datasync = stdfd_datasync; + stdfd_operations.inop_old_datasync = stdfd_datasync; stdfd_operations.inop_ioctl = stdfd_ioctl; mjr = |
From: Lee W. <lw...@us...> - 2009-12-07 22:00:38
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv2260/drivers/native Modified Files: fs_native.c 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: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.73 retrieving revision 1.74 diff -u -w -b -B -p -r1.73 -r1.74 --- fs_native.c 21 Sep 2009 18:29:38 -0000 1.73 +++ fs_native.c 7 Dec 2009 22:00:23 -0000 1.74 @@ -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... */ @@ -217,7 +217,9 @@ static struct inode_ops native_i_ops = { native_inop_pos, native_inop_iodone, native_inop_fcntl, + NULL, native_inop_sync, + NULL, native_inop_datasync, native_inop_ioctl, native_inop_mknod, |
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_ */ |
From: Lee W. <lw...@us...> - 2009-12-07 22:00:34
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv2260/drivers/incore Modified Files: fs_incore.c 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: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -w -b -B -p -r1.38 -r1.39 --- fs_incore.c 5 May 2009 16:35:29 -0000 1.38 +++ fs_incore.c 7 Dec 2009 22:00:23 -0000 1.39 @@ -205,7 +205,9 @@ static struct inode_ops _sysio_incore_di _sysio_incore_dirop_pos, _sysio_incore_dirop_iodone, _sysio_incore_dirop_fcntl, + NULL, _sysio_incore_inop_sync, + NULL, _sysio_incore_inop_sync, _sysio_incore_dirop_ioctl, _sysio_incore_dirop_mknod, @@ -262,7 +264,9 @@ static struct inode_ops _sysio_incore_fi _sysio_incore_filop_pos, _sysio_incore_filop_iodone, _sysio_incore_filop_fcntl, + NULL, _sysio_incore_inop_sync, + NULL, _sysio_incore_inop_sync, _sysio_incore_filop_ioctl, _sysio_incore_filop_mknod, @@ -293,7 +297,9 @@ static struct inode_ops _sysio_incore_de _sysio_nodev_inop_pos, _sysio_nodev_inop_iodone, _sysio_incore_filop_fcntl, + NULL, _sysio_incore_inop_sync, + NULL, _sysio_nodev_inop_sync, _sysio_nodev_inop_ioctl, _sysio_incore_filop_mknod, |
From: Lee W. <lw...@us...> - 2009-12-07 22:00:33
|
Update of /cvsroot/libsysio/libsysio/misc In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv2260/misc Modified Files: fhi.c 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: fhi.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/misc/fhi.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- fhi.c 21 Sep 2009 14:53:05 -0000 1.9 +++ fhi.c 7 Dec 2009 22:00:23 -0000 1.10 @@ -637,6 +637,7 @@ iio64x(int (*f)(struct ioctx *), iov, iov_count, NULL, xtv, xtv_count, NULL, NULL, NULL, + NULL, ioctxp); if (err) { if (err == -EBADF) |
From: Lee W. <lw...@us...> - 2009-12-07 22:00:33
|
Update of /cvsroot/libsysio/libsysio/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv2260/src Modified Files: dev.c fsync.c inode.c ioctx.c rw.c 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: dev.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dev.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -b -B -p -r1.15 -r1.16 --- dev.c 5 May 2009 16:35:29 -0000 1.15 +++ dev.c 7 Dec 2009 22:00:24 -0000 1.16 @@ -72,7 +72,9 @@ const struct inode_ops _sysio_nodev_ops _sysio_nodev_inop_pos, _sysio_nodev_inop_iodone, _sysio_nodev_inop_fcntl, + NULL, _sysio_nodev_inop_sync, + NULL, _sysio_nodev_inop_datasync, _sysio_nodev_inop_ioctl, _sysio_nodev_inop_mknod, Index: fsync.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fsync.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- fsync.c 17 Jun 2008 17:18:57 -0000 1.12 +++ fsync.c 7 Dec 2009 22:00:24 -0000 1.13 @@ -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-2007 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... */ @@ -50,17 +50,63 @@ #include <sys/queue.h> #include "sysio.h" +#include "xtio.h" #include "inode.h" #include "file.h" -int -SYSIO_INTERFACE_NAME(fsync)(int fd) +struct fake_args { + int (*f)(struct pnode *); +}; + +static int +fakeit(struct ioctx *ioctx) +{ + struct fake_args *f; + + f = ioctx->ioctx_args; + ioctx->ioctx_cc = (*(f->f))(ioctx->ioctx_pno); + ioctx->ioctx_done = 1; + + return 0; +} + +static int +_sysio_p_sync(struct pnode *pno, struct ioctx **ioctxp) +{ + void *args; + struct fake_args fake; + int (*f)(struct ioctx *); + int err; + + args = NULL; + if (pno->p_base->pb_ino->i_ops.inop_isync) + f = PNOP_FUNC(pno, isync); + else { + f = fakeit; + fake.f = PNOP_FUNC(pno, old_sync); + args = &fake; + } + err = + _sysio_p_iiox(f, + pno, + -1, + NULL, 0, NULL, + NULL, 0, NULL, + NULL, NULL, + args, + ioctxp); + return err; +} + +ioid_t +SYSIO_INTERFACE_NAME(ifsync)(int fd) { int err; struct file *fil; + struct ioctx *ioctx; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(fsync, "%d", fd); + SYSIO_INTERFACE_ENTER(ifsync, "%d", fd); err = 0; do { fil = _sysio_fd_find(fd); @@ -68,20 +114,60 @@ SYSIO_INTERFACE_NAME(fsync)(int fd) err = -EBADF; if (err) break; - err = PNOP_SYNC(fil->f_pno); + err = _sysio_p_sync(fil->f_pno, &ioctx); FIL_PUT(fil); } while (0); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fsync, "%d", 0); + SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, err, ifsync, "%p", 0); } int -SYSIO_INTERFACE_NAME(fdatasync)(int fd) +SYSIO_INTERFACE_NAME(fsync)(int fd) +{ + ioid_t ioid; + + ioid = SYSIO_INTERFACE_NAME(ifsync)(fd); + if (ioid == IOID_FAIL) + return -1; + return SYSIO_INTERFACE_NAME(iowait(ioid)); +} + +static int +_sysio_p_datasync(struct pnode *pno, struct ioctx **ioctxp) +{ + void *args; + struct fake_args fake; + int (*f)(struct ioctx *); + int err; + + args = NULL; + if (pno->p_base->pb_ino->i_ops.inop_idatasync) + f = PNOP_FUNC(pno, idatasync); + else { + f = fakeit; + fake.f = PNOP_FUNC(pno, old_datasync); + args = &fake; + } + err = + _sysio_p_iiox(f, + pno, + -1, + NULL, 0, NULL, + NULL, 0, NULL, + NULL, NULL, + args, + ioctxp); + return err; +} + +ioid_t +SYSIO_INTERFACE_NAME(ifdatasync)(int fd) { int err; struct file *fil; + struct ioctx *ioctx; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(fdatasync, "%d", fd); + SYSIO_INTERFACE_ENTER(ifdatasync, "%d", fd); err = 0; do { fil = _sysio_fd_find(fd); @@ -89,8 +175,22 @@ SYSIO_INTERFACE_NAME(fdatasync)(int fd) err = -EBADF; if (err) break; - err = PNOP_DATASYNC(fil->f_pno); + err = _sysio_p_datasync(fil->f_pno, &ioctx); FIL_PUT(fil); } while (0); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fdatasync, "%d", 0); + SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, + err, + ifdatasync, + "%p", 0); +} + +int +SYSIO_INTERFACE_NAME(fdatasync)(int fd) +{ + ioid_t ioid; + + ioid = SYSIO_INTERFACE_NAME(ifdatasync)(fd); + if (ioid == IOID_FAIL) + return -1; + return SYSIO_INTERFACE_NAME(iowait(ioid)); } Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -w -b -B -p -r1.61 -r1.62 --- inode.c 22 Sep 2009 22:31:54 -0000 1.61 +++ inode.c 7 Dec 2009 22:00:24 -0000 1.62 @@ -260,7 +260,8 @@ _sysio_i_new(struct filesys *fs, operations.inop_pos = o->inop_pos; operations.inop_iodone = o->inop_iodone; operations.inop_fcntl = o->inop_fcntl; - operations.inop_datasync = o->inop_datasync; + operations.inop_old_datasync = o->inop_old_datasync; + operations.inop_idatasync = o->inop_idatasync; operations.inop_ioctl = o->inop_ioctl; } I_INIT(ino, fs, stat, &operations, fid, immunity, private); Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -w -b -B -p -r1.29 -r1.30 --- ioctx.c 11 Jul 2008 18:23:57 -0000 1.29 +++ ioctx.c 7 Dec 2009 22:00:24 -0000 1.30 @@ -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-2007 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... */ @@ -102,11 +102,11 @@ _sysio_ioctx_enter(struct ioctx *ioctx) */ 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) { struct ioctx *ioctx; @@ -120,10 +120,10 @@ _sysio_ioctx_new(struct pnode *pno, IOCTX_INIT(ioctx, 0, - wr, pno, iov, iovlen, - xtv, xtvlen); + xtv, xtvlen, + args); /* * Link request onto the outstanding requests queue. Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -w -b -B -p -r1.31 -r1.32 --- rw.c 28 Jan 2009 16:13:19 -0000 1.31 +++ rw.c 7 Dec 2009 22:00:24 -0000 1.32 @@ -72,6 +72,7 @@ _sysio_post_io(int (*f)(struct ioctx *io void (*release_xtv)(struct ioctx *, void *), void (*completio)(struct ioctx *, void *), struct file *fil, + void *args, struct ioctx **ioctxp) { struct ioctx *ioctx; @@ -85,9 +86,9 @@ _sysio_post_io(int (*f)(struct ioctx *io */ ioctx = _sysio_ioctx_new(pno, - 0, iov, iov_count, - xtv, xtv_count); + xtv, xtv_count, + args); if (ioctx == NULL) return -ENOMEM; do { @@ -161,6 +162,7 @@ _do_p_aio(int (*f)(struct ioctx *ioctx), iov, 1, free_arg, xtv, 1, free_arg, NULL, NULL, + NULL, ioctxp); } if (err) { @@ -213,10 +215,10 @@ _sysio_p_iiox(int (*f)(struct ioctx *), void (*release_xtv)(struct ioctx *, void *), void (*completio)(struct ioctx *, void *), void *data, + void *args, struct ioctx **ioctxp) { int err; - ssize_t cc; err = 0; do { @@ -233,15 +235,21 @@ _sysio_p_iiox(int (*f)(struct ioctx *), break; } + if (limit && xtv && iov) { + ssize_t cc; + /* * Valid maps? */ cc = - _sysio_validx(xtv, xtv_count, iov, iov_count, limit); + _sysio_validx(xtv, xtv_count, + iov, iov_count, + limit); if (cc < 0) { err = cc; break; } + } /* * Post the operation. */ @@ -250,7 +258,9 @@ _sysio_p_iiox(int (*f)(struct ioctx *), pno, iov, iov_count, release_iov, xtv, xtv_count, release_xtv, - completio, data, + completio, + data, + args, ioctxp); } while (0); return err; @@ -291,6 +301,7 @@ _sysio_iiox(direction writing, iov, iov_count, release_iov, xtv, xtv_count, release_xtv, completio, fil, + NULL, ioctxp); return err; } |
From: Ruth K. <rk...@us...> - 2009-09-25 22:23:59
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7793 Modified Files: getdirentries.c Log Message: need _getdirentries symbol for catamount build Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 2.0 retrieving revision 2.1 diff -u -w -b -B -p -r2.0 -r2.1 --- getdirentries.c 10 Apr 2009 21:30:02 -0000 2.0 +++ getdirentries.c 25 Sep 2009 22:23:29 -0000 2.1 @@ -173,7 +173,7 @@ _p_getdirentries(struct pnode *pno, } static ssize_t -_getdirentries(int fd, +getdirentries_common(int fd, char *buf, size_t nbytes, _SYSIO_OFF_T * __restrict basep, @@ -258,7 +258,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(getdiren off_t * __restrict basep) { - return _getdirentries(fd, buf, nbytes, basep, (filldir_t )filldir64); + return getdirentries_common(fd, buf, nbytes, basep, (filldir_t )filldir64); } #undef getdirentries64 @@ -332,7 +332,7 @@ SYSIO_INTERFACE_NAME(getdirentries)(int #endif pos = *basep; - cc = _getdirentries(fd, buf, nbytes, &pos, (filldir_t )filldir); + cc = getdirentries_common(fd, buf, nbytes, &pos, (filldir_t )filldir); if (cc > 0) *basep = pos; return _cast cc; |
From: Lee W. <lw...@us...> - 2009-09-22 22:33:47
|
Update of /cvsroot/libsysio/libsysio/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26122 Modified Files: inode.h Log Message: Depending on whether I_ASSOCIATIONS was defined the PB_SET_ASSOC macro was being built in two pretty different ways. With this change, the majority of the logic is the same and only whether or not to perform the pertinent list manipulations is different. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.62 retrieving revision 1.63 diff -u -w -b -B -p -r1.62 -r1.63 --- inode.h 9 Sep 2009 22:46:38 -0000 1.62 +++ inode.h 22 Sep 2009 22:33:37 -0000 1.63 @@ -397,6 +397,22 @@ struct pnode_base { PB_UNLOCK(_pb); \ } while (0) +#ifdef I_ASSOCIATIONS +#define _PB_ADD_ASSOC(_pb) \ + do { \ + LIST_INSERT_HEAD(&(_pb)->pb_ino->i_assoc, \ + (_pb), \ + pb_alinks); \ + } while (0) +#define _PB_REMOVE_ASSOC(_pb) \ + do { \ + LIST_REMOVE((_pb), pb_alinks); \ + } while (0) +#else +#define _PB_ADD_ASSOC(_pb) +#define _PB_REMOVE_ASSOC(_pb) +#endif + /* * Set path-base node association. * @@ -408,40 +424,22 @@ struct pnode_base { * NB(2): We no longer support re-association. Now, an association can be * set, anew, or cleared (only when destroying the path-base node. */ -#ifdef I_ASSOCIATIONS #define PB_SET_ASSOC(_pb, _ino) \ do { \ _PB_CHECK_LOCK((_pb), 1); \ if ((_pb)->pb_ino) { \ assert(!(_ino)); \ _I_CHECK_LOCK((_pb)->pb_ino, 1); \ - LIST_REMOVE((_pb), pb_alinks); \ + _PB_REMOVE_ASSOC(_pb); \ _I_RELE_NO_LOCK((_pb)->pb_ino); \ } \ (_pb)->pb_ino = (_ino); \ if ((_pb)->pb_ino) { \ _I_CHECK_LOCK((_pb)->pb_ino, 1); \ - LIST_INSERT_HEAD(&(_pb)->pb_ino->i_assoc, \ - (_pb), \ - pb_alinks); \ + _PB_ADD_ASSOC(_pb); \ _I_REF_NO_LOCK((_pb)->pb_ino); \ } \ } while (0) -#else -#define PB_SET_ASSOC(_pb, _ino) \ - do { \ - assert(!((_pb)->pb_ino && (_ino))); \ - if ((_pb)->pb_ino) { \ - _I_CHECK_LOCK((_pb)->pb_ino, 1); \ - _I_RELE_NO_LOCK((_pb)->pb_ino); \ - } \ - (_pb)->pb_ino = (_ino); \ - if ((_pb)->pb_ino) { \ - _I_CHECK_LOCK((_pb)->pb_ino, 1); \ - _I_REF_NO_LOCK((_pb)->pb_ino); \ - } \ - } while (0) -#endif /* * Since a file system may be multiply mounted, in different parts of the local |
From: Lee W. <lw...@us...> - 2009-09-22 22:32:11
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25491/src Modified Files: inode.c Log Message: There was an ifdef dependent on I_ASSOCIATIIONS. Notice anything funny about that? Fixed the typo and it builds with the to-be-included code now. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -w -b -B -p -r1.60 -r1.61 --- inode.c 18 Sep 2009 20:23:16 -0000 1.60 +++ inode.c 22 Sep 2009 22:31:54 -0000 1.61 @@ -304,7 +304,7 @@ _sysio_i_gone(struct inode *ino) if (ino->i_ref) abort(); -#ifdef I_ASSOCIATIIONS +#ifdef I_ASSOCIATIONS assert(!I_ISASSOC(ino)); #endif if (!ino->i_zombie) |
From: Lee W. <lw...@us...> - 2009-09-21 21:30:53
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14094/src Modified Files: mount.c Log Message: In the submount routine, at the end we were releasing the pnode we just tried to cover. That should have been a PUT. It is now :) Index: mount.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mount.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -w -b -B -p -r1.33 -r1.34 --- mount.c 31 Aug 2009 21:38:29 -0000 1.33 +++ mount.c 21 Sep 2009 21:30:42 -0000 1.34 @@ -538,7 +538,7 @@ _sysio_sub_fsswop_mount(const char *sour FS_REF(nameidata.nd_pno->p_mount->mnt_fs); *mntp = mnt; } - P_RELE(nameidata.nd_pno); + P_PUT(nameidata.nd_pno); return err; } |
From: Lee W. <lw...@us...> - 2009-09-21 18:29:48
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17853/drivers/native Modified Files: fs_native.c Log Message: Split native_stat into two functions. One works as before. The other, native_simple_stat just does a stat and returns the result in the passed buffer, updating no existing records. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -w -b -B -p -r1.72 -r1.73 --- fs_native.c 5 May 2009 16:35:29 -0000 1.72 +++ fs_native.c 21 Sep 2009 18:29:38 -0000 1.73 @@ -262,41 +262,48 @@ static struct mount *native_internal_mou #define I2NI(ino) ((struct native_inode *)((ino)->i_private)) /* - * stat -- by path. + * Simple stat of path or file. */ static int -native_stat(const char *path, - struct inode *ino, - time_t t, - struct intnl_stat *buf) +native_simple_stat(const char *path, struct inode *ino, struct intnl_stat *buf) { - struct native_inode *nino; int err; + struct native_inode *nino; struct _sysio_native_stat stbuf; - nino = ino ? I2NI(ino) : NULL; - if (path) err = syscall(SYSIO_SYS_stat, path, &stbuf); - else if (nino && nino->ni_fd >= 0) + else if ((nino = ino ? I2NI(ino) : NULL) && nino->ni_fd >= 0) err = syscall(SYSIO_SYS_fstat, nino->ni_fd, &stbuf); else abort(); - if (err) { - if (nino) - nino->ni_attrtim = 0; + if (err) return -errno; - } - if (nino) { - nino->ni_attrtim = t; - SYSIO_COPY_STAT(&stbuf, &ino->i_stbuf); - if (buf) - *buf = ino->i_stbuf; + SYSIO_COPY_STAT(&stbuf, buf); return 0; } + +/* + * stat -- by path. + */ +static int +native_stat(const char *path, + struct inode *ino, + time_t t, + struct intnl_stat *buf) +{ + struct intnl_stat mybuf; + int err; + if (!buf) - return 0; - SYSIO_COPY_STAT(&stbuf, buf); + buf = &mybuf; + err = native_simple_stat(path, ino, buf); + if (err) + t = 0; + else if (ino) + ino->i_stbuf = *buf; + if (ino) + I2NI(ino)->ni_attrtim = t; return 0; } @@ -607,33 +614,28 @@ native_ibind(struct filesys *fs, time_t t, struct inode **inop) { - struct intnl_stat ostbuf, stbuf; + struct intnl_stat buf; int err; struct inode *ino; - if (*inop) - ostbuf = (*inop)->i_stbuf; - - err = native_stat(path, *inop, t, &stbuf); + err = native_simple_stat(path, *inop, &buf); if (err) return err; - - /* - * Validate? - */ + t += FS2NFS(fs)->nfs_atimo; if (*inop) { - if (!native_i_invalid(*inop, &ostbuf)) - return 0; /* - * Invalidate. + * Revalidate. */ + if (!native_i_invalid(*inop, &buf)) { + (*inop)->i_stbuf = buf; + I2NI(*inop)->ni_attrtim = t; + return 0; + } _sysio_i_undead(*inop); *inop = NULL; } - - if (!(ino = native_iget(fs, t + FS2NFS(fs)->nfs_atimo, &stbuf))) + if (!(ino = native_iget(fs, t, &buf))) return -ENOMEM; - *inop = ino; return 0; } @@ -876,7 +878,11 @@ out: /* * We must refresh the cached attributes. */ - if (!err && native_stat(path, ino, _SYSIO_LOCAL_TIME(), NULL) != 0) + if (!err && + native_stat(path, + ino, + _SYSIO_LOCAL_TIME() + FS2NFS(ino->i_fs)->nfs_atimo, + NULL) != 0) abort(); if (path) free(path); |
From: Lee W. <lw...@us...> - 2009-09-21 18:15:34
|
Update of /cvsroot/libsysio/libsysio/tests In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15077 Modified Files: test_path.c Log Message: Make lint happy. The char count variable is only used for symlinks but lint can't tell. Just initialize it always. Index: test_path.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_path.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- test_path.c 28 Mar 2007 21:27:12 -0000 1.14 +++ test_path.c 21 Sep 2009 18:15:21 -0000 1.15 @@ -198,6 +198,7 @@ statit(const char *path) /* * Print path and type. */ + cc = 0; if (S_ISLNK(stbuf.st_mode)) { cc = SYSIO_INTERFACE_NAME(readlink)(path, buf, sizeof(buf)); if (cc < 0) { |
From: Lee W. <lw...@us...> - 2009-09-21 14:46:31
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21071/src Modified Files: reconcile.c Log Message: Modified to pass lint checks. There was a claim that a field in a record was possibly used before initialization. The reality was that enough of the record was initialized to cause the rest to be superfluous at initialization. Lint couldn't tell, of course, so we just initialize the entire record now. Index: reconcile.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/reconcile.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -b -B -p -r1.1 -r1.2 --- reconcile.c 25 Oct 2004 14:29:16 -0000 1.1 +++ reconcile.c 21 Sep 2009 14:46:21 -0000 1.2 @@ -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... */ @@ -86,15 +86,14 @@ _sysio_validx(const struct intnl_xtvec * _SYSIO_OFF_T limit) { ssize_t acc, cc; - struct iovec iovec; - struct intnl_xtvec xtvec; + struct iovec iovec = { NULL, 0 }; + struct intnl_xtvec xtvec = { 0, 0 }; _SYSIO_OFF_T off; if (!(xtvlen && iovlen)) return -EINVAL; acc = 0; - xtvec.xtv_len = iovec.iov_len = 0; do { while (!xtvec.xtv_len) { if (!xtvlen--) |
From: Ruth K. <rk...@us...> - 2009-09-18 20:23:27
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28263 Modified Files: inode.c Log Message: fix obsolete reference to lh_first in PB_DEBUG code block Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -w -b -B -p -r1.59 -r1.60 --- inode.c 31 Aug 2009 21:46:09 -0000 1.59 +++ inode.c 18 Sep 2009 20:23:16 -0000 1.60 @@ -533,7 +533,7 @@ _sysio_pb_new(struct qstr *name, struct if (pb->pb_key.pbk_parent) { #if defined(PB_DEBUG) - if (!parent->pb_children.lh_first) { + if (!parent->pb_children) { /* * The parent is no longer a leaf. We * need to remove it from that list. |
From: Ruth K. <rk...@us...> - 2009-09-18 20:16:49
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27528 Modified Files: namei.c Log Message: ND_NXMNT prevents traversal of a mount, so, automounts are not helpful in the presence of this flag. Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -w -b -B -p -r1.36 -r1.37 --- namei.c 20 Aug 2009 01:06:01 -0000 1.36 +++ namei.c 18 Sep 2009 20:16:37 -0000 1.37 @@ -348,7 +348,7 @@ _sysio_path_walk(struct pnode *parent, s ino = nd->nd_pno->p_base->pb_ino; } #ifdef AUTOMOUNT_FILE_NAME - else if ((nd->nd_flags & ND_NXMNT) && + else if (!(nd->nd_flags & ND_NXMNT) && ino && nd->nd_amcnt < MAX_MOUNT_DEPTH && S_ISDIR(ino->i_stbuf.st_mode) && |
From: Lee W. <lw...@us...> - 2009-09-11 06:23:54
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24374 Modified Files: open.c Log Message: In open, parent was always being put when we were done with it. This should only have been done when the lock was acquired. I.e., it's only needed when ND_WANTPARENT was passed to namei. Fixed. Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -w -b -B -p -r1.35 -r1.36 --- open.c 4 Aug 2009 15:01:24 -0000 1.35 +++ open.c 11 Sep 2009 06:23:42 -0000 1.36 @@ -179,6 +179,7 @@ SYSIO_INTERFACE_NAME(open)(const char *p * Ask for the open/creat. */ rtn = _sysio_open(pno, flags, mode); + if (ndflags & ND_WANTPARENT) P_PUT(pno->p_parent); if (rtn) goto error; |
From: Lee W. <lw...@us...> - 2009-09-10 20:38:50
|
Update of /cvsroot/libsysio/libsysio/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9553/include Modified Files: sysio-cmn.h Log Message: The biglock symbol was not being exported unless SYSIO_TRACING was defined. Moved it out of the dependent block and pulled SYSIO_{ENTER,LEAVE} out as well. Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -w -b -B -p -r1.21 -r1.22 --- sysio-cmn.h 4 Feb 2009 20:07:23 -0000 1.21 +++ sysio-cmn.h 10 Sep 2009 20:38:39 -0000 1.22 @@ -271,12 +271,9 @@ extern void _sysio_run_trace_q(void *q, const char *fmt, ...); -extern mutex_t _sysio_biglock; - -/* Interface enter/leave hook functions */ -#define SYSIO_ENTER(tag, fmt, ...) \ +/* Trace enter/leave hook functions */ +#define _SYSIO_TRACE_ENTER(tag, fmt, ...) \ do { \ - mutex_lock(&_sysio_biglock); \ _sysio_run_trace_q(_sysio_entry_trace_q, \ __FILE__, __func__, __LINE__, \ SYSIO_TTAG(tag), \ @@ -284,23 +281,36 @@ extern mutex_t _sysio_biglock; __VA_ARGS__); \ } while (0) -#define SYSIO_LEAVE(tag, fmt, ...) \ +#define _SYSIO_TRACE_LEAVE(tag, fmt, ...) \ do { \ _sysio_run_trace_q(_sysio_exit_trace_q, \ __FILE__, __func__, __LINE__, \ SYSIO_TTAG(tag), \ (fmt), \ __VA_ARGS__); \ - mutex_unlock(&_sysio_biglock); \ } while (0) #else /* !defined(SYSIO_TRACING) */ -#define SYSIO_ENTER(tag, fmt, ...) \ +#define _SYSIO_TRACE_ENTER(tag, fmt, ...) \ do { } while (0) -#define SYSIO_LEAVE(tag, fmt, ...) \ +#define _SYSIO_TRACE_LEAVE(tag, fmt, ...) \ do { } while (0) #endif /* !defined(SYSIO_TRACING) */ +extern mutex_t _sysio_biglock; + +/* Interface enter/leave hook functions */ +#define SYSIO_ENTER(tag, fmt, ...) \ + do { \ + mutex_lock(&_sysio_biglock); \ + _SYSIO_TRACE_ENTER(tag, fmt, __VA_ARGS__); \ + } while (0) +#define SYSIO_LEAVE(tag, fmt, ...) \ + do { \ + _SYSIO_TRACE_LEAVE(tag, fmt, __VA_ARGS__); \ + mutex_unlock(&_sysio_biglock); \ + } while (0) + /* Accounting for IO stats; Read and write character count. */ #if defined(REDSTORM) #define _SYSIO_UPDACCT(w, cc) \ |
From: Lee W. <lw...@us...> - 2009-09-09 22:46:51
|
Update of /cvsroot/libsysio/libsysio/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31444/include Modified Files: inode.h Log Message: Reformatted to fit style and tab widths in the rest of the source. No functional changes. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.61 retrieving revision 1.62 diff -u -w -b -B -p -r1.61 -r1.62 --- inode.h 31 Aug 2009 21:38:29 -0000 1.61 +++ inode.h 9 Sep 2009 22:46:38 -0000 1.62 @@ -78,9 +78,7 @@ struct ioctx; typedef int (*filldir_t)(void *, ino_t, _SYSIO_OFF_T, - const char *, - size_t, - unsigned char); + const char *, size_t, unsigned char); /* * Operations on i-nodes. @@ -115,17 +113,22 @@ struct inode_ops { int (*inop_rename)(struct pnode *old, struct pnode *new); int (*inop_read)(struct ioctx *ioctx); int (*inop_write)(struct ioctx *ioctx); - _SYSIO_OFF_T (*inop_pos)(struct pnode *pno, _SYSIO_OFF_T off); + _SYSIO_OFF_T \ + (*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_ioctl)(struct pnode *pno, unsigned long int request, va_list ap); + int (*inop_ioctl)(struct pnode *pno, + unsigned long int request, + va_list ap); int (*inop_mknod)(struct pnode *pno, mode_t mode, dev_t dev); #ifdef _HAVE_STATVFS int (*inop_statvfs)(struct pnode *pno, struct intnl_statvfs *buf); #endif - int (*inop_perms_check)(struct pnode *pno, int amode, int effective); + int (*inop_perms_check)(struct pnode *pno, + int amode, + int effective); void (*inop_gone)(struct inode *ino); }; @@ -826,8 +830,7 @@ extern void _sysio_p_gone(struct pnode * extern size_t _sysio_p_prune(struct pnode *root); extern void _sysio_p_get2(struct pnode *pno1, struct pnode *pno2); extern int _sysio_pb_pathof(struct pnode_base *pb, - char separator, - char **pathp); + char separator, char **pathp); extern char *_sysio_pb_path(struct pnode_base *pb, char separator); extern ssize_t _sysio_p_filldirentries(struct pnode *pno, char *buf, @@ -845,9 +848,11 @@ extern int _sysio_p_rename(struct pnode extern int _sysio_p_iiox(int (*f)(struct ioctx *), struct pnode *pno, _SYSIO_OFF_T limit, - const struct iovec *iov, size_t iov_count, + const struct iovec *iov, + size_t iov_count, void (*release_iov)(struct ioctx *, void *), - const struct intnl_xtvec *xtv, size_t xtv_count, + const struct intnl_xtvec *xtv, + size_t xtv_count, void (*release_xtv)(struct ioctx *, void *), void (*completio)(struct ioctx *, void *), void *data, |
From: Lee W. <lw...@us...> - 2009-08-31 21:46:19
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28646/src Modified Files: inode.c Log Message: Had left the old pb_prune routine, the recursive list-based implementation, but ifdef'd out. It's just gone, now. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -w -b -B -p -r1.58 -r1.59 --- inode.c 31 Aug 2009 21:38:29 -0000 1.58 +++ inode.c 31 Aug 2009 21:46:09 -0000 1.59 @@ -1082,34 +1082,6 @@ p_remove_aliases(struct mount *mnt, stru return count; } -#if 0 -static size_t -pb_prune(struct mount *mnt, struct pnode_base *pb) -{ - size_t count; - struct pnode_base *nxt, *child; - - PB_LOCK(pb); - count = 0; - nxt = pb->pb_children.lh_first; - while ((child = nxt)) { - nxt = child->pb_sibs.le_next; - count += pb_prune(mnt, child); - } - - if (!count) { - count += p_remove_aliases(mnt, pb); - if (!(pb->pb_aliases.lh_first || pb->pb_children.lh_first)) { - _sysio_pb_gone(pb); - pb = NULL; - } - } - if (pb) - PB_UNLOCK(pb); - return count; -} -#endif - static size_t pb_prune(struct mount *mnt, struct pnode_base *pb) { |