projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] zone_statistics: Use hot node instead of cold zone_pgdat
[linux-2.6-microblaze.git]
/
mm
/
shmem.c
diff --git
a/mm/shmem.c
b/mm/shmem.c
index
1e43c8a
..
0a8e29c
100644
(file)
--- a/
mm/shmem.c
+++ b/
mm/shmem.c
@@
-23,10
+23,8
@@
* which makes it a completely usable filesystem.
*/
* which makes it a completely usable filesystem.
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/init.h>
-#include <linux/devfs_fs_kernel.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/mman.h>
@@
-47,6
+45,7
@@
#include <linux/namei.h>
#include <linux/ctype.h>
#include <linux/migrate.h>
#include <linux/namei.h>
#include <linux/ctype.h>
#include <linux/migrate.h>
+#include <linux/highmem.h>
#include <asm/uaccess.h>
#include <asm/div64.h>
#include <asm/uaccess.h>
#include <asm/div64.h>
@@
-174,7
+173,7
@@
static inline void shmem_unacct_blocks(unsigned long flags, long pages)
}
static struct super_operations shmem_ops;
}
static struct super_operations shmem_ops;
-static struct address_space_operations shmem_aops;
+static
const
struct address_space_operations shmem_aops;
static struct file_operations shmem_file_operations;
static struct inode_operations shmem_inode_operations;
static struct inode_operations shmem_dir_inode_operations;
static struct file_operations shmem_file_operations;
static struct inode_operations shmem_inode_operations;
static struct inode_operations shmem_dir_inode_operations;
@@
-1046,12
+1045,12
@@
repeat:
swappage = lookup_swap_cache(swap);
if (!swappage) {
shmem_swp_unmap(entry);
swappage = lookup_swap_cache(swap);
if (!swappage) {
shmem_swp_unmap(entry);
- spin_unlock(&info->lock);
/* here we actually do the io */
if (type && *type == VM_FAULT_MINOR) {
/* here we actually do the io */
if (type && *type == VM_FAULT_MINOR) {
-
inc_page_state(pgmajfault
);
+
__count_vm_event(PGMAJFAULT
);
*type = VM_FAULT_MAJOR;
}
*type = VM_FAULT_MAJOR;
}
+ spin_unlock(&info->lock);
swappage = shmem_swapin(info, swap, idx);
if (!swappage) {
spin_lock(&info->lock);
swappage = shmem_swapin(info, swap, idx);
if (!swappage) {
spin_lock(&info->lock);
@@
-1081,14
+1080,6
@@
repeat:
page_cache_release(swappage);
goto repeat;
}
page_cache_release(swappage);
goto repeat;
}
- if (!PageSwapCache(swappage)) {
- /* Page migration has occured */
- shmem_swp_unmap(entry);
- spin_unlock(&info->lock);
- unlock_page(swappage);
- page_cache_release(swappage);
- goto repeat;
- }
if (PageWriteback(swappage)) {
shmem_swp_unmap(entry);
spin_unlock(&info->lock);
if (PageWriteback(swappage)) {
shmem_swp_unmap(entry);
spin_unlock(&info->lock);
@@
-1654,9
+1645,9
@@
static ssize_t shmem_file_sendfile(struct file *in_file, loff_t *ppos,
return desc.error;
}
return desc.error;
}
-static int shmem_statfs(struct
super_block *sb
, struct kstatfs *buf)
+static int shmem_statfs(struct
dentry *dentry
, struct kstatfs *buf)
{
{
- struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
+ struct shmem_sb_info *sbinfo = SHMEM_SB(
dentry->d_
sb);
buf->f_type = TMPFS_MAGIC;
buf->f_bsize = PAGE_CACHE_SIZE;
buf->f_type = TMPFS_MAGIC;
buf->f_bsize = PAGE_CACHE_SIZE;
@@
-2166,11
+2157,10
@@
static int init_inodecache(void)
static void destroy_inodecache(void)
{
static void destroy_inodecache(void)
{
- if (kmem_cache_destroy(shmem_inode_cachep))
- printk(KERN_INFO "shmem_inode_cache: not all structures were freed\n");
+ kmem_cache_destroy(shmem_inode_cachep);
}
}
-static struct address_space_operations shmem_aops = {
+static
const
struct address_space_operations shmem_aops = {
.writepage = shmem_writepage,
.set_page_dirty = __set_page_dirty_nobuffers,
#ifdef CONFIG_TMPFS
.writepage = shmem_writepage,
.set_page_dirty = __set_page_dirty_nobuffers,
#ifdef CONFIG_TMPFS
@@
-2233,10
+2223,10
@@
static struct vm_operations_struct shmem_vm_ops = {
};
};
-static
struct super_block *
shmem_get_sb(struct file_system_type *fs_type,
- int flags, const char *dev_name, void *data)
+static
int
shmem_get_sb(struct file_system_type *fs_type,
+ int flags, const char *dev_name, void *data
, struct vfsmount *mnt
)
{
{
- return get_sb_nodev(fs_type, flags, data, shmem_fill_super);
+ return get_sb_nodev(fs_type, flags, data, shmem_fill_super
, mnt
);
}
static struct file_system_type tmpfs_fs_type = {
}
static struct file_system_type tmpfs_fs_type = {
@@
-2260,10
+2250,8
@@
static int __init init_tmpfs(void)
printk(KERN_ERR "Could not register tmpfs\n");
goto out2;
}
printk(KERN_ERR "Could not register tmpfs\n");
goto out2;
}
-#ifdef CONFIG_TMPFS
- devfs_mk_dir("shm");
-#endif
- shm_mnt = do_kern_mount(tmpfs_fs_type.name, MS_NOUSER,
+
+ shm_mnt = vfs_kern_mount(&tmpfs_fs_type, MS_NOUSER,
tmpfs_fs_type.name, NULL);
if (IS_ERR(shm_mnt)) {
error = PTR_ERR(shm_mnt);
tmpfs_fs_type.name, NULL);
if (IS_ERR(shm_mnt)) {
error = PTR_ERR(shm_mnt);