public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] nbd: fix set_capacity call
@ 2004-02-19 18:17 Paul Clements
  0 siblings, 0 replies; only message in thread
From: Paul Clements @ 2004-02-19 18:17 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 130 bytes --]

This patch fixes the initial set_capacity call so that it matches nbd's
internal device size (nbd_device->bytesize).

Thanks,
Paul

[-- Attachment #2: nbd_set_capacity_fix.diff --]
[-- Type: text/x-patch, Size: 800 bytes --]

--- 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);
 	}
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-02-19 18:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-19 18:17 [PATCH 1/2] nbd: fix set_capacity call Paul Clements

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox