patch-2.2.3 linux/drivers/block/rd.c

Next file: linux/drivers/char/Config.in
Previous file: linux/drivers/block/nbd.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.2/linux/drivers/block/rd.c linux/drivers/block/rd.c
@@ -170,14 +170,12 @@
 			break;
          	case BLKGETSIZE:   /* Return device size */
 			if (!arg)  return -EINVAL;
-			err = verify_area(VERIFY_WRITE, (long *) arg,
-					  sizeof(long));
-			if (err)
-				return err;
-			put_user(rd_length[MINOR(inode->i_rdev)] / 512, 
+			return put_user(rd_length[MINOR(inode->i_rdev)] / 512, 
 				 (long *) arg);
-			return 0;
-			
+		case BLKSSZGET:
+			/* Block size of media */
+			return put_user(rd_blocksizes[MINOR(inode->i_rdev)],
+						    (int *)arg);
 		default:
 			break;
 	};

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)