// SPDX-License-Identifier: GPL-2.0-only /* Read with PG_private_2 [DEPRECATED]. * * Copyright (C) 2024 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com)
*/
/* netfs_perform_write() may shift i_size around the page or from out * of the page to beyond it, but cannot move i_size into or through the * page since we have it locked.
*/
i_size = i_size_read(creq->inode);
/* Attach the folio to the rolling buffer. */ if (rolling_buffer_append(&creq->buffer, folio, 0) < 0) {
clear_bit(NETFS_RREQ_FOLIO_COPY_TO_CACHE, &creq->flags); return;
}
/* Attach the folio to one or more subrequests. For a big folio, we * could end up with thousands of subrequests if the wsize is small - * but we might need to wait during the creation of subrequests for * network resources (eg. SMB credits).
*/ do {
ssize_t part;
/* * [DEPRECATED] Mark page as requiring copy-to-cache using PG_private_2 and add * it to the copy write request.
*/ void netfs_pgpriv2_copy_to_cache(struct netfs_io_request *rreq, struct folio *folio)
{ struct netfs_io_request *creq = rreq->copy_to_cache;
if (!creq)
creq = netfs_pgpriv2_begin_copy_to_cache(rreq, folio); if (IS_ERR(creq)) return;
/* * [DEPRECATED] End writing to the cache, flushing out any outstanding writes.
*/ void netfs_pgpriv2_end_copy_to_cache(struct netfs_io_request *rreq)
{ struct netfs_io_request *creq = rreq->copy_to_cache;
if (IS_ERR_OR_NULL(creq)) return;
netfs_issue_write(creq, &creq->io_streams[1]);
smp_wmb(); /* Write lists before ALL_QUEUED. */
set_bit(NETFS_RREQ_ALL_QUEUED, &creq->flags);
trace_netfs_rreq(rreq, netfs_rreq_trace_end_copy_to_cache); if (list_empty_careful(&creq->io_streams[1].subrequests))
netfs_wake_collector(creq);
/* Clean up the head folioq. If we clear an entire folioq, then * we can get rid of it provided it's not also the tail folioq * being filled by the issuer.
*/
folioq_clear(folioq, slot);
slot++; if (slot >= folioq_nr_slots(folioq)) {
folioq = rolling_buffer_delete_spent(&creq->buffer); if (!folioq) goto done;
slot = 0;
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.1Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.