2024-08-07 06:35:06 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
#include "sleeplock.h"
|
|
|
|
#include "fs.h"
|
|
|
|
|
2006-07-21 15:18:04 +02:00
|
|
|
struct buf {
|
2024-06-15 16:55:06 +02:00
|
|
|
int valid; // has data been read from disk?
|
|
|
|
int disk; // does disk "own" buf?
|
|
|
|
u32 dev;
|
|
|
|
u32 blockno;
|
2016-09-11 23:24:04 +02:00
|
|
|
struct sleeplock lock;
|
2024-06-15 16:55:06 +02:00
|
|
|
u32 refcnt;
|
|
|
|
struct buf *prev; // LRU cache list
|
|
|
|
struct buf *next;
|
|
|
|
u8 data[BSIZE];
|
2006-07-21 15:18:04 +02:00
|
|
|
};
|