Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp709307pxm; Fri, 25 Feb 2022 17:56:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWwIssyWcullEh1xaSnuR4ldC6nGvjUThK2FhheA8SPvOhI38q6MEVcFX8bFVhfhhUnv44 X-Received: by 2002:a63:1826:0:b0:373:41d9:b14e with SMTP id y38-20020a631826000000b0037341d9b14emr8338866pgl.197.1645840591286; Fri, 25 Feb 2022 17:56:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645840591; cv=none; d=google.com; s=arc-20160816; b=T7ewdqwacqXhZtb5fWf1ZngMeRiK+vU+mCvxV1J/Sh9RE9HFTU19HBQHEZUTrHQbeu R4ZaSdDrSKs1qYKy94UDDkqJABoFN+fmPLiB5j/5Tba4u2+lZLUMbkNU35k61N5WZkjC 8jSaovButjq01OJojaRGiNY48CGHaSJ6xFw2Wi3SrvVq9MJnpytpKGD0HjVWRCWSgYt1 l4UtkSFS5bzAnkjP6FYPCG804TbDUGz4j0kwxgUHaHyAD3pf1Ur6DjKtyZjkek76KkIV UpVaoCTgBYe9vdJApmY9kBt45Ll3mJNMksQ4RM3UlzBF59zAQP2jyH8uYZX55msXKDfF Tpkw== 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=A3F0fX9JrAlsUugif9Q+TNxEblj89fNI5T4G5cqu5VI=; b=DSDbFxgmqJTvGDlm1Hrz4IEiA+d6z2F0BPngQYbdTC2VV7CX8L8TuFWa02uNnX9mYi b87v2Bo9gNmtiId74GSOuZNA4pkF+AFWh1KFlt04VdAKyz39zavWtfN5oxlj2QDJgXUA aZOmexDZ6cv0dwtNx2IgSaY90aN3Vx9tyTUFMT90XAUikjY1mJplcpxsY67Iymlcarsu TLSx86nLu1LdEr8MEHDsxjqUNnMMLNFZZqAbFDluKCGZ3jbgE60n0plCJO2IvbXx9LR2 gODv2sWylO+Uc9XgUamljLZCWpiL8bH8D2w7ob+fIStw6R0QhBnAo8BnFvY+G9yV5BhD Cjzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dm9g35mB; 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 d3-20020a170902c18300b0014fe13334b5si3350899pld.93.2022.02.25.17.56.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 17:56:31 -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=dm9g35mB; 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 DD2AC28369D; Fri, 25 Feb 2022 17:40:11 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233340AbiBYSfT (ORCPT + 99 others); Fri, 25 Feb 2022 13:35:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233345AbiBYSfQ (ORCPT ); Fri, 25 Feb 2022 13:35:16 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B88A1A9055 for ; Fri, 25 Feb 2022 10:34:41 -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 ams.source.kernel.org (Postfix) with ESMTPS id 286EDB8330D for ; Fri, 25 Feb 2022 18:34:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A644EC340E7 for ; Fri, 25 Feb 2022 18:34:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645814077; bh=MmRjb0IrsOuCdjpF4K+k4IyOZ+lwxr6BM19ISvFn1VY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dm9g35mBQ1qK7mT/8ZKwzfbpJ+td0qe+k36QjAKmhVMQfOJ4fD/wxP9KCQHGQ7e4j GkPIqjV/Cw824HGk4ub0Y5dGQIK9wwUae7p38C5GqhgE8PEYo/DVfNLbNaw4R8Tjxa RGpZ8nD5KCw5Il9KBnF2to+vn8YOlZFvZpGeCnWQZOHShAc8Q7JrCVFWRbZ86CSoQ3 FnIsw836/g2KoTPOvA0gzSVaTrbrx3Go2HRqyPLWkWafYcZ0xVDUy9ZafuC0+5IeW/ q1UTPe04gfQu5WmuniKb6Jytmh1+PDRpm30mNW3neI5ZOliOZAfFKk2+8NrqsTefHM iviLr0C3ZlA6A== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH v8 05/24] NFS: Use kzalloc() to avoid initialising the nfs_open_dir_context Date: Fri, 25 Feb 2022 13:28:10 -0500 Message-Id: <20220225182829.1236093-6-trondmy@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220225182829.1236093-5-trondmy@kernel.org> References: <20220225182829.1236093-1-trondmy@kernel.org> <20220225182829.1236093-2-trondmy@kernel.org> <20220225182829.1236093-3-trondmy@kernel.org> <20220225182829.1236093-4-trondmy@kernel.org> <20220225182829.1236093-5-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 1dfbd05081ad..379f88b158fb 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