]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] BLKGETSIZE64 (bytes not sectors)
authorMatt Domsch <matt_domsch@dell.com>
Thu, 7 Feb 2002 02:19:32 +0000 (18:19 -0800)
committerMatt Domsch <matt_domsch@dell.com>
Thu, 7 Feb 2002 02:19:32 +0000 (18:19 -0800)
Linus, below is a patch to return the size of a device in bytes, not
in units of 512-byte sectors (which is incorrect per function
definition).  Tim Pepper submitted an equivalent patch for 2.4.x, now
included in 2.4.18-pre4.  Please apply.

drivers/block/blkpg.c

index 9d1fdf03a2c46274aeed723988fdfb0ce94e87eb..2e1d2a6e7c745b850bc119a5b38278078af55df4 100644 (file)
@@ -280,7 +280,8 @@ int blk_ioctl(kdev_t dev, unsigned int cmd, unsigned long arg)
 
                        if (cmd == BLKGETSIZE)
                                return put_user((unsigned long)ullval, (unsigned long *)arg);
-                       return put_user(ullval, (u64 *)arg);
+                       else
+                               return put_user((u64)ullval << 9 , (u64 *)arg);
 #if 0
                case BLKRRPART: /* Re-read partition tables */
                        if (!capable(CAP_SYS_ADMIN))