linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / mm / shmem.c
index c066617..7107db1 100644 (file)
@@ -46,8 +46,6 @@
 #include <linux/mempolicy.h>
 #include <linux/namei.h>
 #include <linux/ctype.h>
-#include <linux/migrate.h>
-
 #include <asm/uaccess.h>
 #include <asm/div64.h>
 #include <asm/pgtable.h>
@@ -511,7 +509,12 @@ static void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end)
                        size = SHMEM_NR_DIRECT;
                nr_swaps_freed = shmem_free_swp(ptr+idx, ptr+size);
        }
-       if (!topdir)
+
+       /*
+        * If there are no indirect blocks or we are punching a hole
+        * below indirect blocks, nothing to be done.
+        */
+       if (!topdir || (punch_hole && (limit <= SHMEM_NR_DIRECT)))
                goto done2;
 
        BUG_ON(limit <= SHMEM_NR_DIRECT);
@@ -876,7 +879,7 @@ redirty:
 }
 
 #ifdef CONFIG_NUMA
-static inline int shmem_parse_mpol(char *value, int *policy, nodemask_t *policy_nodes)
+static int shmem_parse_mpol(char *value, int *policy, nodemask_t *policy_nodes)
 {
        char *nodelist = strchr(value, ':');
        int err = 1;
@@ -1779,7 +1782,6 @@ static int shmem_rmdir(struct inode *dir, struct dentry *dentry)
        if (!simple_empty(dentry))
                return -ENOTEMPTY;
 
-       dentry->d_inode->i_nlink--;
        dir->i_nlink--;
        return shmem_unlink(dir, dentry);
 }
@@ -2122,7 +2124,7 @@ failed:
        return err;
 }
 
-static struct kmem_cache *shmem_inode_cachep;
+static kmem_cache_t *shmem_inode_cachep;
 
 static struct inode *shmem_alloc_inode(struct super_block *sb)
 {
@@ -2142,8 +2144,7 @@ static void shmem_destroy_inode(struct inode *inode)
        kmem_cache_free(shmem_inode_cachep, SHMEM_I(inode));
 }
 
-static void init_once(void *foo, struct kmem_cache *cachep,
-                     unsigned long flags)
+static void init_once(void *foo, kmem_cache_t *cachep, unsigned long flags)
 {
        struct shmem_inode_info *p = (struct shmem_inode_info *) foo;