patch-2.1.4 linux/include/linux/blk.h

Next file: linux/include/linux/fs.h
Previous file: linux/include/asm-i386/unistd.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.3/linux/include/linux/blk.h linux/include/linux/blk.h
@@ -107,11 +107,11 @@
 #endif
 
 #define RO_IOCTLS(dev,where) \
-  case BLKROSET: { int __err;  if (!suser()) return -EACCES; \
-		   __err = verify_area(VERIFY_READ, (void *) (where), sizeof(long)); \
-		   if (!__err) set_device_ro((dev),get_fs_long((long *) (where))); return __err; } \
-  case BLKROGET: { int __err = verify_area(VERIFY_WRITE, (void *) (where), sizeof(long)); \
-		   if (!__err) put_fs_long(0!=is_read_only(dev),(long *) (where)); return __err; }
+  case BLKROSET: { int __val;  if (!suser()) return -EACCES; \
+		   if (get_user(__val, (int *)(where))) return -EFAULT; \
+		   set_device_ro((dev),__val); return 0; } \
+  case BLKROGET: { int __val = (is_read_only(dev) != 0) ; \
+		    return put_user(__val,(int *) (where)); }
 		 
 #if defined(MAJOR_NR) || defined(IDE_DRIVER)
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov