[PATCH 1/2] nbd: fix set_capacity call
From: Paul Clements
Date: Thu Feb 19 2004 - 13:20:17 EST
This patch fixes the initial set_capacity call so that it matches nbd's
internal device size (nbd_device->bytesize).
Thanks,
Paul--- 2_6_3_rc2/drivers/block/nbd.c.PROC_PARTITIONS_FIXES Thu Feb 19 11:49:15 2004
+++ 2_6_3_rc2/drivers/block/nbd.c Thu Feb 19 12:00:55 2004
@@ -737,7 +737,7 @@ static int __init nbd_init(void)
INIT_LIST_HEAD(&nbd_dev[i].queue_head);
init_MUTEX(&nbd_dev[i].tx_lock);
nbd_dev[i].blksize = 1024;
- nbd_dev[i].bytesize = ((u64)0x7ffffc00) << 10; /* 2TB */
+ nbd_dev[i].bytesize = 0x7ffffc00ULL << 10; /* 2TB */
disk->major = NBD_MAJOR;
disk->first_minor = i;
disk->fops = &nbd_fops;
@@ -745,7 +745,7 @@ static int __init nbd_init(void)
disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
sprintf(disk->disk_name, "nbd%d", i);
sprintf(disk->devfs_name, "nbd/%d", i);
- set_capacity(disk, 0x3ffffe);
+ set_capacity(disk, 0x7ffffc00ULL << 1); /* 2 TB */
add_disk(disk);
}