Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.25-git14 /fs/buffer.c

Filename:/fs/buffer.c
Lines Added:14
Lines Deleted:28
Also changed in: (Previous) 2.6.25-git13  2.6.25-git12  2.6.25  2.6.25-rc9  2.6.25-rc8-git10  2.6.25-rc8-git9 
(Following) 2.6.25-git15  2.6.25-git16  2.6.25-git17  2.6.25-git18  2.6.25-git19  2.6.25-git20 

Location
[  2.6.25-git14
  [  fs
     o  buffer.c

Patch

diff --git a/fs/buffer.c b/fs/buffer.c
index 39ff144..189efa4 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -360,16 +360,19 @@ void invalidate_bdev(struct block_device *bdev)
  */
 static void free_more_memory(void)
 {
-   struct zone **zones;
-   pg_data_t *pgdat;
+   struct zone *zone;
+   int nid;
 
    wakeup_pdflush(1024);
    yield();
 
-   for_each_online_pgdat(pgdat) {
-      zones = pgdat->node_zonelists[gfp_zone(GFP_NOFS)].zones;
-      if (*zones)
-         try_to_free_pages(zones, 0, GFP_NOFS);
+   for_each_online_node(nid) {
+      (void)first_zones_zonelist(node_zonelist(nid, GFP_NOFS),
+                  gfp_zone(GFP_NOFS), NULL,
+                  &zone);
+      if (zone)
+         try_to_free_pages(node_zonelist(nid, GFP_NOFS), 0,
+                  GFP_NOFS);
    }
 }
 
@@ -2208,8 +2211,8 @@ out:
    return err;
 }
 
-int cont_expand_zero(struct file *file, struct address_space *mapping,
-         loff_t pos, loff_t *bytes)
+static int cont_expand_zero(struct file *file, struct address_space *mapping,
+             loff_t pos, loff_t *bytes)
 {
    struct inode *inode = mapping->host;
    unsigned blocksize = 1 << inode->i_blkbits;
@@ -2243,6 +2246,8 @@ int cont_expand_zero(struct file *file, struct address_space *mapping,
          goto out;
       BUG_ON(err != len);
       err = 0;
+
+      balance_dirty_pages_ratelimited(mapping);
    }
 
    /* page covers the boundary, find the boundary offset */
@@ -2323,23 +2328,6 @@ int block_commit_write(struct page *page, unsigned from, unsigned to)
    return 0;
 }
 
-int generic_commit_write(struct file *file, struct page *page,
-      unsigned from, unsigned to)
-{
-   struct inode *inode = page->mapping->host;
-   loff_t pos = ((loff_t)page->index << PAGE_CACHE_SHIFT) + to;
-   __block_commit_write(inode,page,from,to);
-   /*
-    * No need to use i_size_read() here, the i_size
-    * cannot change under us because we hold i_mutex.
-    */
-   if (pos > inode->i_size) {
-      i_size_write(inode, pos);
-      mark_inode_dirty(inode);
-   }
-   return 0;
-}
-
 /*
  * block_page_mkwrite() is not allowed to change the file size as it gets
  * called from a page fault handler when a page is first dirtied. Hence we must
@@ -3180,8 +3168,7 @@ static void recalc_bh_state(void)
    
 struct buffer_head *alloc_buffer_head(gfp_t gfp_flags)
 {
-   struct buffer_head *ret = kmem_cache_alloc(bh_cachep,
-            set_migrateflags(gfp_flags, __GFP_RECLAIMABLE));
+   struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags);
    if (ret) {
       INIT_LIST_HEAD(&ret->b_assoc_buffers);
       get_cpu_var(bh_accounting).nr++;
@@ -3311,7 +3298,6 @@ EXPORT_SYMBOL(end_buffer_write_sync);
 EXPORT_SYMBOL(file_fsync);
 EXPORT_SYMBOL(fsync_bdev);
 EXPORT_SYMBOL(generic_block_bmap);
-EXPORT_SYMBOL(generic_commit_write);
 EXPORT_SYMBOL(generic_cont_expand_simple);
 EXPORT_SYMBOL(init_buffer);
 EXPORT_SYMBOL(invalidate_bdev);


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.