Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110484
b: refs/heads/master
c: 80795ae
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Oct 9, 2008
1 parent a879859 commit ed97664
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b5d0b9df0ba5d9a044f3a21e7544f53d90bd1465
refs/heads/master: 80795aefb76d10c5d698e60c7e7750b5330787da
2 changes: 1 addition & 1 deletion trunk/drivers/block/aoe/aoeblk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/block/aoe/aoecmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/block/aoe/aoedev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/partitions/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 2 additions & 3 deletions trunk/include/linux/genhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ed97664

Please sign in to comment.