]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - mm/shmem.c
mm: shmem: change remove_from_page_cache
[mirror_ubuntu-bionic-kernel.git] / mm / shmem.c
index 3437b65d6d6e76e71aedbe5ed02f851f400133cf..88593586bdb7f92022dc6ca7b95be89508dd88e9 100644 (file)
@@ -779,7 +779,7 @@ static int shmem_notify_change(struct dentry *dentry, struct iattr *attr)
                         * If truncating down to a partial page, then
                         * if that page is already allocated, hold it
                         * in memory until the truncation is over, so
-                        * truncate_partial_page cannnot miss it were
+                        * truncate_partial_page cannot miss it were
                         * it assigned to swap.
                         */
                        if (newsize & (PAGE_CACHE_SIZE-1)) {
@@ -1081,7 +1081,7 @@ static int shmem_writepage(struct page *page, struct writeback_control *wbc)
        shmem_recalc_inode(inode);
 
        if (swap.val && add_to_swap_cache(page, swap, GFP_ATOMIC) == 0) {
-               remove_from_page_cache(page);
+               delete_from_page_cache(page);
                shmem_swp_set(info, entry, swap.val);
                shmem_swp_unmap(entry);
                if (list_empty(&info->swaplist))
@@ -1091,7 +1091,6 @@ static int shmem_writepage(struct page *page, struct writeback_control *wbc)
                spin_unlock(&info->lock);
                swap_shmem_alloc(swap);
                BUG_ON(page_mapped(page));
-               page_cache_release(page);       /* pagecache ref */
                swap_writepage(page, wbc);
                if (inode) {
                        mutex_lock(&shmem_swaplist_mutex);
@@ -1843,8 +1842,9 @@ shmem_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
 
        inode = shmem_get_inode(dir->i_sb, dir, mode, dev, VM_NORESERVE);
        if (inode) {
-               error = security_inode_init_security(inode, dir, NULL, NULL,
-                                                    NULL);
+               error = security_inode_init_security(inode, dir,
+                                                    &dentry->d_name, NULL,
+                                                    NULL, NULL);
                if (error) {
                        if (error != -EOPNOTSUPP) {
                                iput(inode);
@@ -1983,8 +1983,8 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s
        if (!inode)
                return -ENOSPC;
 
-       error = security_inode_init_security(inode, dir, NULL, NULL,
-                                            NULL);
+       error = security_inode_init_security(inode, dir, &dentry->d_name, NULL,
+                                            NULL, NULL);
        if (error) {
                if (error != -EOPNOTSUPP) {
                        iput(inode);