aboutsummaryrefslogtreecommitdiff
path: root/include/venti.h
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2009-05-25 02:11:27 -0700
committerRuss Cox <rsc@swtch.com>2009-05-25 02:11:27 -0700
commit75d048884cfcb7cc4404b384da50923e22224365 (patch)
treeb918a6a957b1f322ebb2f84c16092e103f91acda /include/venti.h
parent33b446b8bbfea80552d462296d27ad4114fbd3fb (diff)
downloadplan9port-75d048884cfcb7cc4404b384da50923e22224365.tar.gz
plan9port-75d048884cfcb7cc4404b384da50923e22224365.tar.bz2
plan9port-75d048884cfcb7cc4404b384da50923e22224365.zip
venti: 32-bit extensions to data structures
Diffstat (limited to 'include/venti.h')
-rw-r--r--include/venti.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/include/venti.h b/include/venti.h
index 14627dcb..3365182f 100644
--- a/include/venti.h
+++ b/include/venti.h
@@ -86,7 +86,6 @@ enum
{
VtScoreSize = 20,
VtMaxStringSize = 1024,
- VtMaxLumpSize = 56*1024,
VtPointerDepth = 7
};
#define VtMaxFileSize ((1ULL<<48)-1)
@@ -137,7 +136,8 @@ enum
_VtEntryDir = 1<<1, /* a directory */
_VtEntryDepthShift = 2, /* shift for pointer depth */
_VtEntryDepthMask = 7<<2, /* mask for pointer depth */
- VtEntryLocal = 1<<5 /* for local storage only */
+ VtEntryLocal = 1<<5, /* for local storage only */
+ _VtEntryBig = 1<<6,
};
enum
{
@@ -146,8 +146,8 @@ enum
struct VtEntry
{
ulong gen; /* generation number */
- ushort psize; /* pointer block size */
- ushort dsize; /* data block size */
+ ulong psize; /* pointer block size */
+ ulong dsize; /* data block size */
uchar type;
uchar flags;
uvlong size;
@@ -162,14 +162,15 @@ struct VtRoot
char name[128];
char type[128];
uchar score[VtScoreSize]; /* to a Dir block */
- ushort blocksize; /* maximum block size */
+ ulong blocksize; /* maximum block size */
uchar prev[VtScoreSize]; /* last root block */
};
enum
{
VtRootSize = 300,
- VtRootVersion = 2
+ VtRootVersion = 2,
+ _VtRootVersionBig = 1<<15,
};
void vtrootpack(VtRoot*, uchar*);
@@ -394,7 +395,8 @@ struct VtBlock
uchar *data;
uchar score[VtScoreSize];
- uchar type; /* BtXXX */
+ uchar type; /* VtXXX */
+ ulong size;
/* internal to cache */
int nlock;
@@ -412,14 +414,13 @@ struct VtBlock
u32int vtglobaltolocal(uchar[VtScoreSize]);
void vtlocaltoglobal(u32int, uchar[VtScoreSize]);
-VtCache *vtcachealloc(VtConn*, int blocksize, ulong nblocks);
+VtCache *vtcachealloc(VtConn*, ulong maxmem);
void vtcachefree(VtCache*);
VtBlock *vtcachelocal(VtCache*, u32int addr, int type);
-VtBlock *vtcacheglobal(VtCache*, uchar[VtScoreSize], int type);
-VtBlock *vtcacheallocblock(VtCache*, int type);
+VtBlock *vtcacheglobal(VtCache*, uchar[VtScoreSize], int type, ulong size);
+VtBlock *vtcacheallocblock(VtCache*, int type, ulong size);
void vtcachesetwrite(VtCache*, int(*)(VtConn*,uchar[VtScoreSize],uint,uchar*,int));
void vtblockput(VtBlock*);
-u32int vtcacheblocksize(VtCache*);
int vtblockwrite(VtBlock*);
VtBlock *vtblockcopy(VtBlock*);
void vtblockduplock(VtBlock*);
@@ -438,6 +439,7 @@ struct VtFile
int local;
VtBlock *b; /* block containing this file */
uchar score[VtScoreSize]; /* score of block containing this file */
+ int bsize; /* size of block */
/* immutable */
VtCache *c;