Lines Matching refs:subreq

41 static void erofs_fscache_put_subrequest(struct netfs_io_subrequest *subreq)  in erofs_fscache_put_subrequest()  argument
43 if (!refcount_dec_and_test(&subreq->ref)) in erofs_fscache_put_subrequest()
45 erofs_fscache_put_request(subreq->rreq); in erofs_fscache_put_subrequest()
46 kfree(subreq); in erofs_fscache_put_subrequest()
51 struct netfs_io_subrequest *subreq; in erofs_fscache_clear_subrequests() local
54 subreq = list_first_entry(&rreq->subrequests, in erofs_fscache_clear_subrequests()
56 list_del(&subreq->rreq_link); in erofs_fscache_clear_subrequests()
57 erofs_fscache_put_subrequest(subreq); in erofs_fscache_clear_subrequests()
63 struct netfs_io_subrequest *subreq; in erofs_fscache_rreq_unlock_folios() local
72 subreq = list_first_entry(&rreq->subrequests, in erofs_fscache_rreq_unlock_folios()
74 subreq_failed = (subreq->error < 0); in erofs_fscache_rreq_unlock_folios()
88 if (!subreq) { in erofs_fscache_rreq_unlock_folios()
94 if (pgend < iopos + subreq->len) in erofs_fscache_rreq_unlock_folios()
97 iopos += subreq->len; in erofs_fscache_rreq_unlock_folios()
98 if (!list_is_last(&subreq->rreq_link, in erofs_fscache_rreq_unlock_folios()
100 subreq = list_next_entry(subreq, rreq_link); in erofs_fscache_rreq_unlock_folios()
101 subreq_failed = (subreq->error < 0); in erofs_fscache_rreq_unlock_folios()
103 subreq = NULL; in erofs_fscache_rreq_unlock_folios()
128 struct netfs_io_subrequest *subreq = priv; in erofc_fscache_subreq_complete() local
129 struct netfs_io_request *rreq = subreq->rreq; in erofc_fscache_subreq_complete()
132 subreq->error = transferred_or_error; in erofc_fscache_subreq_complete()
137 erofs_fscache_put_subrequest(subreq); in erofc_fscache_subreq_complete()
150 struct netfs_io_subrequest *subreq; in erofs_fscache_read_folios_async() local
165 subreq = kzalloc(sizeof(struct netfs_io_subrequest), in erofs_fscache_read_folios_async()
167 if (subreq) { in erofs_fscache_read_folios_async()
168 INIT_LIST_HEAD(&subreq->rreq_link); in erofs_fscache_read_folios_async()
169 refcount_set(&subreq->ref, 2); in erofs_fscache_read_folios_async()
170 subreq->rreq = rreq; in erofs_fscache_read_folios_async()
177 subreq->start = pstart + done; in erofs_fscache_read_folios_async()
178 subreq->len = len - done; in erofs_fscache_read_folios_async()
179 subreq->flags = 1 << NETFS_SREQ_ONDEMAND; in erofs_fscache_read_folios_async()
181 list_add_tail(&subreq->rreq_link, &rreq->subrequests); in erofs_fscache_read_folios_async()
183 source = cres->ops->prepare_read(subreq, LLONG_MAX); in erofs_fscache_read_folios_async()
184 if (WARN_ON(subreq->len == 0)) in erofs_fscache_read_folios_async()
190 subreq->error = ret; in erofs_fscache_read_folios_async()
191 erofs_fscache_put_subrequest(subreq); in erofs_fscache_read_folios_async()
198 start + done, subreq->len); in erofs_fscache_read_folios_async()
200 ret = fscache_read(cres, subreq->start, &iter, in erofs_fscache_read_folios_async()
202 erofc_fscache_subreq_complete, subreq); in erofs_fscache_read_folios_async()
210 done += subreq->len; in erofs_fscache_read_folios_async()