Lines Matching refs:req

42 	struct erofs_fscache_request *req;
44 req = kzalloc(sizeof(struct erofs_fscache_request), GFP_KERNEL);
45 if (!req)
48 req->mapping = mapping;
49 req->start = start;
50 req->len = len;
51 refcount_set(&req->ref, 1);
53 return req;
59 struct erofs_fscache_request *req;
67 req = erofs_fscache_req_alloc(primary->mapping,
69 if (!IS_ERR(req)) {
70 req->primary = primary;
73 return req;
76 static void erofs_fscache_req_complete(struct erofs_fscache_request *req)
79 bool failed = req->error;
80 pgoff_t start_page = req->start / PAGE_SIZE;
81 pgoff_t last_page = ((req->start + req->len) / PAGE_SIZE) - 1;
83 XA_STATE(xas, &req->mapping->i_pages, start_page);
96 static void erofs_fscache_req_put(struct erofs_fscache_request *req)
98 if (refcount_dec_and_test(&req->ref)) {
99 if (req->cache_resources.ops)
100 req->cache_resources.ops->end_operation(&req->cache_resources);
101 if (!req->primary)
102 erofs_fscache_req_complete(req);
104 erofs_fscache_req_put(req->primary);
105 kfree(req);
112 struct erofs_fscache_request *req = priv;
115 if (req->primary)
116 req->primary->error = transferred_or_error;
118 req->error = transferred_or_error;
120 erofs_fscache_req_put(req);
125 * page cache described by (req->mapping, lstart, len). @pstart describeis the
129 struct erofs_fscache_request *req, loff_t pstart, size_t len)
132 struct super_block *sb = req->mapping->host->i_sb;
133 struct netfs_cache_resources *cres = &req->cache_resources;
135 loff_t lstart = req->start + req->submitted;
139 DBG_BUGON(len > req->len - req->submitted);
159 refcount_inc(&req->ref);
160 iov_iter_xarray(&iter, ITER_DEST, &req->mapping->i_pages,
164 erofs_fscache_subreq_complete, req);
182 struct erofs_fscache_request *req;
184 req = erofs_fscache_req_alloc(folio_mapping(folio),
186 if (IS_ERR(req)) {
188 return PTR_ERR(req);
191 ret = erofs_fscache_read_folios_async(ctx->cookie, req,
194 req->error = ret;
196 erofs_fscache_req_put(req);
205 struct erofs_fscache_request *req;
263 req = erofs_fscache_req_chain(primary, count);
264 if (IS_ERR(req))
265 return PTR_ERR(req);
268 req, mdev.m_pa + (pos - map.m_la), count);
269 erofs_fscache_req_put(req);
274 static int erofs_fscache_data_read(struct erofs_fscache_request *req)
279 ret = erofs_fscache_data_read_slice(req);
281 req->error = ret;
282 } while (!ret && req->submitted < req->len);
289 struct erofs_fscache_request *req;
292 req = erofs_fscache_req_alloc(folio_mapping(folio),
294 if (IS_ERR(req)) {
296 return PTR_ERR(req);
299 ret = erofs_fscache_data_read(req);
300 erofs_fscache_req_put(req);
306 struct erofs_fscache_request *req;
311 req = erofs_fscache_req_alloc(rac->mapping,
313 if (IS_ERR(req))
320 erofs_fscache_data_read(req);
321 erofs_fscache_req_put(req);