read_cache_page will lock the page. So the code uses wait_on_page_locked() to wait it until it is unlocked (which means reading is finished). If there was anything wrong during reading, page won't be marked with PG_uptodate, so the caller will know reading failed.
Regards, Zhu Yanhai 2009/11/20 Darrin Thompson <darri...@gmail.com> > I see several instances of code like below scattered throughout the > kernel. This is a good example: > > page=read_cache_page(mapping,0,(filler_t *)mapping->a_ops->readpage,NULL); > dentry_dst=(struct dentry *)page; > if (IS_ERR(page)) > goto out; > wait_on_page_locked(page); > if (!PageUptodate(page)) > goto async_fail; // <<--- This I don't understand... > > What events can lead to read_cache_page returning !PageUptodate? My goal > will be to try to exercise a similar handler to test some code. > > -- > Darrin > > -- > To unsubscribe from this list: send an email with > "unsubscribe kernelnewbies" to ecar...@nl.linux.org > Please read the FAQ at http://kernelnewbies.org/FAQ > >