Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1081230pxm; Wed, 23 Feb 2022 17:38:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwODz26dPNQmYIZp+NMIAyStVLFdXsE32TsvdNEwf+dsuVkjcpxWRTfd0qQSQTGmd2HmD5M X-Received: by 2002:a17:903:2c5:b0:14f:4a29:1f64 with SMTP id s5-20020a17090302c500b0014f4a291f64mr583876plk.90.1645666688250; Wed, 23 Feb 2022 17:38:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645666688; cv=none; d=google.com; s=arc-20160816; b=ZiVBTK8EqJhyb6m1M46970N8ACKu6PV+SwjPaU/Y4IAKA/jeD6K7XgroyprV3rZeIU 8wMyviG1vRT2JpjI6i7bTf5j+7JAplK2OIsYTGKMrVtgHgYBMRAog/Jll1XumwvPh4Do s/W4QNOfLIPSVR6QxmXX6IxYz0i+DAab0318Uj0c6cJ9M7rQK324FzPGuNT99MhZIav3 pS4EHHQ5VsB1nXwWvr8wZyh03xY5xphP8fvpo2N7oi0sSDoQ0v9v/dby0KbXug9NZnoQ kIXqxM4KqDQjKa5vzVcX5D0hing3cugkfByqEtcgW8EvSz6tRR4JWGtaVDj2x9ULBw/c NM3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=xJN5HP0eAgwnPbmGhmAA6FoSO7fgdLfMUDUDuuZ5/Fg=; b=LgVkGKDlrUIapPwbsWJfEGUmOtenP9m269PGWP3Fx+uIIER3+uVK88iPmA+rVIc4ri u3qQG9OoA8f1k8YY+q3IQTDLcWnP3pM/1uJyb8eP7+zdj9CetusRbheHCttsdBfZ62Dw OPo4EjLJdpKRDDQZXti6yBUCczD8IxMUzdsnG1a7Vp2sgVhs2EvD9v+0noRMLJE5QNFZ 59kVCT+bzWgrAhEaqJgPoRTHmVMVrLiuPj60cvJ8IjjPX3cjm5RfRyyAISYpdsHXTZxY NY2PdMN09xAIE1CSavLVS4zAZ6tHjCukWlEaFjjJxg4c//4YwJRGOjXdh56LZ2kJvLOw Qo3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pWmdSRq5; spf=softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 82si1250911pgd.156.2022.02.23.17.38.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 17:38:08 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pWmdSRq5; spf=softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 41CAA17580A; Wed, 23 Feb 2022 17:16:13 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241417AbiBWVUC (ORCPT + 99 others); Wed, 23 Feb 2022 16:20:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242398AbiBWVUC (ORCPT ); Wed, 23 Feb 2022 16:20:02 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E695B4EA25 for ; Wed, 23 Feb 2022 13:19:33 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8104F6189D for ; Wed, 23 Feb 2022 21:19:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1701C340F3 for ; Wed, 23 Feb 2022 21:19:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645651172; bh=bB/gp+z+dEpo/jps+MUjpp/jwTznG73nN6OpN9S8BH0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pWmdSRq5EIK+WvIhz+KUDfLzwwtaIK7GLFYV96+Bc/6HwNx4lUApQH8g+couqp1AN 41tILiqkATDg07z6H0YkLq/y1or057ieQhSa4y64/cLAUi1MOun2E+wI+BCk2ru2gg Vt8IDailtWklxcIz/8hOVKcA7DYyO5Q3O48s/CmYT2YvYT+5DO0i9NuTLkqpLuG5yZ N4fKRCglO9Ws6Dhd1jWQfhQrx+cYbaAi0e4eGFmX1b8lNhrCsDeY+/yBYQsPcztBH2 PAfjtH7VBu8kJyMTcA8Ivo9nd/CcUK0PC9xfHWWvCsF0zQzFzuK89q5YSBdvxm1Lm5 B9q+kr0o5vjUQ== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH v7 03/21] NFS: Use kzalloc() to avoid initialising the nfs_open_dir_context Date: Wed, 23 Feb 2022 16:12:47 -0500 Message-Id: <20220223211305.296816-4-trondmy@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220223211305.296816-3-trondmy@kernel.org> References: <20220223211305.296816-1-trondmy@kernel.org> <20220223211305.296816-2-trondmy@kernel.org> <20220223211305.296816-3-trondmy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust Signed-off-by: Trond Myklebust --- fs/nfs/dir.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 1aa55cac9d9a..8f17aaebcd77 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -69,18 +69,15 @@ const struct address_space_operations nfs_dir_aops = { .freepage = nfs_readdir_clear_array, }; -static struct nfs_open_dir_context *alloc_nfs_open_dir_context(struct inode *dir) +static struct nfs_open_dir_context * +alloc_nfs_open_dir_context(struct inode *dir) { struct nfs_inode *nfsi = NFS_I(dir); struct nfs_open_dir_context *ctx; - ctx = kmalloc(sizeof(*ctx), GFP_KERNEL_ACCOUNT); + + ctx = kzalloc(sizeof(*ctx), GFP_KERNEL_ACCOUNT); if (ctx != NULL) { - ctx->duped = 0; ctx->attr_gencount = nfsi->attr_gencount; - ctx->dir_cookie = 0; - ctx->dup_cookie = 0; - ctx->page_index = 0; - ctx->eof = false; spin_lock(&dir->i_lock); if (list_empty(&nfsi->open_files) && (nfsi->cache_validity & NFS_INO_DATA_INVAL_DEFER)) -- 2.35.1