From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF021C433E9 for ; Thu, 3 Sep 2020 14:09:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9C81020578 for ; Thu, 3 Sep 2020 14:09:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="cSoGBSPb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C81020578 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6C85B6B0075; Thu, 3 Sep 2020 10:09:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5DA4F6B0078; Thu, 3 Sep 2020 10:09:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 47ADB8E0001; Thu, 3 Sep 2020 10:09:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0232.hostedemail.com [216.40.44.232]) by kanga.kvack.org (Postfix) with ESMTP id 2E3E16B0075 for ; Thu, 3 Sep 2020 10:09:02 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id EB10D2464 for ; Thu, 3 Sep 2020 14:09:01 +0000 (UTC) X-FDA: 77221931682.03.straw63_00022b2270aa Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 199CB28AE2D for ; Thu, 3 Sep 2020 14:08:59 +0000 (UTC) X-HE-Tag: straw63_00022b2270aa X-Filterd-Recvd-Size: 2941 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Thu, 3 Sep 2020 14:08:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=1TI7kACnKxAs6qyYap9xlbLVdTcx6qiJPDK16lGE/14=; b=cSoGBSPbnuffhKTuR6ByVVm8jh rsZIgH5Vbd342Njwdho5/jI3BDrjbkQK9gKFbJup0oMBn7yWk4Hu04lSvzIerxKjcaBbp1f+HYwmg IX78vx0ftWJsUQN3k60D7C13HFwEWOyzsuPVuTdZf5Fhi6z+y6P8YxMqv7vMFH0EAVD9HsnK3iakQ Cu7HDRiGK46D+VzLQwdirObYxsp2kmv49scHObW4EjTE1HMtWxpYex8hhJfI6MHnR4+4qvcW74DCE 9j1WUzFGIHxCcsR76IyRIPi6hQUoxXxK4lPcbebE3vZs2ArMXmcRJ5wLHuyxO5Cx6id4Ni8/JKI8O gkg6psYA==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDpv1-0003hz-Gs; Thu, 03 Sep 2020 14:08:51 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , David Howells , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Eric Biggers Subject: [PATCH 2/9] mm/readahead: Add DEFINE_READAHEAD Date: Thu, 3 Sep 2020 15:08:37 +0100 Message-Id: <20200903140844.14194-3-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200903140844.14194-1-willy@infradead.org> References: <20200903140844.14194-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 199CB28AE2D X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Allow for a more concise definition of a struct readahead_control. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/pagemap.h | 7 +++++++ mm/readahead.c | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 7de11dcd534d..19bba4360436 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -749,6 +749,13 @@ struct readahead_control { unsigned int _batch_count; }; =20 +#define DEFINE_READAHEAD(rac, f, m, i) \ + struct readahead_control rac =3D { \ + .file =3D f, \ + .mapping =3D m, \ + ._index =3D i, \ + } + /** * readahead_page - Get the next page to read. * @rac: The current readahead request. diff --git a/mm/readahead.c b/mm/readahead.c index 3c9a8dd7c56c..2126a2754e22 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -179,11 +179,7 @@ void page_cache_readahead_unbounded(struct address_s= pace *mapping, { LIST_HEAD(page_pool); gfp_t gfp_mask =3D readahead_gfp_mask(mapping); - struct readahead_control rac =3D { - .mapping =3D mapping, - .file =3D file, - ._index =3D index, - }; + DEFINE_READAHEAD(rac, file, mapping, index); unsigned long i; =20 /* --=20 2.28.0