aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/venti/dat.h
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-03-11 19:14:09 +0000
committerrsc <devnull@localhost>2004-03-11 19:14:09 +0000
commit24998851775d2d2a737a172dc614d9b5c91706dc (patch)
tree6b249cd18b9ca71aec829c7a4686974f0594cf88 /src/cmd/venti/dat.h
parentd49a2e4801752c8a1211c7fac8cc08055a6b6fa5 (diff)
downloadplan9port-24998851775d2d2a737a172dc614d9b5c91706dc.tar.gz
plan9port-24998851775d2d2a737a172dc614d9b5c91706dc.tar.bz2
plan9port-24998851775d2d2a737a172dc614d9b5c91706dc.zip
Implement write buffer.
Diffstat (limited to 'src/cmd/venti/dat.h')
-rw-r--r--src/cmd/venti/dat.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cmd/venti/dat.h b/src/cmd/venti/dat.h
index b9f395c8..d6d7d1b0 100644
--- a/src/cmd/venti/dat.h
+++ b/src/cmd/venti/dat.h
@@ -115,6 +115,13 @@ enum
MaxClumpBlocks = (VtMaxLumpSize + ClumpSize + (1 << ABlockLog) - 1) >> ABlockLog,
+ /*
+ * dirty flags
+ */
+ DirtyArena = 1,
+ DirtyIndex,
+ DirtyArenaCib,
+
VentiZZZZZZZZ
};
@@ -142,6 +149,7 @@ struct Part
u64int size; /* size of the partiton */
u32int blocksize; /* block size for reads and writes */
char *name;
+ Channel *writechan; /* chan[dcache.nblock](DBlock*) */
};
/*
@@ -156,6 +164,8 @@ struct DBlock
Part *part; /* partition in which cached */
u64int addr; /* base address on the partition */
u16int size; /* amount of data available, not amount allocated; should go away */
+ u32int dirty;
+ u32int dirtying;
DBlock *next; /* doubly linked hash chains */
DBlock *prev;
u32int heap; /* index in heap table */
@@ -163,6 +173,8 @@ struct DBlock
u32int used2;
u32int ref; /* reference count */
QLock lock; /* for access to data only */
+ Channel writedonechan;
+ void* chanbuf[1]; /* buffer for the chan! */
};
/*
@@ -486,6 +498,10 @@ struct Stats
long iclookups; /* index cache lookups */
long ichits; /* hits in the cache */
long icfills; /* successful fills from index */
+ long absorbedwrites; /* disk writes absorbed by dcache */
+ long dirtydblocks; /* blocks dirtied */
+ long dcacheflushes; /* times dcache has flushed */
+ long dcacheflushwrites; /* blocks written by those flushes */
};
extern Index *mainindex;