From: Josef Bacik <jbacik@redhat.com> Date: Tue, 10 Feb 2009 13:49:21 -0500 Subject: [mm] fix other users of __grab_cache_page Message-id: 1234291777-15344-9-git-send-email-jbacik@redhat.com O-Subject: [PATCH 08/24] [RHEL 5.4] mm: fix other users of __grab_cache_page Bugzilla: 445433 RH-Acked-by: Jeff Layton <jlayton@redhat.com> This patch is not a backport, its needed to fix other users of __grab_cache_page so that this set will compile properly. This patch is in reference to bz 445433. Signed-off-by: Josef Bacik <jbacik@redhat.com> diff --git a/mm/filemap.c b/mm/filemap.c index 48b07cd..1694dab 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2254,23 +2254,18 @@ generic_file_buffered_write_one_kernel_page(struct address_space *mapping, struct page *src) { const struct address_space_operations *a_ops = mapping->a_ops; - struct pagevec lru_pvec; - struct page *page, *cached_page = NULL; + struct page *page; long status = 0; - pagevec_init(&lru_pvec, 0); - #if 0 if (mapping->tree_lock.magic != RWLOCK_MAGIC) printk("RWLOCK magic incorrect: %x != %x\n", mapping->tree_lock.magic, RWLOCK_MAGIC); #endif - page = __grab_cache_page(mapping, index, &cached_page, &lru_pvec); - if (!page) { - BUG_ON(cached_page); + page = __grab_cache_page(mapping, index); + if (!page) return -ENOMEM; - } status = a_ops->prepare_write(NULL, page, 0, PAGE_CACHE_SIZE); if (unlikely(status)) { @@ -2312,9 +2307,6 @@ generic_file_buffered_write_one_kernel_page(struct address_space *mapping, cond_resched(); sync: - if (cached_page) - page_cache_release(cached_page); - /* the caller must handle O_SYNC themselves, but we handle S_SYNC and * MS_SYNCHRONOUS here */ if (unlikely(IS_SYNC(mapping->host)) && !a_ops->writepage) @@ -2322,8 +2314,6 @@ sync: OSYNC_METADATA | OSYNC_DATA); /* the caller must handle O_DIRECT for themselves */ - - pagevec_lru_add(&lru_pvec); return status; } EXPORT_SYMBOL(generic_file_buffered_write_one_kernel_page);