Return-Path: Received: from mx2.suse.de ([195.135.220.15]:40108 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752982AbeBSOCx (ORCPT ); Mon, 19 Feb 2018 09:02:53 -0500 From: Goldwyn Rodrigues To: linux-fsdevel@vger.kernel.org Cc: mhocko@kernel.org, Goldwyn Rodrigues Subject: [PATCH 07/10] fs: namei use memalloc_nofs_* scope API Date: Mon, 19 Feb 2018 08:02:27 -0600 Message-Id: <20180219140230.5077-8-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/namei.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/namei.c b/fs/namei.c index 921ae32dbc80..6cb314a256c5 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -39,6 +39,7 @@ #include #include #include +#include #include "internal.h" #include "mount.h" @@ -4797,7 +4798,7 @@ int __page_symlink(struct inode *inode, const char *symname, int len, int nofs) int err; unsigned int flags = 0; if (nofs) - flags |= AOP_FLAG_NOFS; + flags = memalloc_nofs_save(); retry: err = pagecache_write_begin(NULL, mapping, 0, len-1, @@ -4815,8 +4816,12 @@ int __page_symlink(struct inode *inode, const char *symname, int len, int nofs) goto retry; mark_inode_dirty(inode); + if (nofs) + memalloc_nofs_restore(flags); return 0; fail: + if (nofs) + memalloc_nofs_restore(flags); return err; } EXPORT_SYMBOL(__page_symlink); -- 2.16.1