Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp276548pxx; Wed, 28 Oct 2020 04:48:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysG3hj+19nABtfb8EoJx8fF+eotx8ohluuoUy56ame9PCrw/pityAVDciJNmRAKSokm1uY X-Received: by 2002:a17:906:1150:: with SMTP id i16mr7406403eja.90.1603885684591; Wed, 28 Oct 2020 04:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603885684; cv=none; d=google.com; s=arc-20160816; b=0CFM0Sda2fa2qI3m+63F3+678NJJTcvcWz+0v8M7MC1HnCsbcLSbbmbaXXzkO5pxMa 5QM2TAw9kkuINbYIQogSulfDz9Wl0eVRRSY2NVpWPOqPXmVarNIfyoI8zQgXZ1Knbaxa VsW+RqGjCDOHlGBn0jie7hoCrZi2I2LCcL8TgadfFc+Pe0GNtbxnZss7XaBYY7G90Q4T 4I+erLak9A44H9rBUIF1T4Xf/GemnXHci9zZbRHvZwsR8jENfu2an+L8hveeI3P1v/22 K9I/RxalQ0gRV3lmyCr9Ete+zRBZxGq+M5gG0cWEvrRlEQKABMdLAJ7NWI7U67cdZ8Px uNmQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8Cnw5XqnekpMq/OktgO8bQD6aecWSDSgyXojRo2MifY=; b=xMgNgscXPeDPzEdxVsthIZIOrTM5XrLKX68/v78ftPNdZQdRFpfslzWGZxLLqVeldn Ob8g0yPnoQ0m/ITlx12AY9cDk3ZVqqYG/3Z5pRYqp7cExnh7QO0WxRU2fM6/N5AIFZfb /HXDb21yq1CFGsXnwMGBxbUOJyH7Tp1TmoopIpzGajEqFcypFocHiZfgPMfyTtYH+95+ 2ZF6LSvd5AlLo4rH/R5Llqvf4vKazL3auF83kuwU6BOhpmcu6i+F5shxjTQXPNDxkYyc ZU78GMmzO6LwkSC7NrMGkhUkPeFdsH08KytUvfPsCtufQMU6WyjWwc4pcuSgcLC7FLKe eGNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cohELadq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t1si2868715ejb.712.2020.10.28.04.47.42; Wed, 28 Oct 2020 04:48:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cohELadq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1794486AbgJ0PME (ORCPT + 99 others); Tue, 27 Oct 2020 11:12:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:35168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1788930AbgJ0PBX (ORCPT ); Tue, 27 Oct 2020 11:01:23 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4478E20714; Tue, 27 Oct 2020 15:01:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810882; bh=+i3BGoxjVCqCb0gEy5xTlqSvHEIsYk8F5FOJZD8JAUA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cohELadqZlfmJuHV7Mv3erCw5RTxlG0Dlw57MnyaUZfp7PV/Gxu+OIj9JBEDffjLi yzC3DDEkamzLmBu8ZH3FYa+YGiDEYcbANjDr2hpWH/RtJE7gfRf5G5S0ES6fAcrmND ahaqJdTFyySZGp/buNlwJd2iKTObmMwJJmAl9gPM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Matthew Wilcox (Oracle)" , Christoph Hellwig , Dave Chinner , "Darrick J. Wong" , Sasha Levin Subject: [PATCH 5.8 279/633] iomap: Use kzalloc to allocate iomap_page Date: Tue, 27 Oct 2020 14:50:22 +0100 Message-Id: <20201027135535.759658308@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Wilcox (Oracle) [ Upstream commit a6901d4d148dcbad7efb3174afbdf68c995618c2 ] We can skip most of the initialisation, although spinlocks still need explicit initialisation as architectures may use a non-zero value to indicate unlocked. The comment is no longer useful as attach_page_private() handles the refcount now. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Sasha Levin --- fs/iomap/buffered-io.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 897ab9a26a74c..b115e7d47fcec 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -49,16 +49,8 @@ iomap_page_create(struct inode *inode, struct page *page) if (iop || i_blocksize(inode) == PAGE_SIZE) return iop; - iop = kmalloc(sizeof(*iop), GFP_NOFS | __GFP_NOFAIL); - atomic_set(&iop->read_count, 0); - atomic_set(&iop->write_count, 0); + iop = kzalloc(sizeof(*iop), GFP_NOFS | __GFP_NOFAIL); spin_lock_init(&iop->uptodate_lock); - bitmap_zero(iop->uptodate, PAGE_SIZE / SECTOR_SIZE); - - /* - * migrate_page_move_mapping() assumes that pages with private data have - * their count elevated by 1. - */ attach_page_private(page, iop); return iop; } -- 2.25.1