Re: read_cache_page() & Page_Uptodate()...

From: Juan J. Quintela (quintela@fi.udc.es)
Date: Tue May 16 2000 - 16:00:44 EST


>>>>> "trond" == Trond Myklebust <trond.myklebust@fys.uio.no> writes:

trond> struct page *update_cache_page(struct address_space *mapping,
trond> unsigned long index,
trond> int (*filler)(void *,struct page*),
trond> void *data)
trond> {
trond> struct page *page = read_cache_page(mapping, index, filler,
trond> data);
trond> int err;

trond> if (IS_ERR(page) || Page_Uptodate(page))
trond> goto out;

trond> lock_page(page);
trond> if (Page_Uptodate(page)) {
trond> UnlockPage(page);
trond> goto out;
trond> }
trond> err = filler(data, page);
trond> if (err < 0) {
trond> page_cache_release(page);
trond> page = ERR_PTR(err);
trond> }
trond> out:
trond> return page;
trond> }

Errr, your return the page semetimes locked, and sometimes unlocked,
is that the intended behaviour? Or filler is unlocking the page???

Later, Juan.

-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue May 23 2000 - 21:00:11 EST