ChangeSet 1.2231.1.187, 2005/03/28 20:08:23-08:00, [EMAIL PROTECTED]

        [PATCH] hfs: free page buffers in releasepage
        
        Call try_to_free_buffers() when a page can be released.  This behaviour
        changed during 2.5 and wasn't fixed in hfs while porting it to 2.6.  
Also
        remove an unnecessary PageActive() check, only the node ref count is 
really
        relevant.
        
        Signed-off-by: Roman Zippel <[EMAIL PROTECTED]>
        Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
        Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>



 hfs/inode.c     |    8 +-------
 hfsplus/inode.c |    8 +-------
 2 files changed, 2 insertions(+), 14 deletions(-)


diff -Nru a/fs/hfs/inode.c b/fs/hfs/inode.c
--- a/fs/hfs/inode.c    2005-03-28 21:47:52 -08:00
+++ b/fs/hfs/inode.c    2005-03-28 21:47:52 -08:00
@@ -74,12 +74,6 @@
                        ;
                else if (atomic_read(&node->refcnt))
                        res = 0;
-               else for (i = 0; i < tree->pages_per_bnode; i++) {
-                       if (PageActive(node->page[i])) {
-                               res = 0;
-                               break;
-                       }
-               }
                if (res && node) {
                        hfs_bnode_unhash(node);
                        hfs_bnode_free(node);
@@ -103,7 +97,7 @@
                spin_unlock(&tree->hash_lock);
        }
        //printk("releasepage: %lu,%x = %d\n", page->index, mask, res);
-       return res;
+       return res ? try_to_free_buffers(page) : 0;
 }
 
 static int hfs_get_blocks(struct inode *inode, sector_t iblock, unsigned long 
max_blocks,
diff -Nru a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
--- a/fs/hfsplus/inode.c        2005-03-28 21:47:52 -08:00
+++ b/fs/hfsplus/inode.c        2005-03-28 21:47:52 -08:00
@@ -71,12 +71,6 @@
                        ;
                else if (atomic_read(&node->refcnt))
                        res = 0;
-               else for (i = 0; i < tree->pages_per_bnode; i++) {
-                       if (PageActive(node->page[i])) {
-                               res = 0;
-                               break;
-                       }
-               }
                if (res && node) {
                        hfs_bnode_unhash(node);
                        hfs_bnode_free(node);
@@ -100,7 +94,7 @@
                spin_unlock(&tree->hash_lock);
        }
        //printk("releasepage: %lu,%x = %d\n", page->index, mask, res);
-       return res;
+       return res ? try_to_free_buffers(page) : 0;
 }
 
 static int hfsplus_get_blocks(struct inode *inode, sector_t iblock, unsigned 
long max_blocks,
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to