Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3503520pxb; Mon, 24 Jan 2022 10:56:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWGWlKTC1/bPXe61SRrC/lVDMc5i93FbWlkLI9meW01SBGNyoARamUD4rvjcU9fTXxms4L X-Received: by 2002:a63:81c3:: with SMTP id t186mr8302811pgd.462.1643050567539; Mon, 24 Jan 2022 10:56:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643050567; cv=none; d=google.com; s=arc-20160816; b=B7sa/UiOhoen72hZlbh7SvIRwH/1L47dtq/pkbjt8MjPjGh4UpTfIp7YHDh9tJL9dQ 8aKQrtX3V7dBSXNO2z0xqjwLn/l14XVpwnK7+cBOH8F17iiyct0Cj5Q9VztA2gyeErhw lvRpvU1oyTN3dYFK84I6p+mgXWOGYwskxzuM7jpQ04StCLQmhachBf0+s73fPA+Ob0V/ 1eRHQD3vqZ5JrbETi7go3W8TylGgXZXQiDOIm+38NpXpP4A3yxNYdJFUcNlKhnN7neOb JE6aIXuGADLTcRfVG4Z6+ZbEpEHhgsn9UQc2Ro9uIMOYwltRxiQMtaf90QW3FJJ/UQEl YNbg== 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:cc:to:from :dkim-signature; bh=EcXfe+QJLbyEaBSYcI8IdLx+VpwVU+Twsx7L0heUO1Q=; b=CJuOB3Kr253GzB7g3k882fDSVptzioNoAsOf9AYE3cG98hY4KMgB8KETV3CCF/SgSM /nRodM48QP/JLX04hG8BR6w2P9VDcj36Mcfc4w1q9LinV3auQiQ0opKjsphfwR7AYl1d 4r0vNnmVu2jkP/sEZcbuNLO9bdLp72fLaOT70rBi0vWFw/MBpoJc/34yyJ1T33yY92YD tXip/HQDdZ3NPlREsHhQ9Ks7yzTvac+8FMCHmsd4XCYUvATJrhuUr8TvopG8Ao7OctFX mokaqGX/hM1JRLqzlLFIwuGS7zEv5+s6LlkZOXn0mgtJmTQNu7FxeSfwqWszDoLIxBsr Z/Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=i9tcmKqW; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n68si14288952pga.286.2022.01.24.10.55.53; Mon, 24 Jan 2022 10:56:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-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=@infradead.org header.s=bombadil.20210309 header.b=i9tcmKqW; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242627AbiAXJLb (ORCPT + 99 others); Mon, 24 Jan 2022 04:11:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242632AbiAXJL2 (ORCPT ); Mon, 24 Jan 2022 04:11:28 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FA07C061747; Mon, 24 Jan 2022 01:11:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=EcXfe+QJLbyEaBSYcI8IdLx+VpwVU+Twsx7L0heUO1Q=; b=i9tcmKqWExYwFyUC3GAfdvN0G9 cAdpT77el2rpxNNIFlvamk56bpHBy6jnsKj8q3rJ8nawaJ8TV7+QPqH/vGIAki4ZzwrDeoVrlWY7x vTq6delBNM/Owx6rHpv19HnjVMkfSK+nS7d5zpnlMcNWTlhUuDN530jXcyf2m/kkhVEaI/q5ryfsX TE7hn5wlaJifpc3rpsnyGrrVENjdur2aPZNRi6GYDrfwvZ8ZzqzKcwpy2OdXl3O1Apcb1fKr2bKrL VVKEY6d77BVmOEMEhxPk3wlx64Im1KfTmaMpWNPoU4MCescTElKDFR4xumyfaYjlYFSg22uNUWoba n1ec9EKw==; Received: from [2001:4bb8:184:72a4:a337:a75f:a24e:7e39] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nBvNg-002k1j-Gg; Mon, 24 Jan 2022 09:11:21 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Pavel Begunkov , Mike Snitzer , Ryusuke Konishi , Konstantin Komarov , Andrew Morton , "Md . Haris Iqbal " , Jack Wang , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Philipp Reisner , Lars Ellenberg , linux-block@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-nilfs@vger.kernel.org, ntfs3@lists.linux.dev, xen-devel@lists.xenproject.org, drbd-dev@lists.linbit.com Subject: [PATCH 04/19] ntfs3: remove ntfs_alloc_bio Date: Mon, 24 Jan 2022 10:10:52 +0100 Message-Id: <20220124091107.642561-5-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220124091107.642561-1-hch@lst.de> References: <20220124091107.642561-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org bio_alloc will never fail if it is allowed to sleep, so there is no need for this loop. Also remove the __GFP_HIGH specifier as it doesn't make sense here given that we'll always fall back to the mempool anyway. Signed-off-by: Christoph Hellwig --- fs/ntfs3/fsntfs.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c index 4de9acb169689..4a255e21ecf5f 100644 --- a/fs/ntfs3/fsntfs.c +++ b/fs/ntfs3/fsntfs.c @@ -1443,17 +1443,6 @@ int ntfs_write_bh(struct ntfs_sb_info *sbi, struct NTFS_RECORD_HEADER *rhdr, return err; } -static inline struct bio *ntfs_alloc_bio(u32 nr_vecs) -{ - struct bio *bio = bio_alloc(GFP_NOFS | __GFP_HIGH, nr_vecs); - - if (!bio && (current->flags & PF_MEMALLOC)) { - while (!bio && (nr_vecs /= 2)) - bio = bio_alloc(GFP_NOFS | __GFP_HIGH, nr_vecs); - } - return bio; -} - /* * ntfs_bio_pages - Read/write pages from/to disk. */ @@ -1496,11 +1485,7 @@ int ntfs_bio_pages(struct ntfs_sb_info *sbi, const struct runs_tree *run, lbo = ((u64)lcn << cluster_bits) + off; len = ((u64)clen << cluster_bits) - off; new_bio: - new = ntfs_alloc_bio(nr_pages - page_idx); - if (!new) { - err = -ENOMEM; - goto out; - } + new = bio_alloc(GFP_NOFS, nr_pages - page_idx); if (bio) { bio_chain(bio, new); submit_bio(bio); @@ -1599,11 +1584,7 @@ int ntfs_bio_fill_1(struct ntfs_sb_info *sbi, const struct runs_tree *run) lbo = (u64)lcn << cluster_bits; len = (u64)clen << cluster_bits; new_bio: - new = ntfs_alloc_bio(BIO_MAX_VECS); - if (!new) { - err = -ENOMEM; - break; - } + new = bio_alloc(GFP_NOFS, BIO_MAX_VECS); if (bio) { bio_chain(bio, new); submit_bio(bio); -- 2.30.2