From owner-p4-projects@FreeBSD.ORG Tue Jun 27 21:08:20 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 7F24816A40F; Tue, 27 Jun 2006 21:08:20 +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 32E1A16A407 for ; Tue, 27 Jun 2006 21:08:20 +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 1617D43E6F for ; Tue, 27 Jun 2006 21:08:10 +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 k5RL895V006495 for ; Tue, 27 Jun 2006 21:08:09 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5RL89wd006492 for perforce@freebsd.org; Tue, 27 Jun 2006 21:08:09 GMT (envelope-from jhb@freebsd.org) Date: Tue, 27 Jun 2006 21:08:09 GMT Message-Id: <200606272108.k5RL89wd006492@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 100173 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, 27 Jun 2006 21:08:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=100173 Change 100173 by jhb@jhb_mutex on 2006/06/27 21:07:11 Add VFS Giant locking to svr4 getdents functions and mark MPSAFE. Affected files ... .. //depot/projects/smpng/sys/compat/svr4/svr4_misc.c#48 edit .. //depot/projects/smpng/sys/compat/svr4/syscalls.master#16 edit Differences ... ==== //depot/projects/smpng/sys/compat/svr4/svr4_misc.c#48 (text+ko) ==== @@ -240,7 +240,7 @@ struct iovec aiov; off_t off; struct svr4_dirent64 svr4_dirent; - int buflen, error, eofflag, nbytes, justone; + int buflen, error, eofflag, nbytes, justone, vfslocked; u_long *cookies = NULL, *cookiep; int ncookies; @@ -256,8 +256,9 @@ } vp = fp->f_vnode; - + vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { + VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return (EINVAL); } @@ -394,6 +395,7 @@ td->td_retval[0] = nbytes - resid; out: VOP_UNLOCK(vp, 0, td); + VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); if (cookies) free(cookies, M_TEMP); @@ -418,7 +420,7 @@ struct iovec aiov; struct svr4_dirent idb; off_t off; /* true file offset */ - int buflen, error, eofflag; + int buflen, error, eofflag, vfslocked; u_long *cookiebuf = NULL, *cookie; int ncookies = 0, *retval = td->td_retval; @@ -434,7 +436,9 @@ } vp = fp->f_vnode; + vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { + VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return (EINVAL); } @@ -524,6 +528,7 @@ *retval = uap->nbytes - resid; out: VOP_UNLOCK(vp, 0, td); + VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); if (cookiebuf) free(cookiebuf, M_TEMP); ==== //depot/projects/smpng/sys/compat/svr4/syscalls.master#16 (text+ko) ==== @@ -136,7 +136,7 @@ 78 AUE_NULL UNIMPL rfsys 79 AUE_NULL MNOPROTO { int rmdir(char *path); } 80 AUE_NULL MNOPROTO { int mkdir(char *path, int mode); } -81 AUE_NULL STD { int svr4_sys_getdents(int fd, char *buf, \ +81 AUE_NULL MSTD { int svr4_sys_getdents(int fd, char *buf, \ int nbytes); } 82 AUE_NULL UNIMPL libattach 83 AUE_NULL UNIMPL libdetach @@ -325,7 +325,7 @@ 210 AUE_NULL UNIMPL signotifywait 211 AUE_NULL UNIMPL lwp_sigredirect 212 AUE_NULL UNIMPL lwp_alarm -213 AUE_NULL STD { int svr4_sys_getdents64(int fd, \ +213 AUE_NULL MSTD { int svr4_sys_getdents64(int fd, \ struct svr4_dirent64 *dp, int nbytes); } ;213 AUE_NULL UNIMPL getdents64 214 AUE_NULL MSTD { caddr_t svr4_sys_mmap64(void *addr, \