From: Matthew Wilcox (Oracle) Date: Tue, 22 Feb 2022 14:43:12 +0000 (-0500) Subject: namei: Convert page_symlink() to use memalloc_nofs_save() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2d878178baf32dda7eaf6c1de05a42ab19fe4094;p=linux.git 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) Reviewed-by: Christoph Hellwig --- diff --git a/fs/namei.c b/fs/namei.c index 6153581073b13..0c84b4326dc97 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -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;