summaryrefslogtreecommitdiff
path: root/fs/namei.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-02-22 17:43:12 +0300
committerMatthew Wilcox (Oracle) <willy@infradead.org>2022-05-08 21:28:18 +0300
commit2d878178baf32dda7eaf6c1de05a42ab19fe4094 (patch)
tree4614c519d2ed06983c807ae0898f8b9e94875255 /fs/namei.c
parent56f5746c414d92ae8e8314f46760822b4ecf8be3 (diff)
downloadlinux-2d878178baf32dda7eaf6c1de05a42ab19fe4094.tar.xz
namei: Convert page_symlink() to use memalloc_nofs_save()
Stop using AOP_FLAG_NOFS in favour of the scoped memory API. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 6153581073b1..0c84b4326dc9 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -22,6 +22,7 @@
#include <linux/fs.h>
#include <linux/namei.h>
#include <linux/pagemap.h>
+#include <linux/sched/mm.h>
#include <linux/fsnotify.h>
#include <linux/personality.h>
#include <linux/security.h>
@@ -5008,13 +5009,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;