]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - mm/shmem.c
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
[linux-2.6-omap-h63xx.git] / mm / shmem.c
index fc2ccf79a7761f4210f5d93456ba885ce9f5b226..d38d7e61fcd0bed76af19f52ac9fc03d3a9eb262 100644 (file)
@@ -1477,12 +1477,16 @@ int shmem_lock(struct file *file, int lock, struct user_struct *user)
                if (!user_shm_lock(inode->i_size, user))
                        goto out_nomem;
                info->flags |= VM_LOCKED;
+               mapping_set_unevictable(file->f_mapping);
        }
        if (!lock && (info->flags & VM_LOCKED) && user) {
                user_shm_unlock(inode->i_size, user);
                info->flags &= ~VM_LOCKED;
+               mapping_clear_unevictable(file->f_mapping);
+               scan_mapping_unevictable_pages(file->f_mapping);
        }
        retval = 0;
+
 out_nomem:
        spin_unlock(&info->lock);
        return retval;