file.c
// Increment ref count for file f.
Increment ref count for file f.
Increment ref count for file f .
struct file*
filedup(struct file *f)
{
  acquire(&file_table_lock);
  if(f->ref < 1 || f->type == FD_CLOSED)
    panic("filedup");
  f->ref++;
  release(&file_table_lock);
  return f;
}
struct file * filedup ( struct file * f ) { acquire ( & file_table_lock ) ; if ( f -> ref < 1 || f -> type == FD_CLOSED ) panic ( " " ) ; f -> ref ++ ; release ( & file_table_lock ) ; return f ; }
Increment ref count for file f.
Increment ref count for file f .