diff options
author | David Howells <dhowells@redhat.com> | 2024-12-16 20:40:55 +0000 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-12-20 22:34:02 +0100 |
commit | 06fa229ceb36898e68022b5654c017d2c6582d7d (patch) | |
tree | db540d16164012b660f6096819f5288356749f39 /fs/netfs/read_retry.c | |
parent | aabcabf2746062253565b33aa3f8d25999a5ac01 (diff) |
netfs: Abstract out a rolling folio buffer implementation
A rolling buffer is a series of folios held in a list of folio_queues. New
folios and folio_queue structs may be inserted at the head simultaneously
with spent ones being removed from the tail without the need for locking.
The rolling buffer includes an iov_iter and it has to be careful managing
this as the list of folio_queues is extended such that an oops doesn't
incurred because the iterator was pointing to the end of a folio_queue
segment that got appended to and then removed.
We need to use the mechanism twice, once for read and once for write, and,
in future patches, we will use a second rolling buffer to handle bounce
buffering for content encryption.
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/20241216204124.3752367-6-dhowells@redhat.com
cc: Jeff Layton <jlayton@kernel.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/netfs/read_retry.c')
-rw-r--r-- | fs/netfs/read_retry.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/netfs/read_retry.c b/fs/netfs/read_retry.c index 21b4a54e545e1..0983234c2183f 100644 --- a/fs/netfs/read_retry.c +++ b/fs/netfs/read_retry.c @@ -245,7 +245,7 @@ void netfs_unlock_abandoned_read_pages(struct netfs_io_request *rreq) { struct folio_queue *p; - for (p = rreq->buffer; p; p = p->next) { + for (p = rreq->buffer.tail; p; p = p->next) { for (int slot = 0; slot < folioq_count(p); slot++) { struct folio *folio = folioq_folio(p, slot); |