]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - mm/shmem.c
don't put symlink bodies in pagecache into highmem
[mirror_ubuntu-bionic-kernel.git] / mm / shmem.c
index 9187eee4128b45769583dae2a73720e3545ee933..64bf5acb49fe111ee3b5665daad5434d87766d01 100644 (file)
@@ -2444,7 +2444,6 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s
        int len;
        struct inode *inode;
        struct page *page;
-       char *kaddr;
        struct shmem_inode_info *info;
 
        len = strlen(symname) + 1;
@@ -2483,9 +2482,8 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s
                }
                inode->i_mapping->a_ops = &shmem_aops;
                inode->i_op = &shmem_symlink_inode_operations;
-               kaddr = kmap_atomic(page);
-               memcpy(kaddr, symname, len);
-               kunmap_atomic(kaddr);
+               inode_nohighmem(inode);
+               memcpy(page_address(page), symname, len);
                SetPageUptodate(page);
                set_page_dirty(page);
                unlock_page(page);
@@ -2506,13 +2504,12 @@ static const char *shmem_follow_link(struct dentry *dentry, void **cookie)
                return ERR_PTR(error);
        unlock_page(page);
        *cookie = page;
-       return kmap(page);
+       return page_address(page);
 }
 
 static void shmem_put_link(struct inode *unused, void *cookie)
 {
        struct page *page = cookie;
-       kunmap(page);
        mark_page_accessed(page);
        page_cache_release(page);
 }