libsysio-commit Mailing List for libsysio (Page 8)
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...> - 2008-04-16 12:49:53
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15670 Modified Files: configure.in Log Message: Bumped version to 1.4. Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.38 retrieving revision 1.39 diff -u -w -b -B -p -r1.38 -r1.39 --- configure.in 24 Aug 2007 16:50:20 -0000 1.38 +++ configure.in 16 Apr 2008 12:49:39 -0000 1.39 @@ -1,4 +1,4 @@ -AC_INIT(libsysio, 1.3) +AC_INIT(libsysio, 1.4) AC_CANONICAL_HOST |
From: Ruth K. <rk...@us...> - 2008-04-15 19:39:30
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13597 Modified Files: Tag: RELEASE_1_3 access.c Log Message: adjustment to _sysio_ldgroups return value Index: access.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/access.c,v retrieving revision 1.17 retrieving revision 1.17.2.1 diff -u -w -b -B -p -r1.17 -r1.17.2.1 --- access.c 2 Jul 2007 18:58:15 -0000 1.17 +++ access.c 15 Apr 2008 19:39:25 -0000 1.17.2.1 @@ -199,7 +199,11 @@ _sysio_ldgroups(gid_t gid0, gid_t **gids } break; } - return i; + /* + * increment count to include gidsp[0], we always + * have at least that group. + */ + return i + 1; } /* |
From: Ruth K. <rk...@us...> - 2008-04-15 19:29:30
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9503 Modified Files: access.c Log Message: adjustment to _sysio_ldgroups return value Index: access.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/access.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -w -b -B -p -r1.17 -r1.18 --- access.c 2 Jul 2007 18:58:15 -0000 1.17 +++ access.c 15 Apr 2008 19:29:06 -0000 1.18 @@ -199,7 +199,11 @@ _sysio_ldgroups(gid_t gid0, gid_t **gids } break; } - return i; + /* + * increment count to include gidsp[0], we always + * have at least that group. + */ + return i + 1; } /* |
From: Lee W. <lw...@us...> - 2008-04-15 16:26:22
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4391 Modified Files: inode.c Log Message: That was dumb. I forgot a semi-colon. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -w -b -B -p -r1.39 -r1.40 --- inode.c 15 Apr 2008 16:24:42 -0000 1.39 +++ inode.c 15 Apr 2008 16:26:19 -0000 1.40 @@ -583,7 +583,7 @@ _sysio_pb_disconnect(struct pnode_base * */ pno = pb->pb_aliases.lh_first; do { - assert(pno->p_parent != pno) + assert(pno->p_parent != pno); pno->p_parent = NULL; } while ((pno = pno->p_links.le_next)); /* |
From: Lee W. <lw...@us...> - 2008-04-15 16:24:56
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3459 Modified Files: inode.c Log Message: In _sysio_pb_disocnnect, when disconnecting the aliases, no alias should be the root of a file system. Added an assert to check for this. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -w -b -B -p -r1.38 -r1.39 --- inode.c 14 Apr 2008 23:28:41 -0000 1.38 +++ inode.c 15 Apr 2008 16:24:42 -0000 1.39 @@ -583,6 +583,7 @@ _sysio_pb_disconnect(struct pnode_base * */ pno = pb->pb_aliases.lh_first; do { + assert(pno->p_parent != pno) pno->p_parent = NULL; } while ((pno = pno->p_links.le_next)); /* |
From: Lee W. <lw...@us...> - 2008-04-14 23:28:44
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1705 Modified Files: inode.c Log Message: Four changes: 1) The routine _sysio_p_path was moved here from chdir.c 2) A new routine, _sysio_p_show, is implemented when P_DEBUG is defined. 3) _sysio_p_find_alias prints the pnode when P_DEBUG is defined, using _sysio_p_show. 4) _sysio_gone prints the pnode when P_DEBUG is defined, using _sysio_p_show. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -w -b -B -p -r1.37 -r1.38 --- inode.c 31 Mar 2008 16:33:55 -0000 1.37 +++ inode.c 14 Apr 2008 23:28:41 -0000 1.38 @@ -623,6 +623,100 @@ _sysio_i_shutdown() #endif /* + * Return path tracked by the path ancestor chain. + * + * If the buf pointer is NULL, a buffer large enough to hold the path + * is allocated from the heap. + */ + +int +_sysio_p_path(struct pnode *pno, char **bufp, size_t size) +{ + struct pnode *cur; + size_t len; + size_t n; + char *cp; + + cur = pno; + + if (!size && bufp && *bufp) + return -EINVAL; + + /* + * Walk up the tree to the root, summing the component name + * lengths and counting the vertices. + */ + len = 0; + n = 0; + do { + /* + * If this is a covering path-node then the name should be + * the *covered* nodes name, not this one unless we are at + * the root of the name-space. + */ + while (pno == pno->p_mount->mnt_root && + pno != pno->p_parent) + pno = pno->p_mount->mnt_covers; + + /* + * Add length of this component to running sum and + * account for this vertex. + */ + assert((len >= pno->p_base->pb_key.pbk_name.len && + (size_t )~0 - pno->p_base->pb_key.pbk_name.len > len) || + (size_t )~0 - len > pno->p_base->pb_key.pbk_name.len); + len += pno->p_base->pb_key.pbk_name.len; + n++; + assert(n); + pno = pno->p_parent; + } while (pno && pno != pno->p_parent); + if (!pno) + return -ENOENT; + + if (!*bufp) + size = len + n + 1; + if (len >= size || n >= size - len) + return -ERANGE; + if (!*bufp) { + /* + * Allocate path buffer from the heap. + */ + *bufp = malloc(size * sizeof(char)); + if (!*bufp) + return -ENOMEM; + } + + /* + * Fill in the path buffer. + */ + pno = cur; + cp = *bufp + len + n; + *cp = '\0'; /* NUL terminate */ + do { + /* + * If this is a covering path-node then the name should be + * the *covered* nodes name, not this one unless we are at + * the root of the name-space. + */ + while (pno == pno->p_mount->mnt_root && + pno != pno->p_parent ) + pno = pno->p_mount->mnt_covers; + + /* + * Add component and separator. + */ + cp -= pno->p_base->pb_key.pbk_name.len; + (void )memcpy(cp, pno->p_base->pb_key.pbk_name.name, + pno->p_base->pb_key.pbk_name.len); + + *--cp = PATH_SEPARATOR; + pno = pno->p_parent; + } while (pno != pno->p_parent); + + return 0; +} + +/* * Allocate, initialize and establish appropriate links for new path (alias) * node. */ @@ -649,6 +743,88 @@ _sysio_p_new_alias(struct pnode *parent, return pno; } +#ifdef P_DEBUG +/* + * Thread-safe strerror. + * + * Returns string describing the passed error number or NULL on failure. + */ +static char * +x_strerror(int err) +{ + char *s; + size_t buflen; + void *p; + int myerr; + + s = NULL; + buflen = 16; + for (;;) { + buflen <<= 1; + p = realloc(s, buflen); + if (!p) + free(s); + s = p; + if (!s) + break; + myerr = 0; +#if defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600 + if (strerror_r(err, s, buflen) != 0) + myerr = errno; +#elif defined(__GNU__) + { + p = strerror_r(err, s, buflen); + if (!p) + myerr = EINVAL; + else if (p != s) { + (void )strncpy(s, (char *)p, buflen - 1); + s[buflen = 1] = '\0'; + } + if (!myerr && strlen(s) == buflen - 1) + myerr = ERANGE; + } +#else +#error I do not know whtat strerror_r returns +#endif + if (!myerr) + break; + if (myerr == ERANGE) + continue; + free(s); + s = NULL; + errno = myerr; + break; + } + return s; +} + +void +_sysio_p_show(const char *pre, struct pnode *pno) +{ + int err; + char *path; + static char error_message[] = "<ERROR>"; + + path = NULL; + if ((err = _sysio_p_path(pno, &path, 0)) != 0) { + char *s; + + s = x_strerror(-err); + if (!s ||(path = malloc(strlen(s) + 2 + 1)) == NULL) { + if (s) + free(s); + path = error_message; + } else { + (void )sprintf(path, "<%s>", s); + free(s); + } + } + _sysio_diag_printf(pre, "%x:%x %s\n", pno->p_mount, pno, path); + if (path != error_message) + free(path); +} +#endif + /* * For reclamation of idle path (alias) node. */ @@ -658,6 +834,9 @@ _sysio_p_gone(struct pnode *pno) assert(!pno->p_ref); assert(!pno->p_cover); +#ifdef P_DEBUG + _sysio_p_show("P_GONE", pno); +#endif TAILQ_REMOVE(&_sysio_idle_pnodes, pno, p_idle); LIST_REMOVE(pno, p_links); @@ -758,8 +937,12 @@ _sysio_p_find_alias(struct pnode *parent if (!pno) err = -ENOMEM; } - if (!err) + if (!err) { +#ifdef P_DEBUG + _sysio_p_show("P_FIND_ALIAS", pno); +#endif *pnop = pno; + } return err; } |
From: Lee W. <lw...@us...> - 2008-04-14 23:26:17
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv490 Modified Files: mount.c Log Message: Two changes: 1) _sysio_do_mount and _sysio_do_unmount deliver a debug using _sysio_p_show when called. 2) _sysio_unmount_all always tries to unmount the front of the all-mounts list -- Latest is first. This, to avoid attempting to unmount a lower file system in the graph underneath a failed upper. Index: mount.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mount.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -w -b -B -p -r1.26 -r1.27 --- mount.c 24 Sep 2007 19:00:03 -0000 1.26 +++ mount.c 14 Apr 2008 23:26:13 -0000 1.27 @@ -74,7 +74,7 @@ struct qstr _sysio_mount_file_name = { " /* * Active mounts. */ -static LIST_HEAD(, mount) mounts; +LIST_HEAD(, mount) mounts; static int _sysio_sub_fsswop_mount(const char *source, unsigned flags, @@ -187,6 +187,9 @@ _sysio_do_mount(struct filesys *fs, LIST_INSERT_HEAD(&mounts, mnt, mnt_link); +#ifdef P_DEBUG + _sysio_p_show("DO_MOUNT", mnt->mnt_root); +#endif *mntp = mnt; return 0; @@ -239,6 +242,9 @@ _sysio_do_unmount(struct mount *mnt) */ return -EBUSY; } +#ifdef P_DEBUG + _sysio_p_show("DO_UNMOUNT", mnt->mnt_root); +#endif assert(mnt->mnt_covers->p_cover == root); if (_sysio_p_prune(root) != 1) { /* @@ -432,17 +438,15 @@ int _sysio_unmount_all() { int err; - struct mount *mnt, *nxt; + struct mount *mnt; struct pnode *pno; err = 0; - nxt = mounts.lh_first; - while ((mnt = nxt)) { - nxt = mnt->mnt_link.le_next; + while ((mnt = mounts.lh_first)) { pno = mnt->mnt_root; /* * If this is an automount generated mount, the root - * has no reference. We can cause the dismount with a + * has no reference. We can accomplish the dismount with a * simple prune. */ if (!_sysio_p_prune(pno)) |
From: Lee W. <lw...@us...> - 2008-04-14 23:22:51
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32572 Modified Files: chdir.c Log Message: The routine _sysio_p_path has moved to inode.c for general use by others. Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -w -b -B -p -r1.31 -r1.32 --- chdir.c 21 Sep 2007 19:41:37 -0000 1.31 +++ chdir.c 14 Apr 2008 23:22:47 -0000 1.32 @@ -143,100 +143,6 @@ sysio_sym_weak_alias(SYSIO_INTERFACE_NAM PREPEND(__, SYSIO_INTERFACE_NAME(chdir))) #endif -/* - * Return path tracked by the path ancestor chain. - * - * If the buf pointer is NULL, a buffer large enough to hold the path - * is allocated from the heap. - */ - -static int -_sysio_p_path(struct pnode *pno, char **buf, size_t size) -{ - struct pnode *cur; - size_t len; - size_t n; - char *cp; - - cur = pno; - - if (!size && buf && *buf) - return -EINVAL; - - /* - * Walk up the tree to the root, summing the component name - * lengths and counting the vertices. - */ - len = 0; - n = 0; - do { - /* - * If this is a covering path-node then the name should be - * the *covered* nodes name, not this one unless we are at - * the root of the name-space. - */ - while (pno == pno->p_mount->mnt_root && - pno != pno->p_parent) - pno = pno->p_mount->mnt_covers; - - /* - * Add length of this component to running sum and - * account for this vertex. - */ - assert((len >= pno->p_base->pb_key.pbk_name.len && - (size_t )~0 - pno->p_base->pb_key.pbk_name.len > len) || - (size_t )~0 - len > pno->p_base->pb_key.pbk_name.len); - len += pno->p_base->pb_key.pbk_name.len; - n++; - assert(n); - pno = pno->p_parent; - } while (pno && pno != pno->p_parent); - if (!pno) - return -ENOENT; - - if (!*buf) - size = len + n + 1; - if (len >= size || n >= size - len) - return -ERANGE; - if (!*buf) { - /* - * Allocate path buffer from the heap. - */ - *buf = malloc(size * sizeof(char)); - if (!*buf) - return -ENOMEM; - } - - /* - * Fill in the path buffer. - */ - pno = cur; - cp = *buf + len + n; - *cp = '\0'; /* NUL terminate */ - do { - /* - * If this is a covering path-node then the name should be - * the *covered* nodes name, not this one unless we are at - * the root of the name-space. - */ - while (pno == pno->p_mount->mnt_root && - pno != pno->p_parent ) - pno = pno->p_mount->mnt_covers; - - /* - * Add component and separator. - */ - cp -= pno->p_base->pb_key.pbk_name.len; - (void )memcpy(cp, pno->p_base->pb_key.pbk_name.name, - pno->p_base->pb_key.pbk_name.len); - - *--cp = PATH_SEPARATOR; - pno = pno->p_parent; - } while (pno != pno->p_parent); - - return 0; -} - char * SYSIO_INTERFACE_NAME(getcwd)(char *buf, size_t size) { |
From: Lee W. <lw...@us...> - 2008-04-14 23:22:03
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32184 Modified Files: inode.h Log Message: Two changes: 1) Made _sysio_p_path public. 2) Added _sysio_p_show for diagnostics. It is conditionally defined if P_DEBUG is defined. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.36 retrieving revision 1.37 diff -u -w -b -B -p -r1.36 -r1.37 --- inode.h 20 Nov 2007 18:01:42 -0000 1.36 +++ inode.h 14 Apr 2008 23:21:58 -0000 1.37 @@ -507,6 +507,10 @@ extern struct pnode_base *_sysio_pb_new( struct pnode_base *parent, struct inode *ino); extern void _sysio_pb_gone(struct pnode_base *pb); +extern int _sysio_p_path(struct pnode *pno, char **bufp, size_t size); +#ifdef P_DEBUG +extern void _sysio_p_show(const char *pre, struct pnode *pno); +#endif extern int _sysio_p_find_alias(struct pnode *parent, struct qstr *name, struct pnode **pnop); |
From: Lee W. <lw...@us...> - 2008-04-14 19:54:43
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17751 Modified Files: cprintf.c Log Message: Simplified version of _sysio_diag_printf. Index: cprintf.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/cprintf.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- cprintf.c 7 Apr 2008 18:59:48 -0000 1.2 +++ cprintf.c 14 Apr 2008 19:54:39 -0000 1.3 @@ -143,32 +143,21 @@ _sysio_cprintf(const char *fmt, ...) void _sysio_diag_printf(const char *funidnam, const char *fmt, ...) { - int prelen; char *pre; va_list ap; - int msglen; char *msg; - char *buf; - prelen = asprintf(&pre, "%s: ", funidnam); - if (prelen < 0) - return; + if (asprintf(&pre, "%s: ", funidnam) < 0) + pre = NULL; va_start(ap, fmt); - msglen = vasprintf(&msg, fmt, ap); + if (vasprintf(&msg, fmt, ap) < 0) + msg = NULL; va_end(ap); - if (msglen < 0) { - free(pre); - return; - } - buf = malloc(prelen - 1 + msglen); - if (buf) { - (void )strcpy(buf, pre); - (void )strcpy(buf + prelen, msg); - *(buf + prelen + msglen) = '\0'; - _sysio_cwrite(buf, prelen + msglen); - free(buf); - } + if (pre && msg) + _sysio_cprintf("%s%s", pre, msg); + if (msg) free(msg); + if (msg) free(pre); } #endif |
From: Lee W. <lw...@us...> - 2008-04-07 19:22:04
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3950 Modified Files: sysio.h Log Message: Oops. Forgot to declare _sysio_diag_printf only if NDEBUG was not defined. Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.44 retrieving revision 1.45 diff -u -w -b -B -p -r1.44 -r1.45 --- sysio.h 7 Apr 2008 18:59:48 -0000 1.44 +++ sysio.h 7 Apr 2008 19:22:00 -0000 1.45 @@ -153,7 +153,9 @@ extern char * _sysio_get_args(char *buf, extern time_t _sysio_local_time(void); extern void _sysio_cprintf(const char *fmt, ...); +#ifndef NDEBUG extern void _sysio_diag_printf(const char *funidnam, const char *fmt, ...); +#endif /* * The following should be defined by the system includes, and probably are, |
From: Lee W. <lw...@us...> - 2008-04-07 19:16:00
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1208 Modified Files: namei.c Log Message: Fixed bug in _sysio_path_walk where if the source did not exist then the routine would loop forever. Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -w -b -B -p -r1.27 -r1.28 --- namei.c 4 Mar 2008 18:07:08 -0000 1.27 +++ namei.c 7 Apr 2008 19:15:49 -0000 1.28 @@ -303,7 +303,7 @@ _sysio_path_walk(struct pnode *parent, s NULL, NULL, 1); - if (!err && (err = _sysio_automount(pno) == 0)) { + if (!err && (err = _sysio_automount(pno)) == 0) { struct pnode *root; /* |
From: Lee W. <lw...@us...> - 2008-04-07 18:59:56
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27524/src Modified Files: cprintf.c Log Message: Added routine and global definition for a rudimentary diagnostic printf called _sysio_diag_printf. Index: cprintf.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/cprintf.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -b -B -p -r1.1 -r1.2 --- cprintf.c 20 Aug 2007 16:02:56 -0000 1.1 +++ cprintf.c 7 Apr 2008 18:59:48 -0000 1.2 @@ -93,7 +93,6 @@ vasprintf(char **strp, const char *fmt, return n; } -#if 0 static int asprintf(char **strp, const char *fmt, ...) { @@ -105,7 +104,6 @@ asprintf(char **strp, const char *fmt, . va_end(ap); return n; } -#endif #endif /* !(defined(_HAVE_ASPRINTF) && _HAVE_ASPRINTF) */ static void @@ -137,3 +135,40 @@ _sysio_cprintf(const char *fmt, ...) _sysio_cwrite(buf, len); free(buf); } + +#ifndef NDEBUG +/* + * Diagnostic printf. + */ +void +_sysio_diag_printf(const char *funidnam, const char *fmt, ...) +{ + int prelen; + char *pre; + va_list ap; + int msglen; + char *msg; + char *buf; + + prelen = asprintf(&pre, "%s: ", funidnam); + if (prelen < 0) + return; + va_start(ap, fmt); + msglen = vasprintf(&msg, fmt, ap); + va_end(ap); + if (msglen < 0) { + free(pre); + return; + } + buf = malloc(prelen - 1 + msglen); + if (buf) { + (void )strcpy(buf, pre); + (void )strcpy(buf + prelen, msg); + *(buf + prelen + msglen) = '\0'; + _sysio_cwrite(buf, prelen + msglen); + free(buf); + } + free(msg); + free(pre); +} +#endif |
From: Lee W. <lw...@us...> - 2008-04-07 18:59:55
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27524/include Modified Files: sysio.h Log Message: Added routine and global definition for a rudimentary diagnostic printf called _sysio_diag_printf. Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.43 retrieving revision 1.44 diff -u -w -b -B -p -r1.43 -r1.44 --- sysio.h 20 Aug 2007 16:02:56 -0000 1.43 +++ sysio.h 7 Apr 2008 18:59:48 -0000 1.44 @@ -153,6 +153,7 @@ extern char * _sysio_get_args(char *buf, extern time_t _sysio_local_time(void); extern void _sysio_cprintf(const char *fmt, ...); +extern void _sysio_diag_printf(const char *funidnam, const char *fmt, ...); /* * The following should be defined by the system includes, and probably are, |
From: Lee W. <lw...@us...> - 2008-03-31 16:34:01
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21262 Modified Files: inode.c Log Message: If INO_CACHE_STATS was not defined at build time then neither was INO_CST_UPDCNT. IT is now, as a no-op, of course. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -w -b -B -p -r1.36 -r1.37 --- inode.c 4 Mar 2008 18:30:04 -0000 1.36 +++ inode.c 31 Mar 2008 16:33:55 -0000 1.37 @@ -138,6 +138,9 @@ ino_cstats_init() do { \ (cstats.cst_##__which)++; \ } while (0) +#else +#define INO_CST_UPDCNT(__which) \ + while (0) #endif /* |
From: Lee W. <lw...@us...> - 2008-03-04 18:30:09
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20548 Modified Files: inode.c Log Message: Changed definition of I_STATS to INO_CACHE_STATS. It's more descriptive. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -w -b -B -p -r1.35 -r1.36 --- inode.c 4 Mar 2008 15:24:05 -0000 1.35 +++ inode.c 4 Mar 2008 18:30:04 -0000 1.36 @@ -58,8 +58,6 @@ #include "inode.h" #include "dev.h" -/* #define I_STATS */ - /* * Support for path and index nodes. */ @@ -114,10 +112,6 @@ struct pnodes_head _sysio_idle_pnodes; */ struct pnode *_sysio_root = NULL; -#ifdef I_STATS -#define INO_CACHE_STATS -#endif - #ifdef INO_CACHE_STATS static struct { unsigned long long cst_iprobes; |
From: Lee W. <lw...@us...> - 2008-03-04 18:07:13
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6648/src Modified Files: namei.c Log Message: When doing an automount the pnode for the ".mount" file was not being held; It was released immediately after the lookup. It should be nailed down during the automount as well. It is now. Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -w -b -B -p -r1.26 -r1.27 --- namei.c 1 May 2007 16:33:53 -0000 1.26 +++ namei.c 4 Mar 2008 18:07:08 -0000 1.27 @@ -303,9 +303,7 @@ _sysio_path_walk(struct pnode *parent, s NULL, NULL, 1); - if (pno) - P_RELE(pno); - if (!err && _sysio_automount(pno) == 0) { + if (!err && (err = _sysio_automount(pno) == 0)) { struct pnode *root; /* @@ -337,6 +335,10 @@ _sysio_path_walk(struct pnode *parent, s path = nd->nd_path; nd->nd_amcnt++; + } + if (pno) + P_RELE(pno); + if (!err) { /* * Must go back top and retry with this * new pnode as parent. |
From: Lee W. <lw...@us...> - 2008-03-04 15:24:13
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4108/src Modified Files: inode.c Log Message: All cache stats now kept in a record instead of as separate file-scoped globals. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -w -b -B -p -r1.34 -r1.35 --- inode.c 20 Nov 2007 18:01:42 -0000 1.34 +++ inode.c 4 Mar 2008 15:24:05 -0000 1.35 @@ -115,9 +115,35 @@ struct pnodes_head _sysio_idle_pnodes; struct pnode *_sysio_root = NULL; #ifdef I_STATS -static unsigned long i_probes, i_hits; -static unsigned long pb_probes, pb_hits; -static unsigned long p_reclaims, p_examined, p_dismissed; +#define INO_CACHE_STATS +#endif + +#ifdef INO_CACHE_STATS +static struct { + unsigned long long cst_iprobes; + unsigned long long cst_ihits; + unsigned long long cst_pbprobes; + unsigned long long cst_pbhits; + unsigned long long cst_preclaims; + unsigned long long cst_pexamined; + unsigned long long cst_pdismissed; +} cstats; + +static void +ino_cstats_init() +{ + + cstats.cst_iprobes = cstats.cst_ihits = 0; + cstats.cst_pbprobes = cstats.cst_pbhits = 0; + cstats.cst_preclaims = + cstats.cst_pexamined = + cstats.cst_pdismissed = 0; +} + +#define INO_CST_UPDCNT(__which) \ + do { \ + (cstats.cst_##__which)++; \ + } while (0) #endif /* @@ -138,10 +164,8 @@ _sysio_i_init() max_names = desired_names; -#ifdef I_STATS - i_probes = i_hits = 0; - pb_probes = pb_hits = 0; - p_reclaims = p_examined = p_dismissed = 0; +#ifdef INO_CACHE_STATS + ino_cstats_init(); #endif return 0; @@ -270,15 +294,11 @@ _sysio_i_find(struct filesys *fs, struct fid->fid_data, fid->fid_len) == 0) { I_REF(ino); -#ifdef I_STATS - i_hits++; -#endif + INO_CST_UPDCNT(ihits); break; } -#ifdef I_STATS - i_probes++; -#endif + INO_CST_UPDCNT(iprobes); return ino; } @@ -344,17 +364,13 @@ p_reclaim(unsigned count) if (count) adjust = 1; -#ifdef I_STATS - p_reclaims++; -#endif + INO_CST_UPDCNT(preclaims); next = _sysio_idle_pnodes.tqh_first; if (!next) return; t = n_names / 2; do { -#ifdef I_STATS - p_examined++; -#endif + INO_CST_UPDCNT(pexamined); pno = next; next = pno->p_idle.tqe_next; if (pno->p_ref) @@ -366,9 +382,7 @@ p_reclaim(unsigned count) continue; } nxtpb = pno->p_base; -#ifdef I_STATS - p_dismissed++; -#endif + INO_CST_UPDCNT(pdismissed); _sysio_p_gone(pno); /* * Have to run up the tree, too. We might @@ -593,11 +607,17 @@ void _sysio_i_shutdown() { -#ifdef I_STATS - _sysio_cprintf("inode: probe %lu, hit %lu\n", i_probes, i_hits); - _sysio_cprintf("pbnode: probe %lu, hit %lu\n", pb_probes, pb_hits); - _sysio_cprintf("pnode: reclaims %lu, examined %lu dismissed %lu\n", - p_reclaims, p_examined, p_dismissed); +#ifdef INO_CACHE_STATS + _sysio_cprintf("inode: probe %llu, hit %llu\n", + cstats.cst_iprobes, + cstats.cst_ihits); + _sysio_cprintf("pbnode: probe %llu, hit %llu\n", + cstats.cst_pbprobes, + cstats.cst_pbhits); + _sysio_cprintf("pnode: reclaims %llu, examined %llu dismissed %llu\n", + cstats.cst_preclaims, + cstats.cst_pexamined, + cstats.cst_pdismissed); #endif max_names = desired_names; @@ -705,16 +725,12 @@ _sysio_p_find_alias(struct pnode *parent /* * Try the names table. */ -#ifdef I_STATS - pb_probes++; -#endif + INO_CST_UPDCNT(pbprobes); key.pbk_name = *name; key.pbk_parent = parent->p_base; pb = ncache_lookup(&key); -#ifdef I_STATS if (pb) - pb_hits++; -#endif + INO_CST_UPDCNT(pbhits); } if (!pb) { /* |
From: Ruth K. <rk...@us...> - 2008-02-29 23:14:40
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20864 Modified Files: chmod.c Log Message: reversed return code check caused chmod return -EPERM always Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -w -b -B -p -r1.19 -r1.20 --- chmod.c 20 Nov 2007 17:38:19 -0000 1.19 +++ chmod.c 29 Feb 2008 23:14:34 -0000 1.20 @@ -61,7 +61,7 @@ do_chmod(struct pnode *pno, mode_t mode) struct intnl_stat stbuf; unsigned mask; - if (!_sysio_permitted(pno, W_OK)) + if ((_sysio_permitted(pno, W_OK)) != 0) return -EPERM; (void )memset(&stbuf, 0, sizeof(struct intnl_stat)); |
From: Ruth K. <rk...@us...> - 2008-02-05 00:20:20
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17642 Modified Files: Tag: cray_tmp rename.c Log Message: Fix for Cray SPR 741235: extra reference caused abort during shutdown. This was a side effect of a previous change removing _sysio_p_gone call from this routine. Index: rename.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rename.c,v retrieving revision 1.12 retrieving revision 1.12.4.1 diff -u -w -b -B -p -r1.12 -r1.12.4.1 --- rename.c 15 Mar 2007 02:53:34 -0000 1.12 +++ rename.c 5 Feb 2008 00:20:06 -0000 1.12.4.1 @@ -176,7 +176,6 @@ SYSIO_INTERFACE_NAME(rename)(const char I_GONE(new->p_base->pb_ino); new->p_base->pb_ino = old->p_base->pb_ino; old->p_base->pb_ino = NULL; - I_REF(new->p_base->pb_ino); short_out: error1: |
From: Lee W. <lw...@us...> - 2007-11-30 18:12:55
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18531/include Modified Files: fs.h Log Message: Initialize file system ID to zero when instancing a new FS. This is a really nasty thing to do; All filesystems have the same ID. Unfortunately, can't do the right thing. It would require all drivers to mod their call to include the desired ID and we don't do such things between releases. Index: fs.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/fs.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- fs.h 1 May 2007 16:33:52 -0000 1.7 +++ fs.h 30 Nov 2007 18:12:52 -0000 1.8 @@ -124,6 +124,9 @@ struct filesys { /* * Init file system record. + * + * Fix me: FS ID always initialized to zero. The driver needs to supply the + * ID but the required change breaks compatibility. Must wait for next release. */ #define FS_INIT(fs, flags, ops, private) \ do { \ @@ -140,6 +143,7 @@ struct filesys { LIST_INIT(__head); \ __head++; \ } while (--__i); \ + (fs)->fs_id = 0; \ } while (0) /* |
From: Lee W. <lw...@us...> - 2007-11-30 18:10:39
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18030/src Modified Files: rw.c Log Message: This "last chance check for read-only" change should not have crept in yet. Reverting. Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -w -b -B -p -r1.27 -r1.28 --- rw.c 20 Nov 2007 18:06:20 -0000 1.27 +++ rw.c 30 Nov 2007 18:10:33 -0000 1.28 @@ -80,9 +80,6 @@ _sysio_post_io(int (*f)(struct inode *in assert(f != NULL && pno->p_base->pb_ino != NULL); - if (IS_RDONLY(pno)) - return -EROFS; - /* * Get new IO context. */ |
From: Lee W. <lw...@us...> - 2007-11-20 18:06:23
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6278/src Modified Files: rw.c Log Message: Add last-chance check for read-only in the post-io routine. Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -w -b -B -p -r1.26 -r1.27 --- rw.c 26 Oct 2007 19:48:23 -0000 1.26 +++ rw.c 20 Nov 2007 18:06:20 -0000 1.27 @@ -80,6 +80,9 @@ _sysio_post_io(int (*f)(struct inode *in assert(f != NULL && pno->p_base->pb_ino != NULL); + if (IS_RDONLY(pno)) + return -EROFS; + /* * Get new IO context. */ |
From: Lee W. <lw...@us...> - 2007-11-20 18:01:57
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4690/include Modified Files: inode.h Log Message: Crafted new _sysio_p_symlink routine and modified the symlink library entry-point to use it. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.35 retrieving revision 1.36 diff -u -w -b -B -p -r1.35 -r1.36 --- inode.h 20 Nov 2007 17:49:26 -0000 1.35 +++ inode.h 20 Nov 2007 18:01:42 -0000 1.36 @@ -528,6 +528,7 @@ extern int _sysio_p_setattr(struct pnode 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_symlink(const char *oldpath, struct pnode *new); extern int _sysio_p_rmdir(struct pnode *pno); extern int _sysio_p_rename(struct pnode *old, struct pnode *new); extern void _sysio_do_noop(void); |
From: Lee W. <lw...@us...> - 2007-11-20 18:01:46
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4690/src Modified Files: inode.c symlink.c Log Message: Crafted new _sysio_p_symlink routine and modified the symlink library entry-point to use it. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -w -b -B -p -r1.33 -r1.34 --- inode.c 20 Nov 2007 17:49:26 -0000 1.33 +++ inode.c 20 Nov 2007 18:01:42 -0000 1.34 @@ -1044,6 +1044,20 @@ _sysio_p_unlink(struct pnode *pno) } /* + * Perform symlink operation; oldpath to new. + */ +int +_sysio_p_symlink(const char *oldpath, struct pnode *new) +{ + + if (new->p_base->pb_ino) + return -EEXIST; + if (IS_RDONLY(new->p_parent)) + return -EROFS; + return PNOP_SYMLINK(new, oldpath); +} + +/* * Perform remove directory operation on some pnode. */ int Index: symlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/symlink.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -b -B -p -r1.18 -r1.19 --- symlink.c 2 Jul 2007 18:58:17 -0000 1.18 +++ symlink.c 20 Nov 2007 18:01:42 -0000 1.19 @@ -50,8 +50,6 @@ #include "sysio.h" #include "inode.h" -#include "fs.h" -#include "mount.h" #include "sysio-symbols.h" int @@ -63,6 +61,9 @@ SYSIO_INTERFACE_NAME(symlink)(const char SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER(symlink, "%s%s", oldpath, newpath); + err = 0; + pno = NULL; + do { INTENT_INIT(&intent, INT_CREAT, NULL, NULL); err = _sysio_namei(_sysio_cwd, @@ -71,19 +72,14 @@ SYSIO_INTERFACE_NAME(symlink)(const char &intent, &pno); if (err) - goto out; - if (pno->p_base->pb_ino) { - err = -EEXIST; - goto error; - } + break; err = _sysio_permitted(pno->p_parent, W_OK); if (err) - goto error; - - err = PNOP_SYMLINK(pno, oldpath); -error: + break; + err = _sysio_p_symlink(oldpath, pno); + } while (0); + if (pno) P_RELE(pno); -out: SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, symlink, "%d", 0); } |