All of lore.kernel.org
 help / color / mirror / Atom feed
From: Goldwyn Rodrigues <rgoldwyn@suse.de>
To: linux-fsdevel@vger.kernel.org
Cc: mhocko@kernel.org, Goldwyn Rodrigues <rgoldwyn@suse.com>
Subject: [PATCH 07/10] fs: namei use memalloc_nofs_* scope API
Date: Mon, 19 Feb 2018 08:02:27 -0600	[thread overview]
Message-ID: <20180219140230.5077-8-rgoldwyn@suse.de> (raw)
In-Reply-To: <20180219140230.5077-1-rgoldwyn@suse.de>

From: Goldwyn Rodrigues <rgoldwyn@suse.com>

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
---
 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 <linux/bitops.h>
 #include <linux/init_task.h>
 #include <linux/uaccess.h>
+#include <linux/sched/mm.h>
 
 #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

  parent reply	other threads:[~2018-02-19 14:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19 14:02 [PATCH 00/10] Use the memalloc_nofs scope API Goldwyn Rodrigues
2018-02-19 14:02 ` [PATCH 01/10] fs: buffer - Use memalloc_nofs API to allocate pages Goldwyn Rodrigues
2018-02-19 14:24   ` Michal Hocko
2018-02-19 14:02 ` [PATCH 02/10] fs: mpage use memalloc_nofs_save/restore while allocating bios Goldwyn Rodrigues
2018-02-19 14:02 ` [PATCH 03/10] ext4: Use memalloc_nofs_* scope API Goldwyn Rodrigues
2018-02-19 14:02 ` [PATCH 04/10] f2fs: " Goldwyn Rodrigues
2018-02-19 14:02 ` [PATCH 05/10] gfs2: " Goldwyn Rodrigues
2018-02-19 14:02 ` [PATCH 06/10] fs: iomap use " Goldwyn Rodrigues
2018-02-19 22:30   ` Dave Chinner
2018-02-20  9:05     ` Michal Hocko
2018-02-20 12:16       ` Goldwyn Rodrigues
2018-02-19 14:02 ` Goldwyn Rodrigues [this message]
2018-02-19 14:02 ` [PATCH 08/10] fs: Eliminate AOP_FLAG_NOFS Goldwyn Rodrigues
2018-02-19 14:02 ` [PATCH 09/10] reiserfs: cont_expand() to eliminate AOP_FLAG_CONT_EXPAND Goldwyn Rodrigues
2018-02-19 14:55   ` Matthew Wilcox
2018-02-19 14:02 ` [PATCH 10/10] fs: Remove flags parameter from aops->write_begin() Goldwyn Rodrigues

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180219140230.5077-8-rgoldwyn@suse.de \
    --to=rgoldwyn@suse.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mhocko@kernel.org \
    --cc=rgoldwyn@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.