Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / drivers / block / rd.c
index 80848c2..940bfd7 100644 (file)
@@ -86,7 +86,7 @@ int rd_size = CONFIG_BLK_DEV_RAM_SIZE;                /* Size of the RAM disks */
  * behaviour. The default is still BLOCK_SIZE (needed by rd_load_image that
  * supposes the filesystem in the image uses a BLOCK_SIZE blocksize).
  */
-int rd_blocksize = BLOCK_SIZE;                 /* blocksize of the RAM disks */
+static int rd_blocksize = BLOCK_SIZE;          /* blocksize of the RAM disks */
 
 /*
  * Copyright (C) 2000 Linus Torvalds.
@@ -154,7 +154,7 @@ static int ramdisk_commit_write(struct file *file, struct page *page,
 
 /*
  * ->writepage to the the blockdev's mapping has to redirty the page so that the
- * VM doesn't go and steal it.  We return WRITEPAGE_ACTIVATE so that the VM
+ * VM doesn't go and steal it.  We return AOP_WRITEPAGE_ACTIVATE so that the VM
  * won't try to (pointlessly) write the page again for a while.
  *
  * Really, these pages should not be on the LRU at all.
@@ -165,7 +165,7 @@ static int ramdisk_writepage(struct page *page, struct writeback_control *wbc)
                make_page_uptodate(page);
        SetPageDirty(page);
        if (wbc->for_reclaim)
-               return WRITEPAGE_ACTIVATE;
+               return AOP_WRITEPAGE_ACTIVATE;
        unlock_page(page);
        return 0;
 }
@@ -186,7 +186,8 @@ static int ramdisk_writepages(struct address_space *mapping,
  */
 static int ramdisk_set_page_dirty(struct page *page)
 {
-       SetPageDirty(page);
+       if (!TestSetPageDirty(page))
+               return 1;
        return 0;
 }
 
@@ -310,12 +311,12 @@ static int rd_ioctl(struct inode *inode, struct file *file,
         * cache
         */
        error = -EBUSY;
-       down(&bdev->bd_sem);
+       mutex_lock(&bdev->bd_mutex);
        if (bdev->bd_openers <= 2) {
                truncate_inode_pages(bdev->bd_inode->i_mapping, 0);
                error = 0;
        }
-       up(&bdev->bd_sem);
+       mutex_unlock(&bdev->bd_mutex);
        return error;
 }
 
@@ -325,7 +326,7 @@ static int rd_ioctl(struct inode *inode, struct file *file,
  */
 static struct backing_dev_info rd_backing_dev_info = {
        .ra_pages       = 0,    /* No readahead */
-       .memory_backed  = 1,    /* Does not contribute to dirty memory */
+       .capabilities   = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK | BDI_CAP_MAP_COPY,
        .unplug_io_fn   = default_unplug_io_fn,
 };
 
@@ -336,7 +337,7 @@ static struct backing_dev_info rd_backing_dev_info = {
  */
 static struct backing_dev_info rd_file_backing_dev_info = {
        .ra_pages       = 0,    /* No readahead */
-       .memory_backed  = 0,    /* Does contribute to dirty memory */
+       .capabilities   = BDI_CAP_MAP_COPY,     /* Does contribute to dirty memory */
        .unplug_io_fn   = default_unplug_io_fn,
 };
 
@@ -348,7 +349,7 @@ static int rd_open(struct inode *inode, struct file *filp)
                struct block_device *bdev = inode->i_bdev;
                struct address_space *mapping;
                unsigned bsize;
-               int gfp_mask;
+               gfp_t gfp_mask;
 
                inode = igrab(bdev->bd_inode);
                rd_bdev[unit] = bdev;