/* allocate a block in the cache in which to store a page */
int cachefiles_allocate_page(struct fscache_retrieval *op, struct page *page, gfp_t gfp)
/* allocate a block in the cache in which to store a page */
int cachefiles_allocate_page(struct fscache_retrieval *op, struct page *page, gfp_t gfp)
{
	struct cachefiles_object *object;
	struct cachefiles_cache *cache;
	struct pagevec pagevec;
	int ret;
	object = container_of(op->op.object,
			      struct cachefiles_object, fscache);
	cache = container_of(object->fscache.cache,
			     struct cachefiles_cache, cache);
	_enter("%p,{%lx},", object, page->index);
	ret = cachefiles_has_space(cache, 0, 1);
	if (ret == 0) {
		pagevec_init(&pagevec, 0);
		pagevec_add(&pagevec, page);
		fscache_mark_pages_cached(op, &pagevec);
	} else {
		ret = -ENOBUFS;
	}
	_leave(" = %d", ret);
	return ret;
}