X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fblock%2Frd.c;h=82f4eecc8699d19e42e899b043e2c45842cdbcc1;hb=444ad82bc3eaa554be40d22dc248e58aeefd54d9;hp=08176d23a46cd421690aca1d13a2edecf1499b71;hpb=347c53dca73fca317d57781f510f5ff4f6c0d0d7;p=linux-2.6 diff --git a/drivers/block/rd.c b/drivers/block/rd.c index 08176d23a4..82f4eecc86 100644 --- a/drivers/block/rd.c +++ b/drivers/block/rd.c @@ -189,6 +189,18 @@ static int ramdisk_set_page_dirty(struct page *page) return 0; } +/* + * releasepage is called by pagevec_strip/try_to_release_page if + * buffers_heads_over_limit is true. Without a releasepage function + * try_to_free_buffers is called instead. That can unset the dirty + * bit of our ram disk pages, which will be eventually freed, even + * if the page is still in use. + */ +static int ramdisk_releasepage(struct page *page, gfp_t dummy) +{ + return 0; +} + static const struct address_space_operations ramdisk_aops = { .readpage = ramdisk_readpage, .prepare_write = ramdisk_prepare_write, @@ -196,6 +208,7 @@ static const struct address_space_operations ramdisk_aops = { .writepage = ramdisk_writepage, .set_page_dirty = ramdisk_set_page_dirty, .writepages = ramdisk_writepages, + .releasepage = ramdisk_releasepage, }; static int rd_blkdev_pagecache_IO(int rw, struct bio_vec *vec, sector_t sector, @@ -365,7 +378,7 @@ static int rd_open(struct inode *inode, struct file *filp) /* * Deep badness. rd_blkdev_pagecache_IO() needs to allocate * pagecache pages within a request_fn. We cannot recur back - * into the filesytem which is mounted atop the ramdisk, because + * into the filesystem which is mounted atop the ramdisk, because * that would deadlock on fs locks. And we really don't want * to reenter rd_blkdev_pagecache_IO when we're already within * that function.