Unverified Commit e02cdc0e authored by Christian Brauner's avatar Christian Brauner
Browse files

Merge patch series "netfs: Miscellaneous cleanups"

David Howells <dhowells@redhat.com> says:

Here are some miscellaneous very minor cleanups for netfslib for the next
merge window, primarily from Max Kellermann, if you could pull them.

 (1) Remove NETFS_SREQ_SEEK_DATA_READ.

 (2) Remove NETFS_INVALID_WRITE.

 (3) Remove NETFS_ICTX_WRITETHROUGH.

 (4) Remove NETFS_READ_HOLE_CLEAR.

 (5) Reorder structs to eliminate holes.

 (6) Remove netfs_io_request::ractl.

 (7) Only provide proc_link field if CONFIG_PROC_FS=y.

 (8) Remove folio_queue::marks3.

 (9) Remove NETFS_RREQ_DONT_UNLOCK_FOLIOS.

(10) Remove NETFS_RREQ_BLOCKED.

* patches from https://lore.kernel.org/20250519134813.2975312-1-dhowells@redhat.com:
  fs/netfs: remove unused flag NETFS_RREQ_BLOCKED
  fs/netfs: remove unused flag NETFS_RREQ_DONT_UNLOCK_FOLIOS
  folio_queue: remove unused field `marks3`
  fs/netfs: declare field `proc_link` only if CONFIG_PROC_FS=y
  fs/netfs: remove `netfs_io_request.ractl`
  fs/netfs: reorder struct fields to eliminate holes
  fs/netfs: remove unused enum choice NETFS_READ_HOLE_CLEAR
  fs/netfs: remove unused flag NETFS_ICTX_WRITETHROUGH
  fs/netfs: remove unused source NETFS_INVALID_WRITE
  fs/netfs: remove unused flag NETFS_SREQ_SEEK_DATA_READ

Link: https://lore.kernel.org/20250519134813.2975312-1-dhowells@redhat.com


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parents a1b4a25a 4b1ca12d
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -151,19 +151,16 @@ The marks can be set by::

	void folioq_mark(struct folio_queue *folioq, unsigned int slot);
	void folioq_mark2(struct folio_queue *folioq, unsigned int slot);
	void folioq_mark3(struct folio_queue *folioq, unsigned int slot);

Cleared by::

	void folioq_unmark(struct folio_queue *folioq, unsigned int slot);
	void folioq_unmark2(struct folio_queue *folioq, unsigned int slot);
	void folioq_unmark3(struct folio_queue *folioq, unsigned int slot);

And the marks can be queried by::

	bool folioq_is_marked(const struct folio_queue *folioq, unsigned int slot);
	bool folioq_is_marked2(const struct folio_queue *folioq, unsigned int slot);
	bool folioq_is_marked3(const struct folio_queue *folioq, unsigned int slot);

The marks can be used for any purpose and are not interpreted by this API.

+0 −5
Original line number Diff line number Diff line
@@ -712,11 +712,6 @@ handle falling back from one source type to another. The members are:
     at a boundary with the filesystem structure (e.g. at the end of a Ceph
     object).  It tells netfslib not to retile subrequests across it.

   * ``NETFS_SREQ_SEEK_DATA_READ``

     This is a hint from netfslib to the cache that it might want to try
     skipping ahead to the next data (ie. using SEEK_DATA).

 * ``error``

   This is for the filesystem to store result of the subrequest.  It should be
