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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A48AC433F5 for ; Tue, 22 Feb 2022 19:48:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235296AbiBVTs7 (ORCPT ); Tue, 22 Feb 2022 14:48:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232566AbiBVTsx (ORCPT ); Tue, 22 Feb 2022 14:48:53 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BB06B6D09 for ; Tue, 22 Feb 2022 11:48:25 -0800 (PST) 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=KX2Y1rXpj6EfP6YlYQuQzg8BK6rB+Vq37BTP0E9iaHE=; b=OBG+vI0ixhND0HS/B/016uo6kM 68i2OdMK+DBidQpYIu2giiQPf/0W0kWjHm8Rl9AwNLHRof1aaKjS0BgkXg1onjyE6734Pxzp7WdWu lw8wMmzbqcinG9jB0HxVjKpxaOwWUcvXgYoixlyJ6bWgQnL/bTN8vTifynmB4xUFvWbg/9YyEOnFc VTSaZttXAOF8J0Iklf9T6MI70ElierZA96HWKkSRInITlwBLY5TrwQ8BC3W/RwAyEUJPypVOCF9Uc FOIomtERonTSnsfMT0sFyXITMh6Ex0WbxU38oUu9aX78LBsYXXATsaWvKmS4E0glF3/rxlbr6X0xt 0qHxJ2jw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMb95-0035zu-N8; Tue, 22 Feb 2022 19:48:23 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH 07/22] namei: Convert page_symlink() to use memalloc_nofs_save() Date: Tue, 22 Feb 2022 19:48:05 +0000 Message-Id: <20220222194820.737755-8-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220222194820.737755-1-willy@infradead.org> References: <20220222194820.737755-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Stop using AOP_FLAG_NOFS in favour of the scoped memory API. Signed-off-by: Matthew Wilcox (Oracle) --- fs/namei.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 8335dad105b4..4f5c07d5579f 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -5010,13 +5011,15 @@ int page_symlink(struct inode *inode, const char *symname, int len) struct page *page; void *fsdata; int err; - unsigned int flags = 0; - if (nofs) - flags |= AOP_FLAG_NOFS; + unsigned int flags; retry: + if (nofs) + flags = memalloc_nofs_save(); err = pagecache_write_begin(NULL, mapping, 0, len-1, - flags, &page, &fsdata); + 0, &page, &fsdata); + if (nofs) + memalloc_nofs_restore(flags); if (err) goto fail; -- 2.34.1