diff options
Diffstat (limited to 'mm/shmem.c')
-rw-r--r-- | mm/shmem.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/mm/shmem.c b/mm/shmem.c index bd20f8bb02aa..b206a7a32e2a 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -49,7 +49,6 @@ static struct vfsmount *shm_mnt; | |||
49 | #include <linux/backing-dev.h> | 49 | #include <linux/backing-dev.h> |
50 | #include <linux/shmem_fs.h> | 50 | #include <linux/shmem_fs.h> |
51 | #include <linux/writeback.h> | 51 | #include <linux/writeback.h> |
52 | #include <linux/vfs.h> | ||
53 | #include <linux/blkdev.h> | 52 | #include <linux/blkdev.h> |
54 | #include <linux/security.h> | 53 | #include <linux/security.h> |
55 | #include <linux/swapops.h> | 54 | #include <linux/swapops.h> |
@@ -1097,6 +1096,10 @@ static int shmem_writepage(struct page *page, struct writeback_control *wbc) | |||
1097 | shmem_swp_unmap(entry); | 1096 | shmem_swp_unmap(entry); |
1098 | unlock: | 1097 | unlock: |
1099 | spin_unlock(&info->lock); | 1098 | spin_unlock(&info->lock); |
1099 | /* | ||
1100 | * add_to_swap_cache() doesn't return -EEXIST, so we can safely | ||
1101 | * clear SWAP_HAS_CACHE flag. | ||
1102 | */ | ||
1100 | swapcache_free(swap, NULL); | 1103 | swapcache_free(swap, NULL); |
1101 | redirty: | 1104 | redirty: |
1102 | set_page_dirty(page); | 1105 | set_page_dirty(page); |
@@ -2306,17 +2309,14 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent) | |||
2306 | int err = -ENOMEM; | 2309 | int err = -ENOMEM; |
2307 | 2310 | ||
2308 | /* Round up to L1_CACHE_BYTES to resist false sharing */ | 2311 | /* Round up to L1_CACHE_BYTES to resist false sharing */ |
2309 | sbinfo = kmalloc(max((int)sizeof(struct shmem_sb_info), | 2312 | sbinfo = kzalloc(max((int)sizeof(struct shmem_sb_info), |
2310 | L1_CACHE_BYTES), GFP_KERNEL); | 2313 | L1_CACHE_BYTES), GFP_KERNEL); |
2311 | if (!sbinfo) | 2314 | if (!sbinfo) |
2312 | return -ENOMEM; | 2315 | return -ENOMEM; |
2313 | 2316 | ||
2314 | sbinfo->max_blocks = 0; | ||
2315 | sbinfo->max_inodes = 0; | ||
2316 | sbinfo->mode = S_IRWXUGO | S_ISVTX; | 2317 | sbinfo->mode = S_IRWXUGO | S_ISVTX; |
2317 | sbinfo->uid = current_fsuid(); | 2318 | sbinfo->uid = current_fsuid(); |
2318 | sbinfo->gid = current_fsgid(); | 2319 | sbinfo->gid = current_fsgid(); |
2319 | sbinfo->mpol = NULL; | ||
2320 | sb->s_fs_info = sbinfo; | 2320 | sb->s_fs_info = sbinfo; |
2321 | 2321 | ||
2322 | #ifdef CONFIG_TMPFS | 2322 | #ifdef CONFIG_TMPFS |
@@ -2590,6 +2590,11 @@ int shmem_unuse(swp_entry_t entry, struct page *page) | |||
2590 | return 0; | 2590 | return 0; |
2591 | } | 2591 | } |
2592 | 2592 | ||
2593 | int shmem_lock(struct file *file, int lock, struct user_struct *user) | ||
2594 | { | ||
2595 | return 0; | ||
2596 | } | ||
2597 | |||
2593 | #define shmem_vm_ops generic_file_vm_ops | 2598 | #define shmem_vm_ops generic_file_vm_ops |
2594 | #define shmem_file_operations ramfs_file_operations | 2599 | #define shmem_file_operations ramfs_file_operations |
2595 | #define shmem_get_inode(sb, mode, dev, flags) ramfs_get_inode(sb, mode, dev) | 2600 | #define shmem_get_inode(sb, mode, dev, flags) ramfs_get_inode(sb, mode, dev) |