From patchwork Fri Aug 11 19:23:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 1820395 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=2404:9400:2221:ea00::3; helo=gandalf.ozlabs.org; envelope-from=srs0=fzwx=d4=vger.kernel.org=linux-ext4-owner@ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=GzoTSGKJ; dkim-atps=neutral Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMtxQ260kz1yf6 for ; Sat, 12 Aug 2023 05:23:22 +1000 (AEST) Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4RMtxQ0Fvkz4wb8 for ; Sat, 12 Aug 2023 05:23:22 +1000 (AEST) Received: by gandalf.ozlabs.org (Postfix) id 4RMtxQ0BPzz4wbv; Sat, 12 Aug 2023 05:23:22 +1000 (AEST) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: gandalf.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=GzoTSGKJ; dkim-atps=neutral Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=ozlabs.org) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4RMtxN3DSwz4wb8 for ; Sat, 12 Aug 2023 05:23:20 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235777AbjHKTXT (ORCPT ); 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-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);