From owner-p4-projects@FreeBSD.ORG Tue Jul 11 20:12:09 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4A68C16A50B; Tue, 11 Jul 2006 20:12:09 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2633616A4EB for ; Tue, 11 Jul 2006 20:12:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD35E43D72 for ; Tue, 11 Jul 2006 20:12:08 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k6BKC8iO091015 for ; Tue, 11 Jul 2006 20:12:08 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6BKC8Hr091012 for perforce@freebsd.org; Tue, 11 Jul 2006 20:12:08 GMT (envelope-from jhb@freebsd.org) Date: Tue, 11 Jul 2006 20:12:08 GMT Message-Id: <200607112012.k6BKC8Hr091012@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 101288 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2006 20:12:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=101288 Change 101288 by jhb@jhb_mutex on 2006/07/11 20:12:08 Make ibcs2 consumers of VOP_READDIR() and friends MPSAFE. Affected files ... .. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_misc.c#28 edit .. //depot/projects/smpng/sys/i386/ibcs2/syscalls.master#15 edit .. //depot/projects/smpng/sys/notes#77 edit Differences ... ==== //depot/projects/smpng/sys/i386/ibcs2/ibcs2_misc.c#28 (text+ko) ==== @@ -329,7 +329,7 @@ struct iovec aiov; struct ibcs2_dirent idb; off_t off; /* true file offset */ - int buflen, error, eofflag; + int buflen, error, eofflag, vfslocked; u_long *cookies = NULL, *cookiep; int ncookies; #define BSD_DIRENT(cp) ((struct dirent *)(cp)) @@ -342,7 +342,9 @@ return (EBADF); } vp = fp->f_vnode; + vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { /* XXX vnode readdir op should do this */ + VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return (EINVAL); } @@ -459,6 +461,7 @@ td->td_retval[0] = uap->nbytes - resid; out: VOP_UNLOCK(vp, 0, td); + VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); if (cookies) free(cookies, M_TEMP); @@ -484,7 +487,7 @@ char name[14]; } idb; off_t off; /* true file offset */ - int buflen, error, eofflag, size; + int buflen, error, eofflag, size, vfslocked; u_long *cookies = NULL, *cookiep; int ncookies; @@ -499,7 +502,9 @@ return (EBADF); } vp = fp->f_vnode; + vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { + VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return read(td, (struct read_args *)uap); } @@ -622,6 +627,7 @@ td->td_retval[0] = uap->nbytes - resid; out: VOP_UNLOCK(vp, 0, td); + VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); if (cookies) free(cookies, M_TEMP); ==== //depot/projects/smpng/sys/i386/ibcs2/syscalls.master#15 (text+ko) ==== @@ -39,7 +39,7 @@ 1 AUE_EXIT MNOPROTO { void sys_exit(int rval); } exit \ sys_exit_args void 2 AUE_FORK MNOPROTO { int fork(void); } -3 AUE_NULL STD { int ibcs2_read(int fd, char *buf, \ +3 AUE_NULL MSTD { int ibcs2_read(int fd, char *buf, \ u_int nbytes); } 4 AUE_NULL MNOPROTO { int write(int fd, char *buf, \ u_int nbytes); } @@ -146,7 +146,7 @@ 78 AUE_NULL UNIMPL rfs_rfsys 79 AUE_RMDIR MSTD { int ibcs2_rmdir(char *path); } 80 AUE_MKDIR MSTD { int ibcs2_mkdir(char *path, int mode); } -81 AUE_GETDIRENTRIES STD { int ibcs2_getdents(int fd, char *buf, \ +81 AUE_GETDIRENTRIES MSTD { int ibcs2_getdents(int fd, char *buf, \ int nbytes); } 82 AUE_NULL UNIMPL nosys 83 AUE_NULL UNIMPL nosys ==== //depot/projects/smpng/sys/notes#77 (text+ko) ==== @@ -93,11 +93,11 @@ - linux - linux_uselib() - ibcs2 - - ibcs2_read() + + ibcs2_read() - ibcs2_mount() - ibcs2_umount() - ibcs2_ioctl() - - ibcs2_getdents() + + ibcs2_getdents() - ibcs2_sigprocmask() - don't mess with td_retval in any kern_foo() functions