libsysio-commit Mailing List for libsysio (Page 9)
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...> - 2007-11-20 17:49:29
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv31929/src Modified Files: inode.c link.c Log Message: Added _sysio_p_link and modified library entry-point to use it. Also, added IS_RDONLY checks to many pnode manipulation routines in inode.c Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -w -b -B -p -r1.32 -r1.33 --- inode.c 24 Sep 2007 18:00:39 -0000 1.32 +++ inode.c 20 Nov 2007 17:49:26 -0000 1.33 @@ -974,7 +974,7 @@ _sysio_p_setattr(struct pnode *pno, struct intnl_stat *stbuf) { - if (pno && IS_RDONLY(pno)) + if (IS_RDONLY(pno)) return -EROFS; /* @@ -985,6 +985,38 @@ _sysio_p_setattr(struct pnode *pno, } /* + * Perform link operation; old to new. + */ +int +_sysio_p_link(struct pnode *old, struct pnode *new) +{ + int err; + + if (S_ISDIR(old->p_base->pb_ino->i_stbuf.st_mode)) + return -EPERM; + if (new->p_base->pb_ino) + return -EEXIST; + /* + * Make sure they aren't trying to link across a mount-point. + * + * NB: Arguably, should check that the root pnodes are the same. + * However, that would allow linking across bound mounts. I'm thinking + * we don't want to allow that. Though, I don't really know why not. + * I'm a pedant? + */ + if (old->p_mount != new->p_mount) + return -EXDEV; + if (IS_RDONLY(new->p_parent)) + return -EROFS; + err = PNOP_LINK(old, new); + if (err) + return err; + new->p_base->pb_ino = old->p_base->pb_ino; + I_REF(new->p_base->pb_ino); + return 0; +} + +/* * Perform unlink operation on some pnode. */ int @@ -992,6 +1024,8 @@ _sysio_p_unlink(struct pnode *pno) { int err; + if (IS_RDONLY(pno)) + return -EROFS; if (!pno->p_base->pb_ino) return -ENOENT; /* huh? */ if (S_ISDIR(pno->p_base->pb_ino->i_stbuf.st_mode)) @@ -1010,13 +1044,15 @@ _sysio_p_unlink(struct pnode *pno) } /* - * Perform unlink operation on some pnode. + * Perform remove directory operation on some pnode. */ int _sysio_p_rmdir(struct pnode *pno) { int err; + if (IS_RDONLY(pno)) + return -EROFS; if (!pno->p_base->pb_ino) return -ENOENT; /* huh? */ if (!S_ISDIR(pno->p_base->pb_ino->i_stbuf.st_mode)) @@ -1039,6 +1075,9 @@ _sysio_p_rmdir(struct pnode *pno) return 0; } +/* + * Perform rename operation on some pnode. + */ int _sysio_p_rename(struct pnode *old, struct pnode *new) { @@ -1058,6 +1097,14 @@ _sysio_p_rename(struct pnode *old, struc return -EXDEV; /* + * Must not be a read-only mount. + * + * NB: Invariant old->p_mount->mnt_fs == new->p_mount->mnt_fs. + */ + if (IS_RDONLY(new)) + return -EROFS; + + /* * Don't allow mount points to move. */ if (old->p_mount->mnt_root == old || Index: link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/link.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- link.c 2 Jul 2007 18:58:16 -0000 1.14 +++ link.c 20 Nov 2007 17:49:26 -0000 1.15 @@ -63,47 +63,25 @@ SYSIO_INTERFACE_NAME(link)(const char *o SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER(link, "%s%s", oldpath, newpath); + old = new = NULL; + err = 0; + do { INTENT_INIT(&intent, 0, NULL, NULL); - err = _sysio_namei(_sysio_cwd, oldpath, 0, &intent, &old); + err = + _sysio_namei(_sysio_cwd, oldpath, 0, &intent, &old); if (err) - goto out; - if (S_ISDIR(old->p_base->pb_ino->i_stbuf.st_mode)) { - err = -EPERM; - goto error1; - } + break; INTENT_INIT(&intent, INT_UPDPARENT, NULL, NULL); - new = NULL; - err = _sysio_namei(_sysio_cwd, newpath, ND_NEGOK, &intent, &new); + err = + _sysio_namei(_sysio_cwd, newpath, ND_NEGOK, &intent, &new); if (err) - goto error1; - if (new->p_base->pb_ino) { - err = -EEXIST; - goto error2; - } - if (old->p_mount->mnt_root != new->p_mount->mnt_root) { - err = -EXDEV; - goto error2; - } - /* - * Use the parent node operations to request the task in case the - * driver is implemented using differentiated inode operations based - * on file type, such as incore does. - */ - err = PNOP_LINK(old, new); - if (err) - goto error2; - /* - * The new p-node must be pointed at the inode referenced by the old. - */ - assert(!new->p_base->pb_ino && old->p_base->pb_ino); - new->p_base->pb_ino = old->p_base->pb_ino; - I_REF(new->p_base->pb_ino); - -error2: + break; + err = _sysio_p_link(old, new); + } while (0); + if (new) P_RELE(new); -error1: + if (old) P_RELE(old); -out: SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, link, "%d", 0); } |
From: Lee W. <lw...@us...> - 2007-11-20 17:49:29
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv31929/include Modified Files: inode.h Log Message: Added _sysio_p_link and modified library entry-point to use it. Also, added IS_RDONLY checks to many pnode manipulation routines in inode.c Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -w -b -B -p -r1.34 -r1.35 --- inode.h 21 Sep 2007 20:12:55 -0000 1.34 +++ inode.h 20 Nov 2007 17:49:26 -0000 1.35 @@ -526,6 +526,7 @@ extern char *_sysio_pb_path(struct pnode extern int _sysio_p_setattr(struct pnode *pno, unsigned mask, struct intnl_stat *stbuf); +extern int _sysio_p_link(struct pnode *old, struct pnode *new); extern int _sysio_p_unlink(struct pnode *pno); extern int _sysio_p_rmdir(struct pnode *pno); extern int _sysio_p_rename(struct pnode *old, struct pnode *new); |
From: Lee W. <lw...@us...> - 2007-11-20 17:46:31
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv31140/src Modified Files: fsync.c Log Message: Modified to leverage the new F_FILEOK macro instead of a direct test. Index: fsync.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fsync.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- fsync.c 2 Jul 2007 18:58:16 -0000 1.10 +++ fsync.c 20 Nov 2007 17:46:28 -0000 1.11 @@ -45,38 +45,49 @@ #include <errno.h> #include <sys/types.h> #include <sys/stat.h> +#include <fcntl.h> #include <sys/queue.h> #include "sysio.h" -#include "file.h" #include "inode.h" +#include "file.h" int SYSIO_INTERFACE_NAME(fsync)(int fd) { - struct file *fil; int err; + struct file *fil; SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER(fsync, "%d", fd); + err = 0; + do { fil = _sysio_fd_find(fd); - if (!(fil && fil->f_pno)) - SYSIO_INTERFACE_RETURN(-1, -EBADF, fsync, "%d", 0); + if (!F_FILEOK(fil)) + err = -EBADF; + if (err) + break; err = PNOP_SYNC(fil->f_pno); + } while (0); SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fsync, "%d", 0); } int SYSIO_INTERFACE_NAME(fdatasync)(int fd) { - struct file *fil; int err; + struct file *fil; SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER(fdatasync, "%d", fd); + err = 0; + do { fil = _sysio_fd_find(fd); - if (!(fil && fil->f_pno)) - SYSIO_INTERFACE_RETURN(-1, -EBADF, fdatasync, "%d", 0); + if (!F_FILEOK(fil)) + err = -EBADF; + if (err) + break; err = PNOP_DATASYNC(fil->f_pno); + } while (0); SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fdatasync, "%d", 0); } |
From: Lee W. <lw...@us...> - 2007-11-20 17:38:25
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27643/src Modified Files: chmod.c Log Message: Now, check that the file permissions allow the {f}chmod operation. Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -b -B -p -r1.18 -r1.19 --- chmod.c 26 Oct 2007 19:48:23 -0000 1.18 +++ chmod.c 20 Nov 2007 17:38:19 -0000 1.19 @@ -61,6 +61,9 @@ do_chmod(struct pnode *pno, mode_t mode) struct intnl_stat stbuf; unsigned mask; + if (!_sysio_permitted(pno, W_OK)) + return -EPERM; + (void )memset(&stbuf, 0, sizeof(struct intnl_stat)); stbuf.st_mode = mode & 07777; mask = SETATTR_MODE; |
From: Lee W. <lw...@us...> - 2007-11-20 17:34:41
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25701/include Modified Files: file.h Log Message: Add two new macros. F_FILEOK tests if the passed file ref is valid; Not NULL and fil->f_pno not NULL. F_WRITEOK tests if the passed file ref is valid and writeable. Index: file.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/file.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -w -b -B -p -r1.19 -r1.20 --- file.h 1 May 2007 16:33:52 -0000 1.19 +++ file.h 20 Nov 2007 17:34:38 -0000 1.20 @@ -113,6 +113,12 @@ struct file { } while (0) /* + * Valid file object? + */ +#define F_FILEOK(_fil) \ + ((_fil) && (_fil)->f_pno) + +/* * Determine if a file may be read/written. * * Given a ptr to an open file table entry and a flag indicating desired @@ -127,6 +133,15 @@ struct file { (((_c) == 'r' && !((_fil)->f_flags & O_WRONLY)) || \ ((_c) == 'w' && ((_fil)->f_flags & (O_WRONLY | O_RDWR)))) +/* + * Is file object writable? Return 0, if so. Otherwise, the appropriate + * (negated) error number. + */ +#define F_WRITEOK(_fil) \ + (!(F_FILEOK(_fil) && F_CHKRW((_fil), 'w')) \ + ? -EBADF \ + : (IS_RDONLY((_fil)->f_pno) ? -EROFS : 0)) + struct ioctx; extern struct file *_sysio_fnew(struct pnode *pno, int flags); |
From: Lee W. <lw...@us...> - 2007-11-20 17:31:35
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24859/include Modified Files: creds.h Log Message: if _SYSIO_ROOT_UID was not defined then _sysio_is_root was also not defined. Fixed. It just replaces with a zero (not root), now. Index: creds.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/creds.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- creds.h 29 Jun 2007 15:32:39 -0000 1.2 +++ creds.h 20 Nov 2007 17:31:29 -0000 1.3 @@ -62,11 +62,13 @@ struct creds { }; -#ifdef _SYSIO_ROOT_UID /* * Is caller the superuser? */ +#ifdef _SYSIO_ROOT_UID #define _sysio_is_root(_crp) \ ((_crp)->creds_uid == _SYSIO_ROOT_UID) +#else + (0) #endif #endif |
From: Lee W. <lw...@us...> - 2007-11-20 17:23:41
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv21721 Modified Files: test_link.c Log Message: Usage erroneously announce the program name as 'unlink'. Fixed. Says 'link' now. Index: test_link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_link.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- test_link.c 28 Mar 2007 21:27:12 -0000 1.6 +++ test_link.c 20 Nov 2007 17:23:36 -0000 1.7 @@ -133,7 +133,7 @@ usage() { (void )fprintf(stderr, - "Usage: unlink" + "Usage: link" " oldpath newpath\n"); exit(1); |
From: Ruth K. <rk...@us...> - 2007-11-16 20:58:14
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22463/src Modified Files: stddir.c Log Message: 2 uninitialized vars noticed by valgrind Index: stddir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stddir.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- stddir.c 2 Jul 2007 18:58:17 -0000 1.4 +++ stddir.c 16 Nov 2007 20:58:08 -0000 1.5 @@ -62,6 +62,7 @@ SYSIO_INTERFACE_NAME(opendir)(const char free(dir); SYSIO_INTERFACE_RETURN(NULL, -errno, opendir, "%p", 0); } + dir->base = 0; SYSIO_INTERFACE_RETURN(dir, 0, opendir, "%p", 0); } |
From: Ruth K. <rk...@us...> - 2007-11-16 20:58:14
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22463/tests Modified Files: test_list.c Log Message: 2 uninitialized vars noticed by valgrind Index: test_list.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_list.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- test_list.c 28 Mar 2007 21:27:12 -0000 1.13 +++ test_list.c 16 Nov 2007 20:58:08 -0000 1.14 @@ -148,7 +148,7 @@ listit(const char *path) int fd; size_t n; struct dirent *buf, *dp; - off_t base; + off_t base = 0; ssize_t cc; fd = SYSIO_INTERFACE_NAME(open)(path, O_RDONLY); |
From: Lee W. <lw...@us...> - 2007-11-15 15:05:39
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv11638 Modified Files: getdirentries.c Log Message: The getdirentries function was converted to blindly convert the 64-bit directory entry structure. When the native format is the same layout this resulted in a memcpy of the name in overlapping regions. That's a no-no. Changed, now, to use memmove, which allows overlapping copies. Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -w -b -B -p -r1.25 -r1.26 --- getdirentries.c 2 Jul 2007 18:58:16 -0000 1.25 +++ getdirentries.c 15 Nov 2007 15:05:34 -0000 1.26 @@ -182,7 +182,7 @@ SYSIO_INTERFACE_NAME(getdirentries)(int /* * Copy name first. */ - (void )memcpy(dp->d_name, d64p->d_name, n); + (void )memmove(dp->d_name, d64p->d_name, n); /* * Then, the rest. */ |
From: Ruth K. <rk...@us...> - 2007-11-01 22:17:12
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22399 Modified Files: Tag: RELEASE_1_3 configure.in Log Message: typo in readlink test Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.37 retrieving revision 1.37.2.1 diff -u -w -b -B -p -r1.37 -r1.37.2.1 --- configure.in 20 Aug 2007 19:30:54 -0000 1.37 +++ configure.in 1 Nov 2007 22:17:07 -0000 1.37.2.1 @@ -283,7 +283,7 @@ if test x$symlink_support = xyes; then readlink_returns_int="no" ) AC_MSG_RESULT($readlink_returns_int) - if test x$readlink_returns_int = no; then + if test x$readlink_returns_int = xno; then AC_DEFINE(HAVE_POSIX_1003_READLINK, 1, [readlink returns ssize_t]) |
From: Ruth K. <rk...@us...> - 2007-10-26 19:48:27
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv21439 Modified Files: chmod.c mknod.c statvfs.c rw.c Log Message: trace format fixes Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -w -b -B -p -r1.17 -r1.18 --- chmod.c 19 Sep 2007 16:01:33 -0000 1.17 +++ chmod.c 26 Oct 2007 19:48:23 -0000 1.18 @@ -98,7 +98,7 @@ SYSIO_INTERFACE_NAME(fchmod)(int fd, mod struct file *fil; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(fchmod, "%d%mY", fd, mode); + SYSIO_INTERFACE_ENTER(fchmod, "%d%mZ", fd, mode); err = 0; fil = _sysio_fd_find(fd); if (!fil) { Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -w -b -B -p -r1.21 -r1.22 --- mknod.c 2 Jul 2007 18:58:16 -0000 1.21 +++ mknod.c 26 Oct 2007 19:48:23 -0000 1.22 @@ -91,7 +91,7 @@ PREPEND(__, SYSIO_INTERFACE_NAME(xmknod) struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(xmknod, "%d%s%mY%dY",__ver, path, mode, dev); + SYSIO_INTERFACE_ENTER(xmknod, "%d%s%mZ%d",__ver, path, mode, dev); if (__ver != _MKNOD_VER) { err = -ENOSYS; goto out; Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -b -B -p -r1.18 -r1.19 --- statvfs.c 19 Sep 2007 16:01:33 -0000 1.18 +++ statvfs.c 26 Oct 2007 19:48:23 -0000 1.19 @@ -96,7 +96,7 @@ SYSIO_INTERFACE_NAME(statvfs64)(const ch SYSIO_INTERFACE_ENTER(statvfs64, "%s", path); err = _sysio_statvfs(path, buf); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, statvfs64, "%d%sY", buf); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, statvfs64, "%d%lvY", buf); } #ifdef REDSTORM @@ -113,7 +113,7 @@ SYSIO_INTERFACE_NAME(fstatvfs64)(int fd, SYSIO_INTERFACE_ENTER(fstatvfs64, "%d", fd); err = _sysio_fstatvfs(fd, buf); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fstatvfs64, "%d%sY", buf); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fstatvfs64, "%d%lvY", buf); } #ifdef REDSTORM @@ -163,7 +163,7 @@ SYSIO_INTERFACE_NAME(statvfs)(const char convstatvfs(buf, _call_buf); #undef _call_buf #endif /* defined(_LARGEFILE64_SOURCE) */ - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, statvfs, "%d%sY", buf); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, statvfs, "%d%vY", buf); } #ifdef REDSTORM @@ -191,7 +191,7 @@ SYSIO_INTERFACE_NAME(fstatvfs)(int fd, s convstatvfs(buf, _call_buf); #undef _call_buf #endif - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fstatvfs, "%d%sY", buf); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fstatvfs, "%d%vY", buf); } #ifdef REDSTORM Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -w -b -B -p -r1.25 -r1.26 --- rw.c 9 Oct 2007 17:21:47 -0000 1.25 +++ rw.c 26 Oct 2007 19:48:23 -0000 1.26 @@ -917,10 +917,10 @@ _do_iiov(direction dir, free(xtv); if (dir == READ) SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, err, - ireadx, "%p", 0); + ireadv, "%p", 0); else SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, err, - iwritex, "%p", 0); + iwritev, "%p", 0); /* Not reached. */ } |
From: Lee W. <lw...@us...> - 2007-10-09 17:21:50
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1312 Modified Files: rw.c Log Message: >From Bob Glossman (bo...@cr...) found during regression testing: pwrite returns -1 [EINVAL] The _do_ipio routine was sending the number of bytes in the buffer to the _do_ipiov, helper, routine to be used as the iovec count. Changed to one. Fixed. Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -w -b -B -p -r1.24 -r1.25 --- rw.c 9 Oct 2007 17:13:33 -0000 1.24 +++ rw.c 9 Oct 2007 17:21:47 -0000 1.25 @@ -720,7 +720,7 @@ _do_ipio(int fd, return IOID_FAIL; iov->iov_base = buf; iov->iov_len = count; - ioid = _do_ipiov(fd, f, iov, count, free_arg, offset, NULL); + ioid = _do_ipiov(fd, f, iov, 1, free_arg, offset, NULL); if (ioid == IOID_FAIL) free(iov); return ioid; |
From: Lee W. <lw...@us...> - 2007-10-09 17:21:44
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2098 Modified Files: Tag: RELEASE_1_3 rw.c Log Message: >From Bob Glossman (bo...@cr...) found during regression testing: pwrite returns -1 [EINVAL] The _do_ipio routine was sending the number of bytes in the buffer to the _do_ipiov, helper, routine to be used as the iovec count. Changed to one. Fixed. Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.22.2.1 retrieving revision 1.22.2.2 diff -u -w -b -B -p -r1.22.2.1 -r1.22.2.2 --- rw.c 9 Oct 2007 17:13:43 -0000 1.22.2.1 +++ rw.c 9 Oct 2007 17:21:41 -0000 1.22.2.2 @@ -720,7 +720,7 @@ _do_ipio(int fd, return IOID_FAIL; iov->iov_base = buf; iov->iov_len = count; - ioid = _do_ipiov(fd, f, iov, count, free_arg, offset, NULL); + ioid = _do_ipiov(fd, f, iov, 1, free_arg, offset, NULL); if (ioid == IOID_FAIL) free(iov); return ioid; |
From: Lee W. <lw...@us...> - 2007-10-09 17:13:46
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28083 Modified Files: Tag: RELEASE_1_3 rw.c Log Message: >From Bob Glossman (bo...@cr...), during regression testing: Error number from pwrite is negative. Doh! Worse, _do_ipiov should be using the negated return code from _sysio_sum_iovec and not it's own. Fixed. Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.22 retrieving revision 1.22.2.1 diff -u -w -b -B -p -r1.22 -r1.22.2.1 --- rw.c 2 Jul 2007 18:58:17 -0000 1.22 +++ rw.c 9 Oct 2007 17:13:43 -0000 1.22.2.1 @@ -582,7 +582,7 @@ _do_ipiov(int fd, cc = _sysio_sum_iovec(iov, count); if (cc < 0) { - errno = -EINVAL; + errno = (int )-cc; return IOID_FAIL; } xtv = malloc(sizeof(struct intnl_xtvec)); |
From: Lee W. <lw...@us...> - 2007-10-09 17:13:37
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30614 Modified Files: rw.c Log Message: >From Bob Glossman (bo...@cr...), during regression testing: Error number from pwrite is negative. Doh! Worse, _do_ipiov should be using the negated return code from _sysio_sum_iovec and not it's own. Fixed. Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -w -b -B -p -r1.23 -r1.24 --- rw.c 19 Sep 2007 16:01:33 -0000 1.23 +++ rw.c 9 Oct 2007 17:13:33 -0000 1.24 @@ -582,7 +582,7 @@ _do_ipiov(int fd, cc = _sysio_sum_iovec(iov, count); if (cc < 0) { - errno = -EINVAL; + errno = (int )-cc; return IOID_FAIL; } xtv = malloc(sizeof(struct intnl_xtvec)); |
From: Ruth K. <rk...@us...> - 2007-09-27 17:22:42
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25101 Modified Files: mkdir.c Log Message: fix format for tracing Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -w -b -B -p -r1.22 -r1.23 --- mkdir.c 2 Jul 2007 18:58:16 -0000 1.22 +++ mkdir.c 27 Sep 2007 17:22:36 -0000 1.23 @@ -78,7 +78,7 @@ SYSIO_INTERFACE_NAME(mkdir)(const char * struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(mkdir, "%s%mY", path, mode); + SYSIO_INTERFACE_ENTER(mkdir, "%s%mZ", path, mode); INTENT_INIT(&intent, INT_CREAT, &mode, NULL); err = _sysio_namei(_sysio_cwd, path, ND_NEGOK, &intent, &pno); if (err) |
From: Lee W. <lw...@us...> - 2007-09-26 19:47:13
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16830 Modified Files: module.mk Log Message: >From Bob Glossman (bo...@cr...): We forgot to include creds.h in the INCLUDE_EXTRA line. Fixed. Index: module.mk =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/module.mk,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- module.mk 21 Sep 2007 19:35:53 -0000 1.8 +++ module.mk 26 Sep 2007 19:47:07 -0000 1.9 @@ -2,4 +2,4 @@ INCLUDE_EXTRA = include/dev.h include/fi include/inode.h include/mount.h include/sysio.h \ include/sysio-cmn.h include/sysio-symbols.h include/cplant-yod.h \ include/module.mk include/xtio.h include/stddir.h \ - include/native.h include/tree.h + include/native.h include/tree.h include/creds.h |
From: Lee W. <lw...@us...> - 2007-09-26 19:46:29
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16384 Modified Files: init.c Log Message: >From Bob Glossman (bo...@cr...): Simplified and removed a constant check in the namespace boot parser. Index: init.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/init.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -w -b -B -p -r1.38 -r1.39 --- init.c 20 Aug 2007 19:12:08 -0000 1.38 +++ init.c 26 Sep 2007 19:46:25 -0000 1.39 @@ -830,8 +830,7 @@ _sysio_boot_namespace(const char *arg) /* * Discard leading white space. */ - while ((c = *arg) != '\0' && - !(c == '{' || strchr(IGNORE_WHITE, c) == NULL)) + while ((c = *arg) != '\0' && strchr(IGNORE_WHITE, c)) arg++; if (COMMENT_INTRO == c) { /* |
From: Lee W. <lw...@us...> - 2007-09-26 19:43:01
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14755 Modified Files: Tag: RELEASE_1_3 module.mk Log Message: >From Bob Glossman (bo...@cr...): We had forgotten to include creds.h in the INCLUDE_EXTRA line. Fixed. Index: module.mk =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/module.mk,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -w -b -B -p -r1.7 -r1.7.2.1 --- module.mk 1 May 2007 17:28:42 -0000 1.7 +++ module.mk 26 Sep 2007 19:42:58 -0000 1.7.2.1 @@ -2,4 +2,4 @@ INCLUDE_EXTRA = include/dev.h include/fi include/inode.h include/mount.h include/sysio.h \ include/sysio-cmn.h include/sysio-symbols.h include/cplant-yod.h \ include/module.mk include/xtio.h include/stddir.h \ - include/native.h + include/native.h include/creds.h |
From: Lee W. <lw...@us...> - 2007-09-26 19:41:43
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv13912 Modified Files: Tag: RELEASE_1_3 init.c Log Message: >From Bob Glossman (bo...@cr...): Simplification and removal of a constant check in the namespace boot parsing. Index: init.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/init.c,v retrieving revision 1.38 retrieving revision 1.38.2.1 diff -u -w -b -B -p -r1.38 -r1.38.2.1 --- init.c 20 Aug 2007 19:12:08 -0000 1.38 +++ init.c 26 Sep 2007 19:41:39 -0000 1.38.2.1 @@ -830,8 +830,7 @@ _sysio_boot_namespace(const char *arg) /* * Discard leading white space. */ - while ((c = *arg) != '\0' && - !(c == '{' || strchr(IGNORE_WHITE, c) == NULL)) + while ((c = *arg) != '\0' && strchr(IGNORE_WHITE, c)) arg++; if (COMMENT_INTRO == c) { /* |
From: Lee W. <lw...@us...> - 2007-09-24 19:00:19
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10952/src Modified Files: mount.c Log Message: All the drivers, in their mount routines, do something like: rootpb = _sysio_pb_new(&noname, NULL, rootino); err = _sysio_do_mount(..., rootpb, ...); This is clumsy. Crafted a convenience function called _sysio_mounti to do this for them. This simplifies the whole process a bit. Don't have to clean up the root pb node on error, for instance. The function is called exactly like _sysio_do_mount but with a ptr to the root inode instead of a ptr to the root pb node. Index: mount.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mount.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -w -b -B -p -r1.25 -r1.26 --- mount.c 21 Sep 2007 19:41:37 -0000 1.25 +++ mount.c 24 Sep 2007 19:00:03 -0000 1.26 @@ -200,6 +200,29 @@ error: } /* + * Mount unrooted sub-tree somewhere in the existing name space. + */ +int +_sysio_mounti(struct filesys *fs, + struct inode *rootino, + unsigned flags, + struct pnode *tocover, + struct mount **mntp) +{ + static struct qstr noname = { NULL, 0, 0 }; + struct pnode_base *rootpb; + int err; + + rootpb = _sysio_pb_new(&noname, NULL, rootino); + if (!rootpb) + return -ENOMEM; + err = _sysio_do_mount(fs, rootpb, flags, tocover, mntp); + if (err) + _sysio_pb_gone(rootpb); + return err; +} + +/* * Remove mounted sub-tree from the system. */ int |
From: Lee W. <lw...@us...> - 2007-09-24 19:00:19
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10952/include Modified Files: mount.h Log Message: All the drivers, in their mount routines, do something like: rootpb = _sysio_pb_new(&noname, NULL, rootino); err = _sysio_do_mount(..., rootpb, ...); This is clumsy. Crafted a convenience function called _sysio_mounti to do this for them. This simplifies the whole process a bit. Don't have to clean up the root pb node on error, for instance. The function is called exactly like _sysio_do_mount but with a ptr to the root inode instead of a ptr to the root pb node. Index: mount.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/mount.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- mount.h 14 Feb 2004 19:42:58 -0000 1.4 +++ mount.h 24 Sep 2007 19:00:03 -0000 1.5 @@ -74,6 +74,7 @@ extern struct qstr _sysio_mount_file_nam #endif struct pnode_base; +struct inode; extern int _sysio_mount_init(void); extern int _sysio_do_mount(struct filesys *fs, @@ -81,6 +82,11 @@ extern int _sysio_do_mount(struct filesy unsigned flags, struct pnode *tocover, struct mount **mntp); +extern int _sysio_mounti(struct filesys *fs, + struct inode *rootino, + unsigned flags, + struct pnode *tocover, + struct mount **mntp); extern int _sysio_do_unmount(struct mount *fs); extern int _sysio_mount_root(const char *source, const char *type, |
From: Lee W. <lw...@us...> - 2007-09-24 19:00:19
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10952/drivers/incore Modified Files: fs_incore.c Log Message: All the drivers, in their mount routines, do something like: rootpb = _sysio_pb_new(&noname, NULL, rootino); err = _sysio_do_mount(..., rootpb, ...); This is clumsy. Crafted a convenience function called _sysio_mounti to do this for them. This simplifies the whole process a bit. Don't have to clean up the root pb node on error, for instance. The function is called exactly like _sysio_do_mount but with a ptr to the root inode instead of a ptr to the root pb node. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -w -b -B -p -r1.34 -r1.35 --- fs_incore.c 21 Sep 2007 19:41:37 -0000 1.34 +++ fs_incore.c 24 Sep 2007 19:00:02 -0000 1.35 @@ -537,9 +537,7 @@ _sysio_incore_fsswop_mount(const char *s struct incore_inode *icino; struct filesys *fs; struct inode *rooti; - struct pnode_base *rootpb; struct mount *mnt; - static struct qstr noname = { NULL, 0, 0 }; /* * Source is a specification for the root attributes of this @@ -585,7 +583,6 @@ _sysio_incore_fsswop_mount(const char *s dev = _sysio_dev_alloc(); mnt = NULL; - rootpb = NULL; rooti = NULL; fs = NULL; icino = NULL; @@ -650,23 +647,13 @@ _sysio_incore_fsswop_mount(const char *s err = -ENOMEM; goto error; } - rootpb = _sysio_pb_new(&noname, NULL, rooti); - if (!rootpb) { - err = -ENOMEM; - goto error; - } /* * Have path-node specified by the given source argument. Let the * system finish the job, now. */ mnt = NULL; - err = - _sysio_do_mount(fs, - rootpb, - flags, - tocover, - &mnt); + err = _sysio_mounti(fs, rooti, flags, tocover, &mnt); if (err) goto error; @@ -677,10 +664,6 @@ _sysio_incore_fsswop_mount(const char *s error: if (mnt && _sysio_do_unmount(mnt) != 0) abort(); - if (rootpb) { - _sysio_pb_gone(rootpb); - rooti = NULL; - } if (rooti) I_RELE(rooti); if (fs) { |
From: Lee W. <lw...@us...> - 2007-09-24 19:00:19
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10952/drivers/native Modified Files: fs_native.c Log Message: All the drivers, in their mount routines, do something like: rootpb = _sysio_pb_new(&noname, NULL, rootino); err = _sysio_do_mount(..., rootpb, ...); This is clumsy. Crafted a convenience function called _sysio_mounti to do this for them. This simplifies the whole process a bit. Don't have to clean up the root pb node on error, for instance. The function is called exactly like _sysio_do_mount but with a ptr to the root inode instead of a ptr to the root pb node. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -w -b -B -p -r1.64 -r1.65 --- fs_native.c 20 Aug 2007 19:37:05 -0000 1.64 +++ fs_native.c 24 Sep 2007 19:00:03 -0000 1.65 @@ -378,8 +378,6 @@ create_internal_namespace(const void *da int err; struct mount *mnt; struct inode *rootino; - struct pnode_base *rootpb; - static struct qstr noname = { NULL, 0, 0 }; struct filesys *fs; time_t t; struct intnl_stat stbuf; @@ -424,7 +422,6 @@ create_internal_namespace(const void *da fs = NULL; mnt = NULL; rootino = NULL; - rootpb = NULL; /* * This really should be per-mount. Hmm, but that's best done * as proper sub-mounts in the core and not this driver. We reconcile @@ -463,19 +460,10 @@ create_internal_namespace(const void *da } /* - * Generate base path-node for root. - */ - rootpb = _sysio_pb_new(&noname, NULL, rootino); - if (!rootpb) { - err = -ENOMEM; - goto error; - } - - /* * Mount it. This name space is disconnected from the * rest of the system -- Only available within this driver. */ - err = _sysio_do_mount(fs, rootpb, 0, NULL, &mnt); + err = _sysio_mounti(fs, rootino, 0, NULL, &mnt); if (err) goto error; @@ -487,11 +475,8 @@ error: abort(); nfs = NULL; fs = NULL; - rootpb = NULL; rootino = NULL; } - if (rootpb) - _sysio_pb_gone(rootpb); if (fs) { FS_RELE(fs); nfs = NULL; |