ioctl: rename the BLOCK_FLUSH ioctl to match the Linux name
authorAlan Cox <alan@linux.intel.com>
Mon, 12 Jan 2015 11:05:05 +0000 (11:05 +0000)
committerAlan Cox <alan@linux.intel.com>
Mon, 12 Jan 2015 11:05:05 +0000 (11:05 +0000)
Also tidy the ioctl table space

Kernel/dev/blkdev.c
Kernel/include/kernel.h

index 3531514..99ae15b 100644 (file)
@@ -125,7 +125,7 @@ int blkdev_ioctl(uint8_t minor, uint16_t request, char *data)
     blkdev_t *blk;
     data; /* unused */
 
-    if(request != BLOCK_FLUSH_CACHE){
+    if (request != BLKFLSBUF) {
        udata.u_error = ENXIO;
        return -1;
     }
@@ -133,7 +133,7 @@ int blkdev_ioctl(uint8_t minor, uint16_t request, char *data)
     /* we trust that blkdev_open() has already verified that this minor number is valid */
     blk = &blkdev_table[minor >> 4];
 
-    if(blk->flush)
+    if (blk->flush)
        return blk->flush(blk->drive_number);
     else
        return 0;
index eb3797f..70fdc2e 100644 (file)
@@ -142,8 +142,6 @@ struct hd_geometry {
        uint16_t cylinders;
        uint32_t start;
 };
-#define HDIO_GETGEO            0x0101
-#define HDIO_GET_IDENTITY      0x0102  /* Not yet implemented anywhere */
 
 /* Bit masks for i_mode and st_mode */
 
@@ -507,8 +505,26 @@ struct s_argblk {
  */
 #define SELECT_BEGIN           0x8000
 #define SELECT_END             0x8001
-#define BLOCK_FLUSH_CACHE       0x8002
 
+#define IOCTL_SUPER            0x4000  /* superuser needed */
+
+/*
+ *     Ioctl ranges
+ *     00xx            -       tty/vt
+ *     01xx            -       disk
+ */
+
+/*
+ *     Disk ioctls
+ */
+
+#define HDIO_GETGEO            0x0101
+#define HDIO_GET_IDENTITY      0x0102  /* Not yet implemented anywhere */
+#define BLKFLSBUF              0x4103  /* Use the Linux name */
+
+/*
+ *     System info shared with user space
+ */
 struct sysinfoblk {
   uint8_t infosize;            /* For expandability */
   uint8_t banks;               /* Banks in our 64K (and thus pagesize) */