X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/9461d582084ab8c0d85e8dca1df276945366a84b..af8e873ae38b72a56a89485c62bb5ccd22a9f8a7:/lunaix-os/includes/lunaix/ds/lru.h diff --git a/lunaix-os/includes/lunaix/ds/lru.h b/lunaix-os/includes/lunaix/ds/lru.h new file mode 100644 index 0000000..5ae607d --- /dev/null +++ b/lunaix-os/includes/lunaix/ds/lru.h @@ -0,0 +1,29 @@ +#ifndef __LUNAIX_LRU_H +#define __LUNAIX_LRU_H + +#include + +struct lru_zone +{ + struct llist_header lead_node; + struct llist_header zones; +}; + +struct lru_node +{ + struct llist_header lru_nodes; +}; + +struct lru_zone* +lru_new_zone(); + +void +lru_use_one(struct lru_zone* zone, struct lru_node* node); + +struct lru_node* +lru_evict_one(struct lru_zone* zone); + +void +lru_remove(struct lru_node* node); + +#endif /* __LUNAIX_LRU_H */