+12 −12
Original line number Diff line number Diff line
@@ -78,7 +78,8 @@ static int netfs_begin_cache_read(struct netfs_io_request *rreq, struct netfs_in
 * [!] NOTE: This must be run in the same thread as ->issue_read() was called
 * in as we access the readahead_control struct.
 */
static ssize_t netfs_prepare_read_iterator(struct netfs_io_subrequest *subreq)
static ssize_t netfs_prepare_read_iterator(struct netfs_io_subrequest *subreq,
					   struct readahead_control *ractl)
{
	struct netfs_io_request *rreq = subreq->rreq;
	size_t rsize = subreq->len;
@@ -86,7 +87,7 @@ static ssize_t netfs_prepare_read_iterator(struct netfs_io_subrequest *subreq)
	if (subreq->source == NETFS_DOWNLOAD_FROM_SERVER)
		rsize = umin(rsize, rreq->io_streams[0].sreq_max_len);

	if (rreq->ractl) {
	if (ractl) {
		/* If we don't have sufficient folios in the rolling buffer,
		 * extract a folioq's worth from the readahead region at a time
		 * into the buffer.  Note that this acquires a ref on each page
@@ -99,7 +100,7 @@ static ssize_t netfs_prepare_read_iterator(struct netfs_io_subrequest *subreq)
		while (rreq->submitted < subreq->start + rsize) {
			ssize_t added;

			added = rolling_buffer_load_from_ra(&rreq->buffer, rreq->ractl,
			added = rolling_buffer_load_from_ra(&rreq->buffer, ractl,
							    &put_batch);
			if (added < 0)
				return added;
@@ -211,7 +212,8 @@ static void netfs_issue_read(struct netfs_io_request *rreq,
 * slicing up the region to be read according to available cache blocks and
 * network rsize.
 */
static void netfs_read_to_pagecache(struct netfs_io_request *rreq)
static void netfs_read_to_pagecache(struct netfs_io_request *rreq,
				    struct readahead_control *ractl)
{
	struct netfs_inode *ictx = netfs_inode(rreq->inode);
	unsigned long long start = rreq->start;
@@ -291,7 +293,7 @@ static void netfs_read_to_pagecache(struct netfs_io_request *rreq)
		break;

	issue:
		slice = netfs_prepare_read_iterator(subreq);
		slice = netfs_prepare_read_iterator(subreq, ractl);
		if (slice < 0) {
			ret = slice;
			subreq->error = ret;
@@ -359,11 +361,10 @@ void netfs_readahead(struct readahead_control *ractl)

	netfs_rreq_expand(rreq, ractl);

	rreq->ractl = ractl;
	rreq->submitted = rreq->start;
	if (rolling_buffer_init(&rreq->buffer, rreq->debug_id, ITER_DEST) < 0)
		goto cleanup_free;
	netfs_read_to_pagecache(rreq);
	netfs_read_to_pagecache(rreq, ractl);

	netfs_put_request(rreq, true, netfs_rreq_trace_put_return);
	return;
@@ -389,7 +390,6 @@ static int netfs_create_singular_buffer(struct netfs_io_request *rreq, struct fo
	if (added < 0)
		return added;
	rreq->submitted = rreq->start + added;
	rreq->ractl = (struct readahead_control *)1UL;
	return 0;
}

@@ -459,7 +459,7 @@ static int netfs_read_gaps(struct file *file, struct folio *folio)
	iov_iter_bvec(&rreq->buffer.iter, ITER_DEST, bvec, i, rreq->len);
	rreq->submitted = rreq->start + flen;

	netfs_read_to_pagecache(rreq);
	netfs_read_to_pagecache(rreq, NULL);

	if (sink)
		folio_put(sink);
@@ -528,7 +528,7 @@ int netfs_read_folio(struct file *file, struct folio *folio)
	if (ret < 0)
		goto discard;

	netfs_read_to_pagecache(rreq);
	netfs_read_to_pagecache(rreq, NULL);
	ret = netfs_wait_for_read(rreq);
	netfs_put_request(rreq, false, netfs_rreq_trace_put_return);
	return ret < 0 ? ret : 0;
@@ -685,7 +685,7 @@ int netfs_write_begin(struct netfs_inode *ctx,
	if (ret < 0)
		goto error_put;

	netfs_read_to_pagecache(rreq);
	netfs_read_to_pagecache(rreq, NULL);
	ret = netfs_wait_for_read(rreq);
	if (ret < 0)
		goto error;
@@ -750,7 +750,7 @@ int netfs_prefetch_for_write(struct file *file, struct folio *folio,
	if (ret < 0)
		goto error_put;

	netfs_read_to_pagecache(rreq);
	netfs_read_to_pagecache(rreq, NULL);
	ret = netfs_wait_for_read(rreq);
	netfs_put_request(rreq, false, netfs_rreq_trace_put_return);
	return ret < 0 ? ret : 0;
+1 −2
Original line number Diff line number Diff line
@@ -115,8 +115,7 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter,
	size_t max_chunk = mapping_max_folio_size(mapping);
	bool maybe_trouble = false;

	if (unlikely(test_bit(NETFS_ICTX_WRITETHROUGH, &ctx->flags) ||
		     iocb->ki_flags & (IOCB_DSYNC | IOCB_SYNC))
	if (unlikely(iocb->ki_flags & (IOCB_DSYNC | IOCB_SYNC))
	    ) {
		wbc_attach_fdatawrite_inode(&wbc, mapping->host);

+0 −3
Original line number Diff line number Diff line
@@ -106,9 +106,6 @@ static int netfs_dispatch_unbuffered_reads(struct netfs_io_request *rreq)
			netfs_wait_for_pause(rreq);
		if (test_bit(NETFS_RREQ_FAILED, &rreq->flags))
			break;
		if (test_bit(NETFS_RREQ_BLOCKED, &rreq->flags) &&
		    test_bit(NETFS_RREQ_NONBLOCK, &rreq->flags))
			break;
		cond_resched();
	} while (size > 0);

Loading