X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=lib%2Fpagecache.h;h=0f99446ed4e10af2e373f4ba61dab49aec6f35dd;hb=ae9721feabb6690778d9bc6751f6a6f434cdbeaf;hp=7598f3459b80eedf9256cf738c3347e0a4c0bbd8;hpb=7da4760cfac317e4ee8fcc564c04135f7e5ac08b;p=libucw.git diff --git a/lib/pagecache.h b/lib/pagecache.h index 7598f345..0f99446e 100644 --- a/lib/pagecache.h +++ b/lib/pagecache.h @@ -1,7 +1,7 @@ /* * Sherlock Library -- File Page Cache * - * (c) 1999 Martin Mares + * (c) 1999--2002 Martin Mares */ #ifndef _SHERLOCK_PAGECACHE_H @@ -14,7 +14,8 @@ struct page_cache; struct page { node n; /* Node in page list */ node hn; /* Node in hash table */ - sh_off_t key; /* Lower bits contain file handle */ + sh_off_t pos; + uns fd; uns flags; uns lock_count; byte data[0]; @@ -30,9 +31,9 @@ void pgc_flush(struct page_cache *); /* Write all unwritten pages */ void pgc_cleanup(struct page_cache *); /* Deallocate all unused buffers */ struct page *pgc_read(struct page_cache *, int fd, sh_off_t); /* Read page and lock it */ struct page *pgc_get(struct page_cache *, int fd, sh_off_t); /* Get page for writing */ +struct page *pgc_get_zero(struct page_cache *, int fd, sh_off_t); /* ... and clear it */ void pgc_put(struct page_cache *, struct page *); /* Release page */ void pgc_mark_dirty(struct page_cache *, struct page *); /* Mark locked page as dirty */ byte *pgc_read_data(struct page_cache *, int fd, sh_off_t, uns *); /* Partial reading */ -sh_off_t pgc_page_pos(struct page_cache *, struct page *); /* Get page position */ #endif