From owner-svn-src-head@FreeBSD.ORG Sun Jul 15 16:26:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A5E81065674; Sun, 15 Jul 2012 16:26:24 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4CBE58FC08; Sun, 15 Jul 2012 16:26:23 +0000 (UTC) Received: by eabm6 with SMTP id m6so1531091eab.13 for ; Sun, 15 Jul 2012 09:26:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=WGSoQJkC0P/bfXTjRMB5qtXYTri0iQ7HZJBzquGV4Qw=; b=zNUddLGN9NlHrUseNDzWq2BaTVvXLtHQJmkjVpKYLgCBWvpTQgU/xHAMgSLOaHE0XZ NiBYcCe6FempKJ96wvi24ebQE3uq40Sl4fw2mLQoqiFdL22fFarnG7z1FyPv+Xqe/VTR 4ijM3phx+4q63Ttpm6N0VXTS1JR47JuJnwFnvJoK9NLkNNX+q8wdZDFhfttyFqCkgLN4 36LhsNld07cOfn6hr1G3gLuB5VgpJXL/MUNyjsyr0rftjpA9LGETjkmQkFGU4IwcN0Xy xB82jPHGvuJ1UcF0FqjVWgRuOdyGf3hpstodSl5exUeCsLDQixX+WvfYkJ6NTuOzXYnB Bjog== Received: by 10.14.213.133 with SMTP id a5mr5546892eep.4.1342369582370; Sun, 15 Jul 2012 09:26:22 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPS id h48sm11703563eem.9.2012.07.15.09.26.21 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 15 Jul 2012 09:26:21 -0700 (PDT) Date: Sun, 15 Jul 2012 18:26:14 +0200 From: Mateusz Guzik To: Christian Brueffer Message-ID: <20120715162614.GB22600@dft-labs.eu> References: <201207151550.q6FFoCMo056166@svn.freebsd.org> <20120715160410.GA22600@dft-labs.eu> <5002EE96.2060104@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5002EE96.2060104@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238491 - head/sys/fs/smbfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 16:26:24 -0000 On Sun, Jul 15, 2012 at 06:23:50PM +0200, Christian Brueffer wrote: > On 7/15/12 18:04 , Mateusz Guzik wrote: > > On Sun, Jul 15, 2012 at 03:50:12PM +0000, Christian Brueffer wrote: > >> Author: brueffer > >> Date: Sun Jul 15 15:50:12 2012 > >> New Revision: 238491 > >> URL: http://svn.freebsd.org/changeset/base/238491 > >> > >> Log: > >> Save a bzero() by using M_ZERO. > >> > >> Obtained from: Dragonfly BSD (change 4faaf07c3d7ddd120deed007370aaf4d90b72ebb) > >> MFC after: 2 weeks > >> > >> Modified: > >> head/sys/fs/smbfs/smbfs_node.c > >> > >> Modified: head/sys/fs/smbfs/smbfs_node.c > >> ============================================================================== > >> --- head/sys/fs/smbfs/smbfs_node.c Sun Jul 15 15:23:31 2012 (r238490) > >> +++ head/sys/fs/smbfs/smbfs_node.c Sun Jul 15 15:50:12 2012 (r238491) > >> @@ -223,7 +223,7 @@ loop: > >> if (fap == NULL) > >> return ENOENT; > >> > >> - np = malloc(sizeof *np, M_SMBNODE, M_WAITOK); > >> + np = malloc(sizeof *np, M_SMBNODE, M_WAITOK | M_ZERO); > >> error = getnewvnode("smbfs", mp, &smbfs_vnodeops, &vp); > >> if (error) { > >> free(np, M_SMBNODE); > >> @@ -235,7 +235,6 @@ loop: > >> return (error); > >> } > >> vp->v_type = fap->fa_attr & SMB_FA_DIR ? VDIR : VREG; > >> - bzero(np, sizeof(*np)); > >> vp->v_data = np; > >> np->n_vnode = vp; > >> np->n_mount = VFSTOSMBFS(mp); > > > > How about moving this malloc right before np is actually used? > > While here some style(9) fixes. > > > > http://people.freebsd.org/~mjg/patches/smbfs_node-malloc.patch > > > > Completely untested (even compile-time); I guess the idea is clear. :) > > > > Looks good to me. Want to give your shiny new commit bit a spin? ;-) > Not this time, I currently have no way to test it. :) > If not, I'll handle it. > Please do. -- Mateusz Guzik