summaryrefslogtreecommitdiff
path: root/kernel/buf.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/buf.h')
-rw-r--r--kernel/buf.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/buf.h b/kernel/buf.h
new file mode 100644
index 0000000..3266495
--- /dev/null
+++ b/kernel/buf.h
@@ -0,0 +1,14 @@
+struct buf {
+ int flags;
+ uint dev;
+ uint blockno;
+ struct sleeplock lock;
+ uint refcnt;
+ struct buf *prev; // LRU cache list
+ struct buf *next;
+ struct buf *qnext; // disk queue
+ uchar data[BSIZE];
+};
+#define B_VALID 0x2 // buffer has been read from disk
+#define B_DIRTY 0x4 // buffer needs to be written to disk
+