]> err.no Git - linux-2.6/blobdiff - mm/shmem.c
slab allocators: remove multiple alignment specifications
[linux-2.6] / mm / shmem.c
index 578eceafba4a743c1aa474d9b44c9d52550b8243..b2a35ebf071a2162dcfd32896c18970b9a8af322 100644 (file)
@@ -674,8 +674,16 @@ done2:
                 * generic_delete_inode did it, before we lowered next_index.
                 * Also, though shmem_getpage checks i_size before adding to
                 * cache, no recheck after: so fix the narrow window there too.
+                *
+                * Recalling truncate_inode_pages_range and unmap_mapping_range
+                * every time for punch_hole (which never got a chance to clear
+                * SHMEM_PAGEIN at the start of vmtruncate_range) is expensive,
+                * yet hardly ever necessary: try to optimize them out later.
                 */
                truncate_inode_pages_range(inode->i_mapping, start, end);
+               if (punch_hole)
+                       unmap_mapping_range(inode->i_mapping, start,
+                                                       end - start, 1);
        }
 
        spin_lock(&info->lock);