remove _ from pipe; be like file
This commit is contained in:
parent
76f09d7dd0
commit
7834cca604
8
defs.h
8
defs.h
|
@ -92,10 +92,10 @@ void irq_enable(int);
|
|||
void pic_init(void);
|
||||
|
||||
// pipe.c
|
||||
int pipe_alloc(struct file**, struct file**);
|
||||
void pipe_close(struct pipe*, int);
|
||||
int pipe_read(struct pipe*, char*, int);
|
||||
int pipe_write(struct pipe*, char*, int);
|
||||
int pipealloc(struct file**, struct file**);
|
||||
void pipeclose(struct pipe*, int);
|
||||
int piperead(struct pipe*, char*, int);
|
||||
int pipewrite(struct pipe*, char*, int);
|
||||
|
||||
// proc.c
|
||||
struct proc* copyproc(struct proc*);
|
||||
|
|
6
file.c
6
file.c
|
@ -65,7 +65,7 @@ fileclose(struct file *f)
|
|||
release(&file_table_lock);
|
||||
|
||||
if(ff.type == FD_PIPE)
|
||||
pipe_close(ff.pipe, ff.writable);
|
||||
pipeclose(ff.pipe, ff.writable);
|
||||
else if(ff.type == FD_INODE)
|
||||
iput(ff.ip);
|
||||
else
|
||||
|
@ -94,7 +94,7 @@ fileread(struct file *f, char *addr, int n)
|
|||
if(f->readable == 0)
|
||||
return -1;
|
||||
if(f->type == FD_PIPE)
|
||||
return pipe_read(f->pipe, addr, n);
|
||||
return piperead(f->pipe, addr, n);
|
||||
if(f->type == FD_INODE){
|
||||
ilock(f->ip);
|
||||
if((r = readi(f->ip, addr, f->off, n)) > 0)
|
||||
|
@ -114,7 +114,7 @@ filewrite(struct file *f, char *addr, int n)
|
|||
if(f->writable == 0)
|
||||
return -1;
|
||||
if(f->type == FD_PIPE)
|
||||
return pipe_write(f->pipe, addr, n);
|
||||
return pipewrite(f->pipe, addr, n);
|
||||
if(f->type == FD_INODE){
|
||||
ilock(f->ip);
|
||||
if((r = writei(f->ip, addr, f->off, n)) > 0)
|
||||
|
|
8
pipe.c
8
pipe.c
|
@ -18,7 +18,7 @@ struct pipe {
|
|||
};
|
||||
|
||||
int
|
||||
pipe_alloc(struct file **f0, struct file **f1)
|
||||
pipealloc(struct file **f0, struct file **f1)
|
||||
{
|
||||
struct pipe *p;
|
||||
|
||||
|
@ -58,7 +58,7 @@ pipe_alloc(struct file **f0, struct file **f1)
|
|||
}
|
||||
|
||||
void
|
||||
pipe_close(struct pipe *p, int writable)
|
||||
pipeclose(struct pipe *p, int writable)
|
||||
{
|
||||
acquire(&p->lock);
|
||||
if(writable){
|
||||
|
@ -76,7 +76,7 @@ pipe_close(struct pipe *p, int writable)
|
|||
|
||||
//PAGEBREAK: 20
|
||||
int
|
||||
pipe_write(struct pipe *p, char *addr, int n)
|
||||
pipewrite(struct pipe *p, char *addr, int n)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -99,7 +99,7 @@ pipe_write(struct pipe *p, char *addr, int n)
|
|||
}
|
||||
|
||||
int
|
||||
pipe_read(struct pipe *p, char *addr, int n)
|
||||
piperead(struct pipe *p, char *addr, int n)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
Loading…
Reference in a new issue