diff --git a/console.c b/console.c
index 1952a3c21934b1292c4b14253f6ee079b28f74ce..b2c363e97ece3e0c1268c9855e82003caf7fe276 100644
--- a/console.c
+++ b/console.c
@@ -356,7 +356,7 @@ kbd_intr()
       c += 'a' - 'A';
   }
 
-  // xxx hack
+  // Ignore unknown keystrokes.
   if(c == 0x0) {
     release(&kbd_lock);
     return;
@@ -406,8 +406,8 @@ console_init()
   initlock(&console_lock, "console");
   initlock(&kbd_lock, "kbd");
 
-  devsw[CONSOLE].d_write = console_write;
-  devsw[CONSOLE].d_read = console_read;
+  devsw[CONSOLE].write = console_write;
+  devsw[CONSOLE].read = console_read;
 
   irq_setmask_8259A(irq_mask_8259A & ~(1 << IRQ_KBD));
   ioapic_enable(IRQ_KBD, 0);
diff --git a/dev.h b/dev.h
index 9c3c4a7339448b26ec559feb47658ddf49753c46..cff0036c083d18df5e6cc1692cd73431a44236a4 100644
--- a/dev.h
+++ b/dev.h
@@ -1,8 +1,6 @@
 struct devsw {
-  int (*d_open)(char*, int);
-  int (*d_read)(int, char*, int);
-  int (*d_write)(int, char*, int);
-  int (*d_close)(int);
+  int (*read)(int, char*, int);
+  int (*write)(int, char*, int);
 };
 
 extern struct devsw devsw[];
diff --git a/fs.c b/fs.c
index a2fc7671f2a0cc33e2645fe4cbc5784fc2f0fa4f..317a9e2fdbd70eab9cf6caa0e516abf77fa84497 100644
--- a/fs.c
+++ b/fs.c
@@ -326,11 +326,11 @@ iincref(struct inode *ip)
 void
 stati(struct inode *ip, struct stat *st)
 {
-  st->st_dev = ip->dev;
-  st->st_ino = ip->inum;
-  st->st_type = ip->type;
-  st->st_nlink = ip->nlink;
-  st->st_size = ip->size;
+  st->dev = ip->dev;
+  st->ino = ip->inum;
+  st->type = ip->type;
+  st->nlink = ip->nlink;
+  st->size = ip->size;
 }
 
 #define min(a, b) ((a) < (b) ? (a) : (b))
@@ -342,9 +342,9 @@ readi(struct inode *ip, char *dst, uint off, uint n)
   struct buf *bp;
 
   if(ip->type == T_DEV) {
-    if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].d_read)
+    if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
       return -1;
-    return devsw[ip->major].d_read(ip->minor, dst, n);
+    return devsw[ip->major].read(ip->minor, dst, n);
   }
 
   while(n > 0 && off < ip->size){
@@ -400,9 +400,9 @@ int
 writei(struct inode *ip, char *addr, uint off, uint n)
 {
   if(ip->type == T_DEV) {
-    if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].d_write)
+    if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
       return -1;
-    return devsw[ip->major].d_write(ip->minor, addr, n);
+    return devsw[ip->major].write(ip->minor, addr, n);
   } else if(ip->type == T_FILE || ip->type == T_DIR) {
     struct buf *bp;
     int r = 0;
diff --git a/ls.c b/ls.c
index f42a16537cb9354ff17ca902ba5c569164b94c4f..dfb9f314aed79f3d4fe9f6c017adbe17f0384e4d 100644
--- a/ls.c
+++ b/ls.c
@@ -50,13 +50,13 @@ main(int argc, char *argv[])
     exit();
   }
 
-  switch(st.st_type) {
+  switch(st.type) {
   case T_FILE:
     pname(argv[1]);
-    printf(1, "%d %d %d\n", st.st_type, st.st_ino, st.st_size);
+    printf(1, "%d %d %d\n", st.type, st.ino, st.size);
     break;
   case T_DIR:
-    sz = st.st_size;
+    sz = st.size;
     for(off = 0; off < sz; off += sizeof(struct dirent)) {
       if(read(fd, &dirent, sizeof dirent) != sizeof dirent) {
         printf(1, "ls: read error\n");
@@ -69,7 +69,7 @@ main(int argc, char *argv[])
           continue;
         }
         pname(dirent.name);
-        printf(1, "%d %d %d\n", st.st_type, dirent.inum, st.st_size);
+        printf(1, "%d %d %d\n", st.type, dirent.inum, st.size);
       }
     }
     break;
diff --git a/stat.h b/stat.h
index caf0416e1fbb257c3a6f1b7a7ad0f68c9dd50821..57a018c9dcf4f3e14d2bdb05cd1071663d6858f2 100644
--- a/stat.h
+++ b/stat.h
@@ -1,7 +1,7 @@
 struct stat {
-  int st_dev;
-  uint st_ino;
-  short st_type;
-  short st_nlink;
-  uint st_size;
+  int dev;
+  uint ino;
+  short type;
+  short nlink;
+  uint size;
 };