From patchwork Mon Sep 7 13:45:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Moise <00moses.alexander00@gmail.com> X-Patchwork-Id: 7135381 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5376DBEEC1 for ; Mon, 7 Sep 2015 13:49:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 764B12081B for ; Mon, 7 Sep 2015 13:49:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 90BEF20805 for ; Mon, 7 Sep 2015 13:49:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752045AbbIGNrw (ORCPT ); Mon, 7 Sep 2015 09:47:52 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:38224 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751133AbbIGNrv (ORCPT ); Mon, 7 Sep 2015 09:47:51 -0400 Received: by wiclk2 with SMTP id lk2so84868558wic.1; Mon, 07 Sep 2015 06:47:50 -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:mime-version:content-type :content-disposition:user-agent; bh=MrKXFny80pYpvPi7KiAq0LlevJ/T3XhNeKtUze/o6L8=; b=upGhMH0r3V4/PCLUCC67Qhez4N+mgyh7PZ3HzbI0DDqf1/woWxaga0Ki2dDPzs+qZN Gh94tYZkxjoluss5MgUdv4rHZi2PmjnSK3Mfp9AUkvmyjXWmtiYnnJgwxpcVyxf+vpMo aUbz0Ae3gD3g9Sc/Pillksum55fBb08WSqQG2hPvaU7oyKvX/gmsRPsRO+aDfOXSoCNb ktQgNFLbFuYZqfKS6TdijX4tbyCbtMXdKSvnPuWvqPFYo/MXYNSvERTCWIcfoRidI8Sl t4gAoWdjSJOsbKLGMXpfyxXNezWYrjlOJRvMnATOLKRuw2MK6FE4MTXBh4C2WUGjyEKa DB8A== X-Received: by 10.180.88.4 with SMTP id bc4mr13179153wib.68.1441633669996; Mon, 07 Sep 2015 06:47:49 -0700 (PDT) Received: from gmail.com ([89.121.200.106]) by smtp.gmail.com with ESMTPSA id cx1sm15450983wib.0.2015.09.07.06.47.49 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 07 Sep 2015 06:47:49 -0700 (PDT) Date: Mon, 7 Sep 2015 16:45:02 +0300 From: Alexandru Moise <00moses.alexander00@gmail.com> To: clm@fb.com Cc: jbacik@fb.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] btrfs: memset cur_trans->delayed_refs to zero Message-ID: <20150907134502.GA19553@gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use memset() to null out the btrfs_delayed_ref_root of btrfs_transaction instead of setting all the members to 0 by hand. Signed-off-by: Alexandru Moise <00moses.alexander00@gmail.com> --- fs/btrfs/transaction.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 8f259b3..0581fb4 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -224,15 +224,15 @@ loop: cur_trans->start_time = get_seconds(); cur_trans->dirty_bg_run = 0; + memset(&cur_trans->delayed_refs, 0, sizeof(cur_trans->delayed_refs)); + + /* + * For now RB_ROOT means set to NULL but this could change in + * the future + */ cur_trans->delayed_refs.href_root = RB_ROOT; cur_trans->delayed_refs.dirty_extent_root = RB_ROOT; atomic_set(&cur_trans->delayed_refs.num_entries, 0); - cur_trans->delayed_refs.num_heads_ready = 0; - cur_trans->delayed_refs.pending_csums = 0; - cur_trans->delayed_refs.num_heads = 0; - cur_trans->delayed_refs.flushing = 0; - cur_trans->delayed_refs.run_delayed_start = 0; - cur_trans->delayed_refs.qgroup_to_skip = 0; /* * although the tree mod log is per file system and not per transaction,