]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
block: move capacity from disk to part0
authorTejun Heo <tj@kernel.org>
Mon, 25 Aug 2008 10:56:07 +0000 (19:56 +0900)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 9 Oct 2008 06:56:07 +0000 (08:56 +0200)
Move disk->capacity to part0->nr_sects and convert all users who
directly accessed the field to use {get|set}_capacity().  This is done
early to allow the __dev field to be moved.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
drivers/block/aoe/aoeblk.c
drivers/block/aoe/aoecmd.c
drivers/block/aoe/aoedev.c
fs/partitions/check.c
include/linux/genhd.h

index 3edb6cb7d68fee4eddbfa0de0f9691a3b78de77a..aa69556c34857bddb120fdb8f378afa6fff8adaa 100644 (file)
@@ -276,7 +276,7 @@ aoeblk_gdalloc(void *vp)
        gd->first_minor = d->sysminor * AOE_PARTITIONS;
        gd->fops = &aoe_bdops;
        gd->private_data = d;
-       gd->capacity = d->ssize;
+       set_capacity(gd, d->ssize);
        snprintf(gd->disk_name, sizeof gd->disk_name, "etherd/e%ld.%d",
                d->aoemajor, d->aoeminor);
 
index 17eed8c025d0461cb1ac3adecbceb3180cce7e74..934800f979c97dcde51718abb357b2a0589e75d4 100644 (file)
@@ -645,7 +645,7 @@ aoecmd_sleepwork(struct work_struct *work)
                unsigned long flags;
                u64 ssize;
 
-               ssize = d->gd->capacity;
+               ssize = get_capacity(d->gd);
                bd = bdget_disk(d->gd, 0);
 
                if (bd) {
@@ -707,7 +707,7 @@ ataid_complete(struct aoedev *d, struct aoetgt *t, unsigned char *id)
        if (d->flags & (DEVFL_GDALLOC|DEVFL_NEWSIZE))
                return;
        if (d->gd != NULL) {
-               d->gd->capacity = ssize;
+               set_capacity(d->gd, ssize);
                d->flags |= DEVFL_NEWSIZE;
        } else
                d->flags |= DEVFL_GDALLOC;
index a1d813ab0d6b6046b7d1a1e34ac3d60fd4b68179..6a8038d115b5948805e2f18a7b6d0a6b90f7e583 100644 (file)
@@ -91,7 +91,7 @@ aoedev_downdev(struct aoedev *d)
        }
 
        if (d->gd)
-               d->gd->capacity = 0;
+               set_capacity(d->gd, 0);
 
        d->flags &= ~DEVFL_UP;
 }
index b60699c271ac2e27e7f9caf8526ba270e9335cd2..902b95f1f9d57336c5dc3d062128b8728677f853 100644 (file)
@@ -586,7 +586,7 @@ void del_gendisk(struct gendisk *disk)
        disk_part_iter_exit(&piter);
 
        invalidate_partition(disk, 0);
-       disk->capacity = 0;
+       set_capacity(disk, 0);
        disk->flags &= ~GENHD_FL_UP;
        unlink_gendisk(disk);
        disk_stat_set_all(disk, 0);
index 9e866a2aee5029ac71de99ccdbd13d674594f28c..1cf828148ec63dabc51cb91b3f1b0313badf73e5 100644 (file)
@@ -138,7 +138,6 @@ struct gendisk {
        struct block_device_operations *fops;
        struct request_queue *queue;
        void *private_data;
-       sector_t capacity;
 
        int flags;
        struct device *driverfs_dev;  // FIXME: remove
@@ -411,11 +410,11 @@ static inline sector_t get_start_sect(struct block_device *bdev)
 }
 static inline sector_t get_capacity(struct gendisk *disk)
 {
-       return disk->capacity;
+       return disk->part0.nr_sects;
 }
 static inline void set_capacity(struct gendisk *disk, sector_t size)
 {
-       disk->capacity = size;
+       disk->part0.nr_sects = size;
 }
 
 #ifdef CONFIG_SOLARIS_X86_PARTITION