Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1195302rdg; Fri, 11 Aug 2023 13:01:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEi0YUh8XqDDt5ATzR7U++A5nYvhEzABpHY83qAxTrKJokg+Qf+blaDhxyEwo+bevSD7NvN X-Received: by 2002:a05:6a00:1a8f:b0:687:404f:4d60 with SMTP id e15-20020a056a001a8f00b00687404f4d60mr3480221pfv.32.1691784094180; Fri, 11 Aug 2023 13:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691784094; cv=none; d=google.com; s=arc-20160816; b=ZFDq9uxTNK48Aqua3+tcRvX1YjYPDRSfCJ/0JeznZKFopQEdVavZLjojm4T+YF44Do x2fwUHJIMYJukZYrKyHS/x0SAmHs0Fk0pgUswQnQp0Po5oYNCwPSw5WzTTCym8zOYWvR muXyoN45BZH78B3ezNBqs9H79fs1SZWYwJMAPset5Z0dD5bg7yz0S2sxn/3Qlcbqp3ir 0KeLXT/Fc8CRnlLsWob0MJJDBZ1BYNrvZxwH7aA6MEoxznJL6IDhqDEp9HpWZc2GwccB q1aO12/laEXxS7nVACt4UovLhTkasDFImybUGqxRiQwAeEbScatFfJXFSUp06SkPggdn KOqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SCjfE0ihVcOKQWLIcU8GEL15xW0kjppT5rqoPuDlnqU=; fh=V6S9226kxWvGYznPvp6KinfD7louPsVsfmBr0FiuqKU=; b=SC+lDqgu3p5D5JxjC2oF9HcERObeFX2UFnQeYMVUo1TlTOrsQ/sNA4coDKkPJo4sC7 FgSW1+qylYV1OY3TNA0zUPAcIyTTrTX84rr0QmpDH395cpUtoCQQxkNM5ZCrVh0CYSOQ TFqhRSURAdHr20BwtdWPHfIrNkxzp63TMaY8wTcUlrHwQsAYSQqMPhVdqFXK0lbNRQXo NYa4PZY4yG7tvWRduTId8yv7vE6b8+Z2v09oMsu3IgDVkpxBgRNDHlXrb/nstME5FnPX MZTWfRUhTmH/TfJG2xQlR/6LlPa1ttsslni+Ft8SPMmCP9x2Z22Ja7eQKsCyOvylqYY0 30SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=GzoTSGKJ; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w184-20020a6382c1000000b0056401bf428asi3804315pgd.843.2023.08.11.13.01.11; Fri, 11 Aug 2023 13:01:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=GzoTSGKJ; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233273AbjHKTXT (ORCPT + 99 others); Fri, 11 Aug 2023 15:23:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229959AbjHKTXS (ORCPT ); Fri, 11 Aug 2023 15:23:18 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 280C0120; Fri, 11 Aug 2023 12:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=SCjfE0ihVcOKQWLIcU8GEL15xW0kjppT5rqoPuDlnqU=; b=GzoTSGKJWneXfmwmwJytS9bRLm yuwJ6wSD5oilzUyqu9EYqjwALMw3krzY9689khfPDLvDqU8cdWrTWkcwzU6+/ghc4sp/5ZTrrwke6 I8EaRWP3PJKgKNw0BDEur913Z0/1OAWthjSBwj0jcCPHN3elDWqiVmt2129ugispTm+GTPjdMsN/A gE16a1FOese/e1VWbqNfd1Qk+jmCXtehmwtNnyAsRaULoNOwBRux8lAvxptPOaRxMtAzvpscsIMDz o1lMBoysZ53LM9o1znL/Beq4BjsS+wyFdk65021lvKyjORnouttYzMgwZihSqfsZpsNZsfQ/Nm9SM 2+oJAZzw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qUXj7-002vvW-41; Fri, 11 Aug 2023 19:23:13 +0000 Date: Fri, 11 Aug 2023 20:23:13 +0100 From: Matthew Wilcox To: akpm@linux-foundation.org Cc: Hui Zhu , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org Subject: [PATCH 4/3] buffer: Use bdev_getblk() in __breadahead() Message-ID: References: <20230811161528.506437-1-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230811161528.506437-1-willy@infradead.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,URIBL_BLOCKED autolearn=ham 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-ext4@vger.kernel.org It occurs to me that this would also be useful and I'll include it in the next version: diff --git a/fs/buffer.c b/fs/buffer.c index 122b7d16befb..b551a5b1196b 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -1470,7 +1470,9 @@ EXPORT_SYMBOL(__getblk_gfp); */ void __breadahead(struct block_device *bdev, sector_t block, unsigned size) { - struct buffer_head *bh = __getblk(bdev, block, size); + struct buffer_head *bh = bdev_getblk(bdev, block, size, + GFP_NOWAIT | __GFP_MOVABLE | __GFP_ACCOUNT); + if (likely(bh)) { bh_readahead(bh, REQ_RAHEAD); brelse(bh);