From owner-p4-projects@FreeBSD.ORG Mon Jul 4 16:27:38 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 607411065670; Mon, 4 Jul 2011 16:27:38 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AF67106564A for ; Mon, 4 Jul 2011 16:27:38 +0000 (UTC) (envelope-from ilya@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id EDB168FC0A for ; Mon, 4 Jul 2011 16:27:37 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p64GRb3c047670 for ; Mon, 4 Jul 2011 16:27:37 GMT (envelope-from ilya@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p64GRbTO047667 for perforce@freebsd.org; Mon, 4 Jul 2011 16:27:37 GMT (envelope-from ilya@FreeBSD.org) Date: Mon, 4 Jul 2011 16:27:37 GMT Message-Id: <201107041627.p64GRbTO047667@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to ilya@FreeBSD.org using -f From: Ilya Putsikau To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 195718 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2011 16:27:38 -0000 http://p4web.freebsd.org/@@195718?ac=10 Change 195718 by ilya@ilya_triton2011 on 2011/07/04 16:27:16 Mark FUSE MPSAFE. Remove file create serialization. Affected files ... .. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.c#13 edit .. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.h#13 edit .. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vfsops.c#17 edit .. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vnops.c#34 edit Differences ... ==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.c#13 (text+ko) ==== @@ -56,9 +56,6 @@ } vp->v_type = vtyp; vp->v_data = fvdat; - fvdat->create_owner = curthread->td_tid; - cv_init(&fvdat->create_cv, "fuse node create cv"); - sx_init(&fvdat->create_lock, "fuse node create lock"); sx_init(&fvdat->nodelock, "fuse node sx lock"); sx_init(&fvdat->truncatelock, "fuse node truncate sx lock"); @@ -74,8 +71,6 @@ struct fuse_vnode_data *fvdat = vp->v_data; vp->v_data = NULL; - cv_destroy(&fvdat->create_cv); - sx_destroy(&fvdat->create_lock); sx_destroy(&fvdat->nodelock); sx_destroy(&fvdat->truncatelock); free(fvdat, M_FUSEVN); ==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.h#13 (text+ko) ==== @@ -39,12 +39,6 @@ uint64_t nlookup; enum vtype vtype; - /** locking **/ - - struct sx create_lock; - struct cv create_cv; - lwpid_t create_owner; - /* * The nodelock must be held when data in the FUSE node is accessed or * modified. Typically, we would take this lock at the beginning of a ==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vfsops.c#17 (text+ko) ==== @@ -248,9 +248,7 @@ vfs_getnewfsid(mp); mp->mnt_flag |= MNT_LOCAL; -#ifdef XXXIP mp->mnt_kern_flag |= MNTK_MPSAFE; -#endif if (subtype) { strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN); strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN); ==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vnops.c#34 (text+ko) ==== @@ -1188,36 +1188,6 @@ fufh_type = fuse_filehandle_xlate_from_fflags(mode); } - if (!isdir && (fvdat->flag & FN_CREATING)) { - - sx_xlock(&fvdat->create_lock); - - if (fvdat->flag & FN_CREATING) { // check again - if (fvdat->create_owner == curthread->td_tid) { - fufh_type = FUFH_RDWR; - MPASS(fuse_filehandle_valid(vp, fufh_type)); - fvdat->flag &= ~FN_CREATING; - sx_xunlock(&fvdat->create_lock); - cv_broadcast(&fvdat->create_cv); // wake up all - return 0; - } else { - debug_printf("contender going to sleep\n"); - error = cv_wait_sig(&fvdat->create_cv, &fvdat->create_lock); - debug_printf("contender awake (error = %d)\n", error); - if (error) { - /* - * We'll be woken up in case a signal arrives. - * The value of error could be EINTR or ERESTART. - */ - return error; - } - } - } else { - sx_xunlock(&fvdat->create_lock); - /* Can proceed from here. */ - } - } - if (fuse_filehandle_valid(vp, fufh_type)) { fuse_vnode_open(vp, 0, td); return 0;