Return-Path: Received: from mx2.suse.de ([195.135.220.15]:40084 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751351AbeBSOCq (ORCPT ); Mon, 19 Feb 2018 09:02:46 -0500 From: Goldwyn Rodrigues To: linux-fsdevel@vger.kernel.org Cc: mhocko@kernel.org, Goldwyn Rodrigues Subject: [PATCH 04/10] f2fs: Use memalloc_nofs_* scope API Date: Mon, 19 Feb 2018 08:02:24 -0600 Message-Id: <20180219140230.5077-5-rgoldwyn@suse.de> In-Reply-To: <20180219140230.5077-1-rgoldwyn@suse.de> References: <20180219140230.5077-1-rgoldwyn@suse.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: From: Goldwyn Rodrigues Signed-off-by: Goldwyn Rodrigues --- fs/f2fs/f2fs.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 6300ac5bcbe4..98b0827af06e 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #define __FS_HAS_ENCRYPTION IS_ENABLED(CONFIG_F2FS_FS_ENCRYPTION) @@ -1905,6 +1906,8 @@ static inline s64 valid_inode_count(struct f2fs_sb_info *sbi) static inline struct page *f2fs_grab_cache_page(struct address_space *mapping, pgoff_t index, bool for_write) { + struct page *pg = NULL; + unsigned nofs_flags; #ifdef CONFIG_F2FS_FAULT_INJECTION struct page *page = find_lock_page(mapping, index); @@ -1918,7 +1921,11 @@ static inline struct page *f2fs_grab_cache_page(struct address_space *mapping, #endif if (!for_write) return grab_cache_page(mapping, index); - return grab_cache_page_write_begin(mapping, index, AOP_FLAG_NOFS); + + nofs_flags = memalloc_nofs_save(); + pg = grab_cache_page_write_begin(mapping, index, 0); + memalloc_nofs_restore(nofs_flags); + return pg; } static inline struct page *f2fs_pagecache_get_page( -- 2.16.1