Thread: [Libsysio-commit] HEAD: libsysio/dev stddev.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2008-07-11 18:24:02
|
Update of /cvsroot/libsysio/libsysio/dev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14678/dev Modified Files: stddev.c Log Message: Complete, finally, the change to use pnodes everywhere. Not ported to the new scheme were; sockets, yod, and incore driver. Index: stddev.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/dev/stddev.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- stddev.c 17 Jun 2008 15:17:30 -0000 1.2 +++ stddev.c 11 Jul 2008 18:23:56 -0000 1.3 @@ -62,12 +62,12 @@ */ static int stddev_open(struct pnode *pno, int flags, mode_t mode); -static int stddev_close(struct inode *ino); -static int stddev_read(struct inode *ino, struct ioctx *ioctx); -static int stddev_write(struct inode *ino, struct ioctx *ioctx); +static int stddev_close(struct pnode *pno); +static int stddev_read(struct ioctx *ioctx); +static int stddev_write(struct ioctx *ioctx); static int stddev_iodone(struct ioctx *ioctx); -static int stddev_datasync(struct inode *ino); -static int stddev_ioctl(struct inode *ino, +static int stddev_datasync(struct pnode *pno); +static int stddev_ioctl(struct pnode *pno, unsigned long int request, va_list ap); @@ -122,7 +122,7 @@ stddev_open(struct pnode *pno, } static int -stddev_close(struct inode *ino __IS_UNUSED) +stddev_close(struct pnode *pno __IS_UNUSED) { return 0; @@ -131,9 +131,12 @@ stddev_close(struct inode *ino __IS_UNUS static ssize_t doread(void *cp, size_t n, _SYSIO_OFF_T off __IS_UNUSED, struct ioctx *ioctx) { + struct inode *ino;; ssize_t cc; - switch (SYSIO_MINOR_DEV(ioctx->ioctx_ino->i_stbuf.st_rdev)) { + ino = ioctx->ioctx_pno->p_base->pb_ino; + assert(ino); + switch (SYSIO_MINOR_DEV(ino->i_stbuf.st_rdev)) { case SYSIO_STDDEV_NULL_MINOR: cc = 0; break; @@ -158,9 +161,12 @@ dowrite(void *cp __IS_UNUSED, _SYSIO_OFF_T off __IS_UNUSED, struct ioctx *ioctx) { + struct inode *ino; ssize_t cc; - switch (SYSIO_MINOR_DEV(ioctx->ioctx_ino->i_stbuf.st_rdev)) { + ino = ioctx->ioctx_pno->p_base->pb_ino; + assert(ino); + switch (SYSIO_MINOR_DEV(ino->i_stbuf.st_rdev)) { case SYSIO_STDDEV_NULL_MINOR: /* * Fall into... @@ -200,14 +206,14 @@ doio(struct ioctx *ioctx, } static int -stddev_read(struct inode *ino __IS_UNUSED, struct ioctx *ioctx) +stddev_read(struct ioctx *ioctx) { return doio(ioctx, doread); } static int -stddev_write(struct inode *ino __IS_UNUSED, struct ioctx *ioctx) +stddev_write(struct ioctx *ioctx) { return doio(ioctx, dowrite); @@ -224,7 +230,7 @@ stddev_iodone(struct ioctx *ioctx __IS_U } static int -stddev_datasync(struct inode *ino __IS_UNUSED) +stddev_datasync(struct pnode *pno __IS_UNUSED) { /* @@ -234,7 +240,7 @@ stddev_datasync(struct inode *ino __IS_U } static int -stddev_ioctl(struct inode *ino __IS_UNUSED, +stddev_ioctl(struct pnode *pno __IS_UNUSED, unsigned long int request __IS_UNUSED, va_list ap __IS_UNUSED) { |
From: Lee W. <lw...@us...> - 2009-06-24 15:38:56
|
Update of /cvsroot/libsysio/libsysio/dev In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28796 Modified Files: stddev.c Log Message: Both the read and write routines would abort on an unrecognized minor device number. That's, um, sub-optimal. They just return -ENODEV now, as they should have all along. Index: stddev.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/dev/stddev.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- stddev.c 11 Jul 2008 18:23:56 -0000 1.3 +++ stddev.c 24 Jun 2009 15:38:51 -0000 1.4 @@ -149,7 +149,8 @@ doread(void *cp, size_t n, _SYSIO_OFF_T cc = (ssize_t )n; break; default: - abort(); + cc = -ENODEV; + break; } return cc; } @@ -178,7 +179,8 @@ dowrite(void *cp __IS_UNUSED, cc = -ENOSPC; break; default: - abort(); + cc = -ENODEV; + break; } 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 = |