plan 9 import
This commit is contained in:
parent
3bff492520
commit
38c7eb9bd2
4 changed files with 20 additions and 6 deletions
|
|
@ -20,9 +20,11 @@
|
|||
#define VSUPERB 1
|
||||
#define VROOT 2 /* root inode */
|
||||
#define VNAMELEN 14
|
||||
#define BLSIZE 512
|
||||
#define MAXBLSIZE 1024
|
||||
int BLSIZE;
|
||||
#define LINOPB (BLSIZE/sizeof(struct v32dinode))
|
||||
#define LNINDIR (BLSIZE/sizeof(unsigned long))
|
||||
#define LNINDIR (BLSIZE/4)
|
||||
#define MAXLNINDIR (MAXBLSIZE/4)
|
||||
|
||||
struct v32dinode {
|
||||
unsigned char flags[2];
|
||||
|
|
@ -51,6 +53,13 @@ populate(char *name)
|
|||
{
|
||||
Fileinf f;
|
||||
|
||||
BLSIZE = 512; /* 32v */
|
||||
if(blocksize){
|
||||
/* 1024 for 4.1BSD */
|
||||
if(blocksize != 512 && blocksize != 1024)
|
||||
error("bad block size");
|
||||
BLSIZE = blocksize;
|
||||
}
|
||||
replete = 0;
|
||||
tapefile = open(name, OREAD);
|
||||
if (tapefile<0)
|
||||
|
|
@ -106,7 +115,7 @@ docreate(Ram *r)
|
|||
char *
|
||||
doread(Ram *r, vlong off, long cnt)
|
||||
{
|
||||
static char buf[Maxbuf+BLSIZE];
|
||||
static char buf[Maxbuf+MAXBLSIZE];
|
||||
int bno, i;
|
||||
|
||||
bno = off/BLSIZE;
|
||||
|
|
@ -147,7 +156,7 @@ dopermw(Ram *r)
|
|||
Fileinf
|
||||
iget(int ino)
|
||||
{
|
||||
char buf[BLSIZE];
|
||||
char buf[MAXBLSIZE];
|
||||
struct v32dinode *dp;
|
||||
long flags, i;
|
||||
Fileinf f;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue