svn commit: r261948 - head/games/fortune/datfiles
Author: marcus (doc,ports committer) Date: Sat Feb 15 22:15:24 2014 New Revision: 261948 URL: http://svnweb.freebsd.org/changeset/base/261948 Log: Correct a typo in Malcolm MacDougall's name. Approved by: gabor Modified: head/games/fortune/datfiles/fortunes Modified: head/games/fortune/datfiles/fortunes == --- head/games/fortune/datfiles/fortunesSat Feb 15 21:59:00 2014 (r261947) +++ head/games/fortune/datfiles/fortunesSat Feb 15 22:15:24 2014 (r261948) @@ -41033,7 +41033,7 @@ Sex is an emotion in motion. % Sex is as honest a product benefit for fragrance [perfume] as taste is for diet Coke. - -- Malcolm DacDougall + -- Malcolm MacDougall % Sex is good, but not as good as fresh sweet corn. -- Garrison Keillor ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r197839 - stable/7/lib/libc
Author: marcus (doc,ports committer) Date: Wed Oct 7 15:41:30 2009 New Revision: 197839 URL: http://svn.freebsd.org/changeset/base/197839 Log: Record mergeinfo data for r197681. Approved by: kib Modified: stable/7/lib/libc/ (props changed) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r197846 - stable/6/lib/libc
Author: marcus (doc,ports committer) Date: Wed Oct 7 21:05:40 2009 New Revision: 197846 URL: http://svn.freebsd.org/changeset/base/197846 Log: Record merginfo data for r197681. Approved by: kib Modified: stable/6/lib/libc/ (props changed) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r197792 - stable/8/lib/libc/gen
Author: marcus (doc,ports committer) Date: Mon Oct 5 20:38:36 2009 New Revision: 197792 URL: http://svn.freebsd.org/changeset/base/197792 Log: Add merginfo for the _pthread_stubs.c commit which merged r197681 to stable/8. Requested by: kib Approved by: re (kib) Modified: stable/8/lib/libc/gen/ (props changed) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r197758 - stable/8/lib/libc/gen
Author: marcus (doc,ports committer) Date: Sun Oct 4 21:46:43 2009 New Revision: 197758 URL: http://svn.freebsd.org/changeset/base/197758 Log: MFC: rev. 197681 Correct the pthread stub prototype for pthread_mutexattr_settype to allow for the type argument. This is known to fix some pthread_mutexattr_settype() invocations, especially when it comes to pulseaudio. Approved by: re (kib) Modified: stable/8/lib/libc/gen/_pthread_stubs.c Modified: stable/8/lib/libc/gen/_pthread_stubs.c == --- stable/8/lib/libc/gen/_pthread_stubs.c Sun Oct 4 21:22:19 2009 (r197757) +++ stable/8/lib/libc/gen/_pthread_stubs.c Sun Oct 4 21:46:43 2009 (r197758) @@ -222,7 +222,7 @@ STUB_FUNC1(pthread_mutex_trylock, PJT_MU STUB_FUNC1(pthread_mutex_unlock, PJT_MUTEX_UNLOCK, int, void *) STUB_FUNC1(pthread_mutexattr_destroy, PJT_MUTEXATTR_DESTROY, int, void *) STUB_FUNC1(pthread_mutexattr_init, PJT_MUTEXATTR_INIT, int, void *) -STUB_FUNC1(pthread_mutexattr_settype, PJT_MUTEXATTR_SETTYPE, int, void *) +STUB_FUNC2(pthread_mutexattr_settype, PJT_MUTEXATTR_SETTYPE, int, void *, int) STUB_FUNC2(pthread_once, PJT_ONCE, int, void *, void *) STUB_FUNC1(pthread_rwlock_destroy, PJT_RWLOCK_DESTROY, int, void *) STUB_FUNC2(pthread_rwlock_init,PJT_RWLOCK_INIT, int, void *, void *) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r197759 - stable/7/lib/libc/gen
Author: marcus (doc,ports committer) Date: Sun Oct 4 21:48:17 2009 New Revision: 197759 URL: http://svn.freebsd.org/changeset/base/197759 Log: MFC: rev. 197681 Correct the pthread stub prototype for pthread_mutexattr_settype to allow for the type argument. This is known to fix some pthread_mutexattr_settype() invocations, especially when it comes to pulseaudio. Approved by: kib Modified: stable/7/lib/libc/gen/_pthread_stubs.c Modified: stable/7/lib/libc/gen/_pthread_stubs.c == --- stable/7/lib/libc/gen/_pthread_stubs.c Sun Oct 4 21:46:43 2009 (r197758) +++ stable/7/lib/libc/gen/_pthread_stubs.c Sun Oct 4 21:48:17 2009 (r197759) @@ -222,7 +222,7 @@ STUB_FUNC1(pthread_mutex_trylock, PJT_MU STUB_FUNC1(pthread_mutex_unlock, PJT_MUTEX_UNLOCK, int, void *) STUB_FUNC1(pthread_mutexattr_destroy, PJT_MUTEXATTR_DESTROY, int, void *) STUB_FUNC1(pthread_mutexattr_init, PJT_MUTEXATTR_INIT, int, void *) -STUB_FUNC1(pthread_mutexattr_settype, PJT_MUTEXATTR_SETTYPE, int, void *) +STUB_FUNC2(pthread_mutexattr_settype, PJT_MUTEXATTR_SETTYPE, int, void *, int) STUB_FUNC2(pthread_once, PJT_ONCE, int, void *, void *) STUB_FUNC1(pthread_rwlock_destroy, PJT_RWLOCK_DESTROY, int, void *) STUB_FUNC2(pthread_rwlock_init,PJT_RWLOCK_INIT, int, void *, void *) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r197760 - stable/6/lib/libc/gen
Author: marcus (doc,ports committer) Date: Sun Oct 4 21:50:29 2009 New Revision: 197760 URL: http://svn.freebsd.org/changeset/base/197760 Log: MFC: rev. 197681 Correct the pthread stub prototype for pthread_mutexattr_settype to allow for the type argument. This is known to fix some pthread_mutexattr_settype() invocations, especially when it comes to pulseaudio. Approved by: kib Modified: stable/6/lib/libc/gen/_pthread_stubs.c Modified: stable/6/lib/libc/gen/_pthread_stubs.c == --- stable/6/lib/libc/gen/_pthread_stubs.c Sun Oct 4 21:48:17 2009 (r197759) +++ stable/6/lib/libc/gen/_pthread_stubs.c Sun Oct 4 21:50:29 2009 (r197760) @@ -188,7 +188,7 @@ STUB_FUNC1(pthread_mutex_trylock, PJT_MU STUB_FUNC1(pthread_mutex_unlock, PJT_MUTEX_UNLOCK, int, void *) STUB_FUNC1(pthread_mutexattr_destroy, PJT_MUTEXATTR_DESTROY, int, void *) STUB_FUNC1(pthread_mutexattr_init, PJT_MUTEXATTR_INIT, int, void *) -STUB_FUNC1(pthread_mutexattr_settype, PJT_MUTEXATTR_SETTYPE, int, void *) +STUB_FUNC2(pthread_mutexattr_settype, PJT_MUTEXATTR_SETTYPE, int, void *, int) STUB_FUNC2(pthread_once, PJT_ONCE, int, void *, void *) STUB_FUNC1(pthread_rwlock_destroy, PJT_RWLOCK_DESTROY, int, void *) STUB_FUNC2(pthread_rwlock_init,PJT_RWLOCK_INIT, int, void *, void *) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r197681 - head/lib/libc/gen
Author: marcus (doc,ports committer) Date: Thu Oct 1 18:23:50 2009 New Revision: 197681 URL: http://svn.freebsd.org/changeset/base/197681 Log: Correct the pthread stub prototype for pthread_mutexattr_settype to allow for the type argument. This is known to fix some pthread_mutexattr_settype() invocations, especially when it comes to pulseaudio. Approved by: kib deischen (threads) MFC after:3 days Modified: head/lib/libc/gen/_pthread_stubs.c Modified: head/lib/libc/gen/_pthread_stubs.c == --- head/lib/libc/gen/_pthread_stubs.c Thu Oct 1 17:22:03 2009 (r197680) +++ head/lib/libc/gen/_pthread_stubs.c Thu Oct 1 18:23:50 2009 (r197681) @@ -222,7 +222,7 @@ STUB_FUNC1(pthread_mutex_trylock, PJT_MU STUB_FUNC1(pthread_mutex_unlock, PJT_MUTEX_UNLOCK, int, void *) STUB_FUNC1(pthread_mutexattr_destroy, PJT_MUTEXATTR_DESTROY, int, void *) STUB_FUNC1(pthread_mutexattr_init, PJT_MUTEXATTR_INIT, int, void *) -STUB_FUNC1(pthread_mutexattr_settype, PJT_MUTEXATTR_SETTYPE, int, void *) +STUB_FUNC2(pthread_mutexattr_settype, PJT_MUTEXATTR_SETTYPE, int, void *, int) STUB_FUNC2(pthread_once, PJT_ONCE, int, void *, void *) STUB_FUNC1(pthread_rwlock_destroy, PJT_RWLOCK_DESTROY, int, void *) STUB_FUNC2(pthread_rwlock_init,PJT_RWLOCK_INIT, int, void *, void *) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r196741 - in stable/8: sys sys/amd64/include/xen sys/cddl/contrib/opensolaris sys/contrib/dev/acpica sys/contrib/pf sys/dev/xen/xenpci sys/fs/fifofs sys/kern tools/regression/poll
Jilles Tjoelker wrote: Author: jilles Date: Tue Sep 1 20:58:41 2009 New Revision: 196741 URL: http://svn.freebsd.org/changeset/base/196741 Log: MFC r196460 Fix the conformance of poll(2) for sockets after r195423 by returning POLLHUP instead of POLLIN for several cases. Now, the tools/regression/poll results for FreeBSD are closer to that of the Solaris and Linux. This is a huge change in terms of porting. I can't tell you how many times I've had to fix Linux (GNOME) apps to work on FreeBSD in this regard. Is this fix going to be ported to 7.X? Can we get a __FreeBSD_version bump? Joe -- Joe Marcus Clarke FreeBSD GNOME Team :: gn...@freebsd.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r195750 - head/etc/pam.d
Author: marcus (doc,ports committer) Date: Sat Jul 18 06:08:21 2009 New Revision: 195750 URL: http://svn.freebsd.org/changeset/base/195750 Log: Remove this file. It is no longer needed as x11/gdm provides its own version under /usr/local/etc/pam.d. Approved by: re (kib) Deleted: head/etc/pam.d/gdm ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r195753 - head/etc/pam.d
Author: marcus (doc,ports committer) Date: Sat Jul 18 16:29:40 2009 New Revision: 195753 URL: http://svn.freebsd.org/changeset/base/195753 Log: Remove gdm as it is no longer needed. Approved by: re (kib) Reminded by: nork Modified: head/etc/pam.d/Makefile Modified: head/etc/pam.d/Makefile == --- head/etc/pam.d/Makefile Sat Jul 18 11:12:48 2009(r195752) +++ head/etc/pam.d/Makefile Sat Jul 18 16:29:40 2009(r195753) @@ -6,7 +6,6 @@ FILES= README \ atrun \ cron \ ftpd \ - gdm \ imap \ kde \ login \ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r195754 - head
Author: marcus (doc,ports committer) Date: Sat Jul 18 16:33:27 2009 New Revision: 195754 URL: http://svn.freebsd.org/changeset/base/195754 Log: Add an entry for etc/pam.d/gdm as this file is no longer required. Approved by: re (kib) Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Sat Jul 18 16:29:40 2009(r195753) +++ head/ObsoleteFiles.inc Sat Jul 18 16:33:27 2009(r195754) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20090718: the gdm pam.d file is no longer required. +OLD_FILES+=etc/pam.d/gdm # 20090713: vimage container structs removed. OLD_FILES+=usr/include/netinet/vinet.h OLD_FILES+=usr/include/netinet6/vinet6.h ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r195750 - head/etc/pam.d
On Sat, 2009-07-18 at 17:56 +0900, Norikatsu Shigemura wrote: Hi marcus. On Sat, 18 Jul 2009 06:08:21 + (UTC) Joe Marcus Clarke mar...@freebsd.org wrote: Author: marcus (doc,ports committer) Date: Sat Jul 18 06:08:21 2009 New Revision: 195750 URL: http://svn.freebsd.org/changeset/base/195750 Log: Remove this file. It is no longer needed as x11/gdm provides its own version under /usr/local/etc/pam.d. Approved by: re (kib) Please remove 'gdm' from src/etc/pam.d/Makefile, too! Sorry, fixed. Thanks for the whack upside the head. Joe -- Joe Marcus Clarke FreeBSD GNOME Team :: gn...@freebsd.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome signature.asc Description: This is a digitally signed message part
Re: svn commit: r195750 - head/etc/pam.d
On Sat, 2009-07-18 at 13:00 +0300, Kostik Belousov wrote: On Sat, Jul 18, 2009 at 05:56:46PM +0900, Norikatsu Shigemura wrote: Hi marcus. On Sat, 18 Jul 2009 06:08:21 + (UTC) Joe Marcus Clarke mar...@freebsd.org wrote: Author: marcus (doc,ports committer) Date: Sat Jul 18 06:08:21 2009 New Revision: 195750 URL: http://svn.freebsd.org/changeset/base/195750 Log: Remove this file. It is no longer needed as x11/gdm provides its own version under /usr/local/etc/pam.d. Approved by:re (kib) Please remove 'gdm' from src/etc/pam.d/Makefile, too! Hmm, and add it to the ObsoleteFiles.inc. Done. Thanks for the reminder. Joe -- Joe Marcus Clarke FreeBSD GNOME Team :: gn...@freebsd.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome signature.asc Description: This is a digitally signed message part
svn commit: r193518 - head/sys/kern
Author: marcus (doc,ports committer) Date: Fri Jun 5 16:44:42 2009 New Revision: 193518 URL: http://svn.freebsd.org/changeset/base/193518 Log: Unlock the cache lock before returning when we run out of buffer space trying to fill in the full path name. Reported by: David Naylor naylor.b.da...@gmail.com Approved by: kib Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c == --- head/sys/kern/vfs_cache.c Fri Jun 5 16:43:47 2009(r193517) +++ head/sys/kern/vfs_cache.c Fri Jun 5 16:44:42 2009(r193518) @@ -1140,8 +1140,10 @@ vn_fullpath1(struct thread *td, struct v error = vn_vptocnp_locked(vp, buf, buflen); if (error) return (error); - if (buflen == 0) + if (buflen == 0) { + CACHE_RUNLOCK(); return (ENOMEM); + } buf[--buflen] = '/'; slash_prefixed = 1; } @@ -1169,6 +1171,7 @@ vn_fullpath1(struct thread *td, struct v if (error) break; if (buflen == 0) { + CACHE_RUNLOCK(); error = ENOMEM; SDT_PROBE(vfs, namecache, fullpath, return, error, startvp, NULL, 0, 0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r189539 - head/sys/kern
On Tue, 2009-03-10 at 11:03 +0200, Giorgos Keramidas wrote: On Sun, 8 Mar 2009 19:05:54 + (UTC), Joe Marcus Clarke mar...@freebsd.org wrote: Author: marcus (doc,ports committer) Date: Sun Mar 8 19:05:53 2009 New Revision: 189539 URL: http://svn.freebsd.org/changeset/base/189539 Log: Add a default implementation for VOP_VPTOCNP(9) which scans the parent directory of a vnode to find a dirent with a matching file number. The name from that dirent is then used to provide the component name. Note: if the initial vnode argument is not a directory itself, then the default VOP_VPTOCNP(9) implementation still returns ENOENT. Reviewed by: kib Approved by: kib Tested by:pho I think this panics nullfs mounts. I have a kernel build from subversion changeset /h...@189540 that panics instantly with: Yep, kib committed a patch for this today. Joe -- Joe Marcus Clarke FreeBSD GNOME Team :: gn...@freebsd.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome signature.asc Description: This is a digitally signed message part
svn commit: r189539 - head/sys/kern
Author: marcus (doc,ports committer) Date: Sun Mar 8 19:05:53 2009 New Revision: 189539 URL: http://svn.freebsd.org/changeset/base/189539 Log: Add a default implementation for VOP_VPTOCNP(9) which scans the parent directory of a vnode to find a dirent with a matching file number. The name from that dirent is then used to provide the component name. Note: if the initial vnode argument is not a directory itself, then the default VOP_VPTOCNP(9) implementation still returns ENOENT. Reviewed by: kib Approved by: kib Tested by:pho Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c == --- head/sys/kern/vfs_default.c Sun Mar 8 18:02:30 2009(r189538) +++ head/sys/kern/vfs_default.c Sun Mar 8 19:05:53 2009(r189539) @@ -48,8 +48,11 @@ __FBSDID($FreeBSD$); #include sys/malloc.h #include sys/mount.h #include sys/mutex.h +#include sys/namei.h +#include sys/fcntl.h #include sys/unistd.h #include sys/vnode.h +#include sys/dirent.h #include sys/poll.h #include vm/vm.h @@ -63,6 +66,14 @@ __FBSDID($FreeBSD$); static int vop_nolookup(struct vop_lookup_args *); static int vop_nostrategy(struct vop_strategy_args *); +static int get_next_dirent(struct vnode *vp, struct dirent **dpp, + char *dirbuf, int dirbuflen, off_t *off, + char **cpos, int *len, int *eofflag, + struct thread *td); +static int dirent_exists(struct vnode *vp, const char *dirname, + struct thread *td); + +#define DIRENT_MINSIZE (sizeof(struct dirent) - (MAXNAMLEN+1) + 4) /* * This vnode table stores what we want to do if the filesystem doesn't @@ -98,7 +109,7 @@ struct vop_vector default_vnodeops = { .vop_revoke = VOP_PANIC, .vop_strategy = vop_nostrategy, .vop_unlock = vop_stdunlock, - .vop_vptocnp = VOP_ENOENT, + .vop_vptocnp = vop_stdvptocnp, .vop_vptofh = vop_stdvptofh, }; @@ -210,6 +221,108 @@ vop_nostrategy (struct vop_strategy_args return (EOPNOTSUPP); } +static int +get_next_dirent(struct vnode *vp, struct dirent **dpp, char *dirbuf, + int dirbuflen, off_t *off, char **cpos, int *len, + int *eofflag, struct thread *td) +{ + int error, reclen; + struct uio uio; + struct iovec iov; + struct dirent *dp; + + KASSERT(VOP_ISLOCKED(vp), (vp %p is not locked, vp)); + KASSERT(vp-v_type == VDIR, (vp %p is not a directory, vp)); + + if (*len == 0) { + iov.iov_base = dirbuf; + iov.iov_len = dirbuflen; + + uio.uio_iov = iov; + uio.uio_iovcnt = 1; + uio.uio_offset = *off; + uio.uio_resid = dirbuflen; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_rw = UIO_READ; + uio.uio_td = td; + + *eofflag = 0; + +#ifdef MAC + error = mac_vnode_check_readdir(td-td_ucred, vp); + if (error == 0) +#endif + error = VOP_READDIR(vp, uio, td-td_ucred, eofflag, + NULL, NULL); + if (error) + return (error); + + *off = uio.uio_offset; + + *cpos = dirbuf; + *len = (dirbuflen - uio.uio_resid); + } + + dp = (struct dirent *)(*cpos); + reclen = dp-d_reclen; + *dpp = dp; + + /* check for malformed directory.. */ + if (reclen DIRENT_MINSIZE) + return (EINVAL); + + *cpos += reclen; + *len -= reclen; + + return (0); +} + +/* + * Check if a named file exists in a given directory vnode. + */ +static int +dirent_exists(struct vnode *vp, const char *dirname, struct thread *td) +{ + char *dirbuf, *cpos; + int error, eofflag, dirbuflen, len, found; + off_t off; + struct dirent *dp; + struct vattr va; + + KASSERT(VOP_ISLOCKED(vp), (vp %p is not locked, vp)); + KASSERT(vp-v_type == VDIR, (vp %p is not a directory, vp)); + + found = 0; + + error = VOP_GETATTR(vp, va, td-td_ucred); + if (error) + return (found); + + dirbuflen = DEV_BSIZE; + if (dirbuflen va.va_blocksize) + dirbuflen = va.va_blocksize; + dirbuf = (char *)malloc(dirbuflen, M_TEMP, M_WAITOK); + + off = 0; + len = 0; + do { + error = get_next_dirent(vp, dp, dirbuf, dirbuflen, off, + cpos, len, eofflag, td); + if (error) + goto out; + + if ((dp-d_type != DT_WHT) + !strcmp(dp-d_name, dirname)) { + found = 1; + goto out; +
svn commit: r189541 - head/share/man/man9
Author: marcus (doc,ports committer) Date: Sun Mar 8 19:07:44 2009 New Revision: 189541 URL: http://svn.freebsd.org/changeset/base/189541 Log: Document the new default implementation of VOP_VPTOCNP(9). Approved by: kib Modified: head/share/man/man9/VOP_VPTOCNP.9 Modified: head/share/man/man9/VOP_VPTOCNP.9 == --- head/share/man/man9/VOP_VPTOCNP.9 Sun Mar 8 19:06:26 2009 (r189540) +++ head/share/man/man9/VOP_VPTOCNP.9 Sun Mar 8 19:07:44 2009 (r189541) @@ -57,7 +57,13 @@ The remaining size of the buffer. .Pp The default implementation of .Nm -simply returns ENOENT. +scans through +.Fa vp Ns 's +parent directory looking for a dirent with a matching file number. If +.Fa vp +is not a directory, then +.Nm +returns ENOENT. .Sh LOCKS The vnode should be locked on entry and will still be locked on exit. The parent directory vnode will be unlocked on a successful exit. However, it ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r189295 - head/sys/dev/ata/chipsets
On Tue, 2009-03-03 at 06:39 +, Alexander Motin wrote: Author: mav Date: Tue Mar 3 06:39:38 2009 New Revision: 189295 URL: http://svn.freebsd.org/changeset/base/189295 Log: Set PortMultiplier port only for SATA2 channels, where it is applicable. Doing it on old SATA controllers like Promise PDC20375 SATA150 breaks their operation. Thanks! My Tinderbox machine thanks you as well. Joe Tested by: marcus on PDC20375 Modified: head/sys/dev/ata/chipsets/ata-promise.c Modified: head/sys/dev/ata/chipsets/ata-promise.c == --- head/sys/dev/ata/chipsets/ata-promise.c Tue Mar 3 03:33:25 2009 (r189294) +++ head/sys/dev/ata/chipsets/ata-promise.c Tue Mar 3 06:39:38 2009 (r189295) @@ -690,8 +690,11 @@ ata_promise_mio_command(struct ata_reque ATA_OUTL(ctlr-r_res2, (ch-unit + 1) 2, 0x0001); -/* set portmultiplier port */ -ATA_OUTB(ctlr-r_res2, 0x4e8 + (ch-unit 8), atadev-unit 0x0f); +if ((ctlr-chip-cfg2 == PR_SATA2) || +((ctlr-chip-cfg2 == PR_CMBO2) (ch-unit 2))) { + /* set portmultiplier port */ + ATA_OUTB(ctlr-r_res2, 0x4e8 + (ch-unit 8), atadev-unit 0x0f); +} /* XXX SOS add ATAPI commands support later */ switch (request-u.ata.command) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org -- PGP Key : http://www.marcuscom.com/pgp.asc signature.asc Description: This is a digitally signed message part
Re: svn commit: r189275 - in head/sys/dev: ata sound/usb usb usb/bluetooth usb/image usb/input usb/misc usb/net usb/serial usb/storage usb/wlan
On Mon, 2009-03-02 at 05:37 +, Andrew Thompson wrote: Author: thompsa Date: Mon Mar 2 05:37:05 2009 New Revision: 189275 URL: http://svn.freebsd.org/changeset/base/189275 Log: Rename the ushub device class back to uhub as it was in the old usb stack, moused(8) looks for uhub/ums to decide if needs to load the module. This breaks hal. Can you bump __FreeBSD_version? Joe Reported by:Garrett Cooper Modified: head/sys/dev/ata/ata-usb.c head/sys/dev/sound/usb/uaudio.c head/sys/dev/usb/bluetooth/ng_ubt.c head/sys/dev/usb/bluetooth/ubtbcmfw.c head/sys/dev/usb/image/uscanner.c head/sys/dev/usb/input/uhid.c head/sys/dev/usb/input/ukbd.c head/sys/dev/usb/input/ums.c head/sys/dev/usb/misc/udbp.c head/sys/dev/usb/misc/ufm.c head/sys/dev/usb/net/if_aue.c head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/net/if_cue.c head/sys/dev/usb/net/if_kue.c head/sys/dev/usb/net/if_rue.c head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/serial/uark.c head/sys/dev/usb/serial/ubsa.c head/sys/dev/usb/serial/ubser.c head/sys/dev/usb/serial/uchcom.c head/sys/dev/usb/serial/ucycom.c head/sys/dev/usb/serial/ufoma.c head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/serial/ugensa.c head/sys/dev/usb/serial/uipaq.c head/sys/dev/usb/serial/ulpt.c head/sys/dev/usb/serial/umct.c head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/serial/umoscom.c head/sys/dev/usb/serial/uplcom.c head/sys/dev/usb/serial/uslcom.c head/sys/dev/usb/serial/uvisor.c head/sys/dev/usb/serial/uvscom.c head/sys/dev/usb/storage/umass.c head/sys/dev/usb/storage/urio.c head/sys/dev/usb/storage/ustorage_fs.c head/sys/dev/usb/usb_compat_linux.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/ata/ata-usb.c == --- head/sys/dev/ata/ata-usb.cMon Mar 2 05:07:05 2009 (r189274) +++ head/sys/dev/ata/ata-usb.cMon Mar 2 05:37:05 2009 (r189275) @@ -271,7 +271,7 @@ static driver_t atausb2_driver = { .size = sizeof(struct atausb2_softc), }; -DRIVER_MODULE(atausb, ushub, atausb2_driver, atausb2_devclass, 0, 0); +DRIVER_MODULE(atausb, uhub, atausb2_driver, atausb2_devclass, 0, 0); MODULE_DEPEND(atausb, usb, 1, 1, 1); MODULE_VERSION(atausb, 1); Modified: head/sys/dev/sound/usb/uaudio.c == --- head/sys/dev/sound/usb/uaudio.c Mon Mar 2 05:07:05 2009 (r189274) +++ head/sys/dev/sound/usb/uaudio.c Mon Mar 2 05:37:05 2009 (r189275) @@ -3742,7 +3742,7 @@ umidi_detach(device_t dev) return (0); } -DRIVER_MODULE(uaudio, ushub, uaudio_driver, uaudio_devclass, NULL, 0); +DRIVER_MODULE(uaudio, uhub, uaudio_driver, uaudio_devclass, NULL, 0); MODULE_DEPEND(uaudio, usb, 1, 1, 1); MODULE_DEPEND(uaudio, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); MODULE_VERSION(uaudio, 1); Modified: head/sys/dev/usb/bluetooth/ng_ubt.c == --- head/sys/dev/usb/bluetooth/ng_ubt.c Mon Mar 2 05:07:05 2009 (r189274) +++ head/sys/dev/usb/bluetooth/ng_ubt.c Mon Mar 2 05:37:05 2009 (r189275) @@ -1710,7 +1710,7 @@ static driver_t ubt_driver = .size =sizeof(struct ubt_softc), }; -DRIVER_MODULE(ng_ubt, ushub, ubt_driver, ubt_devclass, ubt_modevent, 0); +DRIVER_MODULE(ng_ubt, uhub, ubt_driver, ubt_devclass, ubt_modevent, 0); MODULE_VERSION(ng_ubt, NG_BLUETOOTH_VERSION); MODULE_DEPEND(ng_ubt, netgraph, NG_ABI_VERSION, NG_ABI_VERSION, NG_ABI_VERSION); MODULE_DEPEND(ng_ubt, ng_hci, NG_BLUETOOTH_VERSION, NG_BLUETOOTH_VERSION, NG_BLUETOOTH_VERSION); Modified: head/sys/dev/usb/bluetooth/ubtbcmfw.c == --- head/sys/dev/usb/bluetooth/ubtbcmfw.c Mon Mar 2 05:07:05 2009 (r189274) +++ head/sys/dev/usb/bluetooth/ubtbcmfw.c Mon Mar 2 05:37:05 2009 (r189275) @@ -157,7 +157,7 @@ static driver_t ubtbcmfw_driver = .size = sizeof(struct ubtbcmfw_softc), }; -DRIVER_MODULE(ubtbcmfw, ushub, ubtbcmfw_driver, ubtbcmfw_devclass, NULL, 0); +DRIVER_MODULE(ubtbcmfw, uhub, ubtbcmfw_driver, ubtbcmfw_devclass, NULL, 0); MODULE_DEPEND(ubtbcmfw, usb, 1, 1, 1); /* Modified: head/sys/dev/usb/image/uscanner.c == --- head/sys/dev/usb/image/uscanner.c Mon Mar 2 05:07:05 2009 (r189274) +++ head/sys/dev/usb/image/uscanner.c Mon Mar 2 05:37:05 2009 (r189275) @@ -200,7 +200,7 @@ static driver_t
Re: svn commit: r189275 - in head/sys/dev: ata sound/usb usb usb/bluetooth usb/image usb/input usb/misc usb/net usb/serial usb/storage usb/wlan
On Sun, 2009-03-01 at 21:46 -0800, Garrett Cooper wrote: On Sun, Mar 1, 2009 at 9:41 PM, Joe Marcus Clarke mar...@marcuscom.com wrote: On Mon, 2009-03-02 at 05:37 +, Andrew Thompson wrote: Author: thompsa Date: Mon Mar 2 05:37:05 2009 New Revision: 189275 URL: http://svn.freebsd.org/changeset/base/189275 Log: Rename the ushub device class back to uhub as it was in the old usb stack, moused(8) looks for uhub/ums to decide if needs to load the module. This breaks hal. Can you bump __FreeBSD_version? Joe How does this break hal? I was using ushub as a usb2 identifier to plug usb devices into the hal device tree. Simply adding uhub would cause problems with oldusb. Since Andrew just bumped __FreeBSD_version, I can adjust as needed. Joe -- PGP Key : http://www.marcuscom.com/pgp.asc signature.asc Description: This is a digitally signed message part
Re: svn commit: r188978 - in head: etc/mtree include usr.bin/kdump
On Tue, 2009-02-24 at 00:53 +, Andrew Thompson wrote: Author: thompsa Date: Tue Feb 24 00:53:10 2009 New Revision: 188978 URL: http://svn.freebsd.org/changeset/base/188978 Log: Install the old usb headers under /usr/include/legacy/dev/usb as they are needed by the hal port. This will be removed before 8.0. Add an exclusion to kdump as some structs will be redefined. Requested by: marcus Thanks! Joe -- PGP Key : http://www.marcuscom.com/pgp.asc signature.asc Description: This is a digitally signed message part
svn commit: r186617 - head/sys/fs/pseudofs
Author: marcus (doc,ports committer) Date: Tue Dec 30 21:49:39 2008 New Revision: 186617 URL: http://svn.freebsd.org/changeset/base/186617 Log: Add a VOP_VPTOCNP implementation for pseudofs which covers file systems such as procfs and linprocfs. This implementation's locking was enhanced by kib. Reviewed by: kib des Approved by: des kib Tested by:pho Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c == --- head/sys/fs/pseudofs/pseudofs_vnops.c Tue Dec 30 20:51:07 2008 (r186616) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Tue Dec 30 21:49:39 2008 (r186617) @@ -310,6 +310,84 @@ pfs_getextattr(struct vop_getextattr_arg } /* + * Convert a vnode to its component name + */ +static int +pfs_vptocnp(struct vop_vptocnp_args *ap) +{ + struct vnode *vp = ap-a_vp; + struct vnode **dvp = ap-a_vpp; + struct pfs_vdata *pvd = vp-v_data; + struct pfs_node *pd = pvd-pvd_pn; + struct pfs_node *pn; + struct mount *mp; + char *buf = ap-a_buf; + int *buflen = ap-a_buflen; + char pidbuf[PFS_NAMELEN]; + pid_t pid = pvd-pvd_pid; + int len, i, error, locked; + + i = *buflen; + error = 0; + + pfs_lock(pd); + + if (vp-v_type == VDIR pd-pn_type == pfstype_root) { + *dvp = vp; + vhold(*dvp); + pfs_unlock(pd); + PFS_RETURN (0); + } else if (vp-v_type == VDIR pd-pn_type == pfstype_procdir) { + len = snprintf(pidbuf, sizeof(pidbuf), %d, pid); + i -= len; + if (i 0) { + error = ENOMEM; + goto failed; + } + bcopy(pidbuf, buf + i, len); + } else { + i -= strlen(pd-pn_name); + if (i 0) { + error = ENOMEM; + goto failed; + } + bcopy(pd-pn_name, buf + i, strlen(pd-pn_name)); + } + + pn = pd-pn_parent; + pfs_unlock(pd); + + mp = vp-v_mount; + error = vfs_busy(mp, 0); + if (error) + return (error); + + /* +* vp is held by caller. +*/ + locked = VOP_ISLOCKED(vp); + VOP_UNLOCK(vp, 0); + + error = pfs_vncache_alloc(mp, dvp, pn, pid); + if (error) { + vn_lock(vp, locked | LK_RETRY); + vfs_unbusy(mp); + PFS_RETURN(error); + } + + *buflen = i; + vhold(*dvp); + vput(*dvp); + vn_lock(vp, locked | LK_RETRY); + vfs_unbusy(mp); + + PFS_RETURN (0); +failed: + pfs_unlock(pd); + PFS_RETURN(error); +} + +/* * Look up a file or directory */ static int @@ -890,6 +968,7 @@ struct vop_vector pfs_vnodeops = { .vop_rmdir =VOP_EOPNOTSUPP, .vop_setattr = pfs_setattr, .vop_symlink = VOP_EOPNOTSUPP, + .vop_vptocnp = pfs_vptocnp, .vop_write =pfs_write, /* XXX I've probably forgotten a few that need VOP_EOPNOTSUPP */ }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r186336 - stable/7/lib/libutil
Author: marcus (doc,ports committer) Date: Fri Dec 19 20:19:59 2008 New Revision: 186336 URL: http://svn.freebsd.org/changeset/base/186336 Log: MFC r186314: Initialize the cntp pointer to 0 prior to doing any work so that callers don't try to iterate through garbage or NULL memory. Additionally, return NULL instead of 0 on error. Approved by: re (kib) Modified: stable/7/lib/libutil/kinfo_getfile.c stable/7/lib/libutil/kinfo_getvmmap.c Modified: stable/7/lib/libutil/kinfo_getfile.c == --- stable/7/lib/libutil/kinfo_getfile.cFri Dec 19 18:47:46 2008 (r186335) +++ stable/7/lib/libutil/kinfo_getfile.cFri Dec 19 20:19:59 2008 (r186336) @@ -19,6 +19,7 @@ kinfo_getfile(pid_t pid, int *cntp) char *buf, *bp, *eb; struct kinfo_file *kif, *kp, *kf; + *cntp = 0; len = 0; mib[0] = CTL_KERN; mib[1] = KERN_PROC; @@ -27,15 +28,15 @@ kinfo_getfile(pid_t pid, int *cntp) error = sysctl(mib, 4, NULL, len, NULL, 0); if (error) - return (0); + return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) - return (0); + return (NULL); error = sysctl(mib, 4, buf, len, NULL, 0); if (error) { free(buf); - return (0); + return (NULL); } /* Pass 1: count items */ cnt = 0; @@ -50,7 +51,7 @@ kinfo_getfile(pid_t pid, int *cntp) kif = calloc(cnt, sizeof(*kif)); if (kif == NULL) { free(buf); - return (0); + return (NULL); } bp = buf; eb = buf + len; Modified: stable/7/lib/libutil/kinfo_getvmmap.c == --- stable/7/lib/libutil/kinfo_getvmmap.c Fri Dec 19 18:47:46 2008 (r186335) +++ stable/7/lib/libutil/kinfo_getvmmap.c Fri Dec 19 20:19:59 2008 (r186336) @@ -19,6 +19,7 @@ kinfo_getvmmap(pid_t pid, int *cntp) char *buf, *bp, *eb; struct kinfo_vmentry *kiv, *kp, *kv; + *cntp = 0; len = 0; mib[0] = CTL_KERN; mib[1] = KERN_PROC; @@ -27,15 +28,15 @@ kinfo_getvmmap(pid_t pid, int *cntp) error = sysctl(mib, 4, NULL, len, NULL, 0); if (error) - return (0); + return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) - return (0); + return (NULL); error = sysctl(mib, 4, buf, len, NULL, 0); if (error) { free(buf); - return (0); + return (NULL); } /* Pass 1: count items */ cnt = 0; @@ -50,7 +51,7 @@ kinfo_getvmmap(pid_t pid, int *cntp) kiv = calloc(cnt, sizeof(*kiv)); if (kiv == NULL) { free(buf); - return (0); + return (NULL); } bp = buf; eb = buf + len; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r186314 - head/lib/libutil
Author: marcus (doc,ports committer) Date: Fri Dec 19 06:47:59 2008 New Revision: 186314 URL: http://svn.freebsd.org/changeset/base/186314 Log: Initialize the cntp pointer to 0 prior to doing any work so that callers don't try to iterate through garbage or NULL memory. Additionally, return NULL instead of 0 on error. Reviewed by: peter Approved by: peter Modified: head/lib/libutil/kinfo_getfile.c head/lib/libutil/kinfo_getvmmap.c Modified: head/lib/libutil/kinfo_getfile.c == --- head/lib/libutil/kinfo_getfile.cFri Dec 19 06:34:57 2008 (r186313) +++ head/lib/libutil/kinfo_getfile.cFri Dec 19 06:47:59 2008 (r186314) @@ -19,6 +19,7 @@ kinfo_getfile(pid_t pid, int *cntp) char *buf, *bp, *eb; struct kinfo_file *kif, *kp, *kf; + *cntp = 0; len = 0; mib[0] = CTL_KERN; mib[1] = KERN_PROC; @@ -27,15 +28,15 @@ kinfo_getfile(pid_t pid, int *cntp) error = sysctl(mib, 4, NULL, len, NULL, 0); if (error) - return (0); + return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) - return (0); + return (NULL); error = sysctl(mib, 4, buf, len, NULL, 0); if (error) { free(buf); - return (0); + return (NULL); } /* Pass 1: count items */ cnt = 0; @@ -50,7 +51,7 @@ kinfo_getfile(pid_t pid, int *cntp) kif = calloc(cnt, sizeof(*kif)); if (kif == NULL) { free(buf); - return (0); + return (NULL); } bp = buf; eb = buf + len; Modified: head/lib/libutil/kinfo_getvmmap.c == --- head/lib/libutil/kinfo_getvmmap.c Fri Dec 19 06:34:57 2008 (r186313) +++ head/lib/libutil/kinfo_getvmmap.c Fri Dec 19 06:47:59 2008 (r186314) @@ -19,6 +19,7 @@ kinfo_getvmmap(pid_t pid, int *cntp) char *buf, *bp, *eb; struct kinfo_vmentry *kiv, *kp, *kv; + *cntp = 0; len = 0; mib[0] = CTL_KERN; mib[1] = KERN_PROC; @@ -27,15 +28,15 @@ kinfo_getvmmap(pid_t pid, int *cntp) error = sysctl(mib, 4, NULL, len, NULL, 0); if (error) - return (0); + return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) - return (0); + return (NULL); error = sysctl(mib, 4, buf, len, NULL, 0); if (error) { free(buf); - return (0); + return (NULL); } /* Pass 1: count items */ cnt = 0; @@ -50,7 +51,7 @@ kinfo_getvmmap(pid_t pid, int *cntp) kiv = calloc(cnt, sizeof(*kiv)); if (kiv == NULL) { free(buf); - return (0); + return (NULL); } bp = buf; eb = buf + len; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r186315 - head/usr.bin/procstat
Author: marcus (doc,ports committer) Date: Fri Dec 19 06:50:15 2008 New Revision: 186315 URL: http://svn.freebsd.org/changeset/base/186315 Log: Do not segfault when procstat -f or procstat -v is called on a process not owned by the current user. If kinfo_getfile() or kinfo_getvmmap() return NULL, simply exit, and do not try and derefernce the memory. Reviewed by: peter Approved by: peter Modified: head/usr.bin/procstat/procstat_files.c head/usr.bin/procstat/procstat_vm.c Modified: head/usr.bin/procstat/procstat_files.c == --- head/usr.bin/procstat/procstat_files.c Fri Dec 19 06:47:59 2008 (r186314) +++ head/usr.bin/procstat/procstat_files.c Fri Dec 19 06:50:15 2008 (r186315) @@ -144,6 +144,8 @@ procstat_files(pid_t pid, struct kinfo_p PRO, NAME); freep = kinfo_getfile(pid, cnt); + if (freep == NULL) + return; for (i = 0; i cnt; i++) { kif = freep[i]; Modified: head/usr.bin/procstat/procstat_vm.c == --- head/usr.bin/procstat/procstat_vm.c Fri Dec 19 06:47:59 2008 (r186314) +++ head/usr.bin/procstat/procstat_vm.c Fri Dec 19 06:50:15 2008 (r186315) @@ -54,6 +54,8 @@ procstat_vm(pid_t pid, struct kinfo_proc PRES, REF, SHD, FL, TP, PATH); freep = kinfo_getvmmap(pid, cnt); + if (freep == NULL) + return; for (i = 0; i cnt; i++) { kve = freep[i]; printf(%5d , pid); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r185956 - head/sys/kern
Author: marcus (doc,ports committer) Date: Fri Dec 12 00:57:38 2008 New Revision: 185956 URL: http://svn.freebsd.org/changeset/base/185956 Log: Add a new VOP, VOP_VPTOCNP, which translates a vnode to its component name on a best-effort basis. Teach vn_fullpath to use this new VOP if a regular VFS cache lookup fails. This VOP is designed to supplement the VFS cache to provide a better chance that a vnode-to-name lookup will succeed. Currently, an implementation for devfs is being committed. The default implementation is to return ENOENT. A big thanks to kib for the mentorship on this, and to pho for running it through his stress test suite. Reviewed by: arch Approved by: kib Modified: head/sys/kern/vfs_cache.c head/sys/kern/vfs_default.c head/sys/kern/vnode_if.src Modified: head/sys/kern/vfs_cache.c == --- head/sys/kern/vfs_cache.c Fri Dec 12 00:56:00 2008(r185955) +++ head/sys/kern/vfs_cache.c Fri Dec 12 00:57:38 2008(r185956) @@ -169,6 +169,7 @@ SYSCTL_OPAQUE(_vfs_cache, OID_AUTO, nchs static void cache_zap(struct namecache *ncp); +static int vn_vptocnp(struct vnode **vp, char **bp, char *buf, u_int *buflen); static int vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, char *buf, char **retbuf, u_int buflen); @@ -840,6 +841,38 @@ vn_fullpath_global(struct thread *td, st return (error); } +static int +vn_vptocnp(struct vnode **vp, char **bp, char *buf, u_int *buflen) +{ + struct vnode *dvp; + int error, vfslocked; + + vhold(*vp); + CACHE_UNLOCK(); + vfslocked = VFS_LOCK_GIANT((*vp)-v_mount); + vn_lock(*vp, LK_SHARED | LK_RETRY); + vdrop(*vp); + error = VOP_VPTOCNP(*vp, dvp, buf, buflen); + VOP_UNLOCK(*vp, 0); + VFS_UNLOCK_GIANT(vfslocked); + if (error) { + numfullpathfail2++; + return (error); + } + *bp = buf + *buflen; + *vp = dvp; + CACHE_LOCK(); + if ((*vp)-v_iflag VI_DOOMED) { + /* forced unmount */ + CACHE_UNLOCK(); + vdrop(*vp); + return (ENOENT); + } + vdrop(*vp); + + return (0); +} + /* * The magic behind kern___getcwd() and vn_fullpath(). */ @@ -851,7 +884,8 @@ vn_fullpath1(struct thread *td, struct v int error, i, slash_prefixed; struct namecache *ncp; - bp = buf + buflen - 1; + buflen--; + bp = buf + buflen; *bp = '\0'; error = 0; slash_prefixed = 0; @@ -860,58 +894,77 @@ vn_fullpath1(struct thread *td, struct v numfullpathcalls++; if (vp-v_type != VDIR) { ncp = TAILQ_FIRST(vp-v_cache_dst); - if (!ncp) { - numfullpathfail2++; - CACHE_UNLOCK(); - return (ENOENT); + if (ncp != NULL) { + for (i = ncp-nc_nlen - 1; i = 0 bp buf; i--) + *--bp = ncp-nc_name[i]; + if (bp == buf) { + numfullpathfail4++; + CACHE_UNLOCK(); + return (ENOMEM); + } + vp = ncp-nc_dvp; + } else { + error = vn_vptocnp(vp, bp, buf, buflen); + if (error) { + return (error); + } } - for (i = ncp-nc_nlen - 1; i = 0 bp buf; i--) - *--bp = ncp-nc_name[i]; - if (bp == buf) { + *--bp = '/'; + buflen--; + if (buflen 0) { numfullpathfail4++; CACHE_UNLOCK(); return (ENOMEM); } - *--bp = '/'; slash_prefixed = 1; - vp = ncp-nc_dvp; } while (vp != rdir vp != rootvnode) { if (vp-v_vflag VV_ROOT) { if (vp-v_iflag VI_DOOMED) { /* forced unmount */ + CACHE_UNLOCK(); error = EBADF; break; } vp = vp-v_mount-mnt_vnodecovered; continue; } - if (vp-v_dd == NULL) { + if (vp-v_type != VDIR) { numfullpathfail1++; + CACHE_UNLOCK(); error = ENOTDIR; break; } ncp = TAILQ_FIRST(vp-v_cache_dst); - if (!ncp) { - numfullpathfail2++; - error = ENOENT; - break; +
svn commit: r185957 - head/sys/sys
Author: marcus (doc,ports committer) Date: Fri Dec 12 00:58:52 2008 New Revision: 185957 URL: http://svn.freebsd.org/changeset/base/185957 Log: Add a new error VOP, VOP_ENOENT. This function will simply return ENOENT. Reviewed by: arch Approved by: kib Modified: head/sys/sys/vnode.h Modified: head/sys/sys/vnode.h == --- head/sys/sys/vnode.hFri Dec 12 00:57:38 2008(r185956) +++ head/sys/sys/vnode.hFri Dec 12 00:58:52 2008(r185957) @@ -659,6 +659,7 @@ int vop_stdvptofh(struct vop_vptofh_args intvop_eopnotsupp(struct vop_generic_args *ap); intvop_ebadf(struct vop_generic_args *ap); intvop_einval(struct vop_generic_args *ap); +intvop_enoent(struct vop_generic_args *ap); intvop_enotty(struct vop_generic_args *ap); intvop_null(struct vop_generic_args *ap); intvop_panic(struct vop_generic_args *ap); @@ -723,6 +724,7 @@ extern struct vop_vector default_vnodeop #define VOP_EBADF ((void*)(uintptr_t)vop_ebadf) #define VOP_ENOTTY ((void*)(uintptr_t)vop_enotty) #define VOP_EINVAL ((void*)(uintptr_t)vop_einval) +#define VOP_ENOENT ((void*)(uintptr_t)vop_enoent) #define VOP_EOPNOTSUPP ((void*)(uintptr_t)vop_eopnotsupp) /* vfs_hash.c */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r185958 - head/sys/fs/deadfs
Author: marcus (doc,ports committer) Date: Fri Dec 12 00:59:36 2008 New Revision: 185958 URL: http://svn.freebsd.org/changeset/base/185958 Log: Add a simple VOP_VPTOCNP implementation for deadfs which returns EBADF. Reviewed by: arch Approved by: kib Modified: head/sys/fs/deadfs/dead_vnops.c Modified: head/sys/fs/deadfs/dead_vnops.c == --- head/sys/fs/deadfs/dead_vnops.c Fri Dec 12 00:58:52 2008 (r185957) +++ head/sys/fs/deadfs/dead_vnops.c Fri Dec 12 00:59:36 2008 (r185958) @@ -78,6 +78,7 @@ struct vop_vector dead_vnodeops = { .vop_rmdir =VOP_PANIC, .vop_setattr = VOP_EBADF, .vop_symlink = VOP_PANIC, + .vop_vptocnp = VOP_EBADF, .vop_write =dead_write, }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r185959 - head/sys/fs/devfs
Author: marcus (doc,ports committer) Date: Fri Dec 12 01:00:38 2008 New Revision: 185959 URL: http://svn.freebsd.org/changeset/base/185959 Log: Implement VOP_VPTOCNP for devfs. Directory and character device vnodes are properly translated to their component names. Reviewed by: arch Approved by: kib Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c == --- head/sys/fs/devfs/devfs_vnops.c Fri Dec 12 00:59:36 2008 (r185958) +++ head/sys/fs/devfs/devfs_vnops.c Fri Dec 12 01:00:38 2008 (r185959) @@ -185,6 +185,69 @@ devfs_clear_cdevpriv(void) devfs_fpdrop(fp); } +static int +devfs_vptocnp(struct vop_vptocnp_args *ap) +{ + struct vnode *vp = ap-a_vp; + struct vnode **dvp = ap-a_vpp; + struct devfs_mount *dmp; + char *buf = ap-a_buf; + int *buflen = ap-a_buflen; + struct devfs_dirent *dd, *de; + int i, error; + + dmp = VFSTODEVFS(vp-v_mount); + i = *buflen; + dd = vp-v_data; + error = 0; + + sx_xlock(dmp-dm_lock); + + if (vp-v_type == VCHR) { + i -= strlen(dd-de_cdp-cdp_c.si_name); + if (i 0) { + error = ENOMEM; + goto finished; + } + bcopy(dd-de_cdp-cdp_c.si_name, buf + i, + strlen(dd-de_cdp-cdp_c.si_name)); + de = dd-de_dir; + } else if (vp-v_type == VDIR) { + if (dd == dmp-dm_rootdir) { + *dvp = vp; + vhold(*dvp); + goto finished; + } + i -= dd-de_dirent-d_namlen; + if (i 0) { + error = ENOMEM; + goto finished; + } + bcopy(dd-de_dirent-d_name, buf + i, + dd-de_dirent-d_namlen); + de = dd; + } else { + error = ENOENT; + goto finished; + } + *buflen = i; + de = TAILQ_FIRST(de-de_dlist);/* . */ + de = TAILQ_NEXT(de, de_list); /* .. */ + de = de-de_dir; + mtx_lock(devfs_de_interlock); + *dvp = de-de_vnode; + if (*dvp != NULL) { + VI_LOCK(*dvp); + mtx_unlock(devfs_de_interlock); + vholdl(*dvp); + VI_UNLOCK(*dvp); + } else + error = ENOENT; +finished: + sx_xunlock(dmp-dm_lock); + return (error); +} + /* * Construct the fully qualified path name relative to the mountpoint */ @@ -1465,6 +1528,7 @@ static struct vop_vector devfs_vnodeops .vop_setlabel = devfs_setlabel, #endif .vop_symlink = devfs_symlink, + .vop_vptocnp = devfs_vptocnp, }; static struct vop_vector devfs_specops = { @@ -1499,6 +1563,7 @@ static struct vop_vector devfs_specops = #endif .vop_strategy = VOP_PANIC, .vop_symlink = VOP_PANIC, + .vop_vptocnp = devfs_vptocnp, .vop_write =VOP_PANIC, }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r185961 - head/share/man/man9
Author: marcus (doc,ports committer) Date: Fri Dec 12 01:08:28 2008 New Revision: 185961 URL: http://svn.freebsd.org/changeset/base/185961 Log: Add a man page for VOP_VPTOCNP. Reviewed by: arch Approved by: kib Added: head/share/man/man9/VOP_VPTOCNP.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile == --- head/share/man/man9/MakefileFri Dec 12 01:01:03 2008 (r185960) +++ head/share/man/man9/MakefileFri Dec 12 01:08:28 2008 (r185961) @@ -348,6 +348,7 @@ MAN=accept_filter.9 \ VOP_SETACL.9 \ VOP_SETEXTATTR.9 \ VOP_STRATEGY.9 \ + VOP_VPTOCNP.9 \ VOP_VPTOFH.9 \ vput.9 \ vref.9 \ Added: head/share/man/man9/VOP_VPTOCNP.9 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/VOP_VPTOCNP.9 Fri Dec 12 01:08:28 2008 (r185961) @@ -0,0 +1,110 @@ +.\ -*- nroff -*- +.\ +.\ Copyright (c) 2008 Joe Marcus Clarke +.\ +.\ All rights reserved. +.\ +.\ This program is free software. +.\ +.\ Redistribution and use in source and binary forms, with or without +.\ modification, are permitted provided that the following conditions +.\ are met: +.\ 1. Redistributions of source code must retain the above copyright +.\notice, this list of conditions and the following disclaimer. +.\ 2. Redistributions in binary form must reproduce the above copyright +.\notice, this list of conditions and the following disclaimer in the +.\documentation and/or other materials provided with the distribution. +.\ +.\ THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\ IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\ +.\ $FreeBSD$ +.\ +.Dd December 7, 2008 +.Os +.Dt VOP_VPTOCNP 9 +.Sh NAME +.Nm VOP_VPTOCNP +.Nd translate a vnode to its component name +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.Ft int +.Fn VOP_VPTOCNP struct vnode *vp struct vnode **dvp char *buf int *buflen +.Sh DESCRIPTION +This translates a vnode into its component name, and writes that name to +the head of the buffer specified by +.Fa buf +.Bl -tag -width buflen +.It Fa vp +The vnode to translate. +.It Fa dvp +The vnode of the parent directory of +.Fa vp . +.It Fa buf +The buffer into which to preprend the component name. +.It Fa buflen +The remaining size of the buffer. +.El +.Pp +The default implementation of +.Nm +simply returns ENOENT. +.Sh LOCKS +The vnode should be locked on entry and will still be locked on exit. The +parent directory vnode will be unlocked on a successful exit. However, it +will have its hold count incremented. +.Sh RETURN VALUES +Zero is returned on success, otherwise an error code is returned. +.Sh PSEUDOCODE +.Bd -literal +int +vop_vptocnp(struct vnode *vp, struct vnode **dvp, char *buf, int *buflen) +{ +int error = 0; + +/* + * Translate the vnode to its component name. + * + * Decrement the component name's length from buflen. + * + * Obtain the vnode's parent directory vnode. + */ +...; + +/* + * Increment the parent directory's hold count. + */ +vhold(*dvp); + +return error; +} +.Ed +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er ENOMEM +The buffer was not large enough to hold the vnode's component name. +.It Bq Er ENOENT +The vnode was not found on the file system. +.El +.Sh SEE ALSO +.Xr VOP_LOOKUP 9 , +.Xr vnode 9 +.Sh NOTES +This interface is a work in progress. +.Sh HISTORY +The function +.Nm +appeared in +.Fx 8.0 . +.Sh AUTHORS +This manual page was written by +.An Joe Marcus Clarke . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r185968 - head/sys/sys
Author: marcus (doc,ports committer) Date: Fri Dec 12 04:29:47 2008 New Revision: 185968 URL: http://svn.freebsd.org/changeset/base/185968 Log: Bump __FreeBSD_version for the new VOP_VPTOCNP addition. Approved by: kib (implicit) Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h == --- head/sys/sys/param.hFri Dec 12 03:23:50 2008(r185967) +++ head/sys/sys/param.hFri Dec 12 04:29:47 2008(r185968) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800057 /* Master, propagated to newvers */ +#define __FreeBSD_version 800058 /* Master, propagated to newvers */ #ifndef LOCORE #include sys/types.h ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r185298 - head/sys/kern
Author: marcus (doc,ports committer) Date: Tue Nov 25 15:36:15 2008 New Revision: 185298 URL: http://svn.freebsd.org/changeset/base/185298 Log: Move vn_fullpath1() outside of FILEDESC locking. This is being done in advance of teaching vn_fullpath1() how to query file systems for vnode-to-name mappings when cache lookups fail. Thanks to kib for guidance and patience on this process. Reviewed by: kib Approved by: kib Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c == --- head/sys/kern/vfs_cache.c Tue Nov 25 14:14:58 2008(r185297) +++ head/sys/kern/vfs_cache.c Tue Nov 25 15:36:15 2008(r185298) @@ -716,7 +716,8 @@ kern___getcwd(struct thread *td, u_char { char *bp, *tmpbuf; struct filedesc *fdp; - int error; + struct vnode *cdir, *rdir; + int error, vfslocked; if (disablecwd) return (ENODEV); @@ -728,9 +729,18 @@ kern___getcwd(struct thread *td, u_char tmpbuf = malloc(buflen, M_TEMP, M_WAITOK); fdp = td-td_proc-p_fd; FILEDESC_SLOCK(fdp); - error = vn_fullpath1(td, fdp-fd_cdir, fdp-fd_rdir, tmpbuf, - bp, buflen); + cdir = fdp-fd_cdir; + VREF(cdir); + rdir = fdp-fd_rdir; + VREF(rdir); FILEDESC_SUNLOCK(fdp); + error = vn_fullpath1(td, cdir, rdir, tmpbuf, bp, buflen); + vfslocked = VFS_LOCK_GIANT(rdir-v_mount); + vrele(rdir); + VFS_UNLOCK_GIANT(vfslocked); + vfslocked = VFS_LOCK_GIANT(cdir-v_mount); + vrele(cdir); + VFS_UNLOCK_GIANT(vfslocked); if (!error) { if (bufseg == UIO_SYSSPACE) @@ -771,7 +781,8 @@ vn_fullpath(struct thread *td, struct vn { char *buf; struct filedesc *fdp; - int error; + struct vnode *rdir; + int error, vfslocked; if (disablefullpath) return (ENODEV); @@ -781,8 +792,13 @@ vn_fullpath(struct thread *td, struct vn buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); fdp = td-td_proc-p_fd; FILEDESC_SLOCK(fdp); - error = vn_fullpath1(td, vn, fdp-fd_rdir, buf, retbuf, MAXPATHLEN); + rdir = fdp-fd_rdir; + VREF(rdir); FILEDESC_SUNLOCK(fdp); + error = vn_fullpath1(td, vn, rdir, buf, retbuf, MAXPATHLEN); + vfslocked = VFS_LOCK_GIANT(rdir-v_mount); + vrele(rdir); + VFS_UNLOCK_GIANT(vfslocked); if (!error) *freebuf = buf; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to [EMAIL PROTECTED]