remove _ prefixes

This commit is contained in:
rsc 2006-09-07 13:08:23 +00:00
parent 05a7bbe08b
commit 1dca3afbbb
5 changed files with 23 additions and 25 deletions

View file

@ -356,7 +356,7 @@ kbd_intr()
c += 'a' - 'A'; c += 'a' - 'A';
} }
// xxx hack // Ignore unknown keystrokes.
if(c == 0x0) { if(c == 0x0) {
release(&kbd_lock); release(&kbd_lock);
return; return;
@ -406,8 +406,8 @@ console_init()
initlock(&console_lock, "console"); initlock(&console_lock, "console");
initlock(&kbd_lock, "kbd"); initlock(&kbd_lock, "kbd");
devsw[CONSOLE].d_write = console_write; devsw[CONSOLE].write = console_write;
devsw[CONSOLE].d_read = console_read; devsw[CONSOLE].read = console_read;
irq_setmask_8259A(irq_mask_8259A & ~(1 << IRQ_KBD)); irq_setmask_8259A(irq_mask_8259A & ~(1 << IRQ_KBD));
ioapic_enable(IRQ_KBD, 0); ioapic_enable(IRQ_KBD, 0);

6
dev.h
View file

@ -1,8 +1,6 @@
struct devsw { struct devsw {
int (*d_open)(char*, int); int (*read)(int, char*, int);
int (*d_read)(int, char*, int); int (*write)(int, char*, int);
int (*d_write)(int, char*, int);
int (*d_close)(int);
}; };
extern struct devsw devsw[]; extern struct devsw devsw[];

18
fs.c
View file

@ -326,11 +326,11 @@ iincref(struct inode *ip)
void void
stati(struct inode *ip, struct stat *st) stati(struct inode *ip, struct stat *st)
{ {
st->st_dev = ip->dev; st->dev = ip->dev;
st->st_ino = ip->inum; st->ino = ip->inum;
st->st_type = ip->type; st->type = ip->type;
st->st_nlink = ip->nlink; st->nlink = ip->nlink;
st->st_size = ip->size; st->size = ip->size;
} }
#define min(a, b) ((a) < (b) ? (a) : (b)) #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; struct buf *bp;
if(ip->type == T_DEV) { 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 -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){ while(n > 0 && off < ip->size){
@ -400,9 +400,9 @@ int
writei(struct inode *ip, char *addr, uint off, uint n) writei(struct inode *ip, char *addr, uint off, uint n)
{ {
if(ip->type == T_DEV) { 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 -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) { } else if(ip->type == T_FILE || ip->type == T_DIR) {
struct buf *bp; struct buf *bp;
int r = 0; int r = 0;

8
ls.c
View file

@ -50,13 +50,13 @@ main(int argc, char *argv[])
exit(); exit();
} }
switch(st.st_type) { switch(st.type) {
case T_FILE: case T_FILE:
pname(argv[1]); 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; break;
case T_DIR: case T_DIR:
sz = st.st_size; sz = st.size;
for(off = 0; off < sz; off += sizeof(struct dirent)) { for(off = 0; off < sz; off += sizeof(struct dirent)) {
if(read(fd, &dirent, sizeof dirent) != sizeof dirent) { if(read(fd, &dirent, sizeof dirent) != sizeof dirent) {
printf(1, "ls: read error\n"); printf(1, "ls: read error\n");
@ -69,7 +69,7 @@ main(int argc, char *argv[])
continue; continue;
} }
pname(dirent.name); 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; break;

10
stat.h
View file

@ -1,7 +1,7 @@
struct stat { struct stat {
int st_dev; int dev;
uint st_ino; uint ino;
short st_type; short type;
short st_nlink; short nlink;
uint st_size; uint size;
}; };