Unverified Commit 31fc366a authored by David Howells's avatar David Howells Committed by Christian Brauner
Browse files

netfs: Drop the was_async arg from netfs_read_subreq_terminated()



Drop the was_async argument from netfs_read_subreq_terminated().  Almost
every caller is either in process context and passes false.  Some
filesystems delegate the call to a workqueue to avoid doing the work in
their network message queue parsing thread.

The only exception is netfs_cache_read_terminated() which handles
completion in the cache - which is usually a callback from the backing
filesystem in softirq context, though it can be from process context if an
error occurred.  In this case, delegate to a workqueue.

Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/CAHk-=wiVC5Cgyz6QKXFu6fTaA6h4CjexDR-OV9kL6Vo5x9v8=A@mail.gmail.com/


Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/20241216204124.3752367-10-dhowells@redhat.com


cc: Jeff Layton <jlayton@kernel.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 36015782
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ static void v9fs_issue_read(struct netfs_io_subrequest *subreq)
	}

	subreq->error = err;
	netfs_read_subreq_terminated(subreq, false);
	netfs_read_subreq_terminated(subreq);
}

/**
+3 −3
Original line number Diff line number Diff line
@@ -247,7 +247,7 @@ static void afs_fetch_data_notify(struct afs_operation *op)
		if (req->pos + req->actual_len >= req->file_size)
			__set_bit(NETFS_SREQ_HIT_EOF, &subreq->flags);
		subreq->error = error;
		netfs_read_subreq_terminated(subreq, false);
		netfs_read_subreq_terminated(subreq);
		req->subreq = NULL;
	} else if (req->done) {
		req->done(req);
@@ -304,7 +304,7 @@ int afs_fetch_data(struct afs_vnode *vnode, struct afs_read *req)
	if (IS_ERR(op)) {
		if (req->subreq) {
			req->subreq->error = PTR_ERR(op);
			netfs_read_subreq_terminated(req->subreq, false);
			netfs_read_subreq_terminated(req->subreq);
		}
		return PTR_ERR(op);
	}
@@ -325,7 +325,7 @@ static void afs_read_worker(struct work_struct *work)
	fsreq = afs_alloc_read(GFP_NOFS);
	if (!fsreq) {
		subreq->error = -ENOMEM;
		return netfs_read_subreq_terminated(subreq, false);
		return netfs_read_subreq_terminated(subreq);
	}

	fsreq->subreq	= subreq;
+1 −1
Original line number Diff line number Diff line
@@ -352,7 +352,7 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call)
		ret = afs_extract_data(call, true);
		if (req->subreq) {
			req->subreq->transferred += count_before - call->iov_len;
			netfs_read_subreq_progress(req->subreq, false);
			netfs_read_subreq_progress(req->subreq);
		}
		if (ret < 0)
			return ret;
+1 −1
Original line number Diff line number Diff line
@@ -398,7 +398,7 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
		ret = afs_extract_data(call, true);
		if (req->subreq) {
			req->subreq->transferred += count_before - call->iov_len;
			netfs_read_subreq_progress(req->subreq, false);
			netfs_read_subreq_progress(req->subreq);
		}
		if (ret < 0)
			return ret;
+3 −3
Original line number Diff line number Diff line
@@ -255,7 +255,7 @@ static void finish_netfs_read(struct ceph_osd_request *req)
	}
	subreq->error = err;
	trace_netfs_sreq(subreq, netfs_sreq_trace_io_progress);
	netfs_read_subreq_terminated(subreq, false);
	netfs_read_subreq_terminated(subreq);
	iput(req->r_inode);
	ceph_dec_osd_stopping_blocker(fsc->mdsc);
}
@@ -317,7 +317,7 @@ static bool ceph_netfs_issue_op_inline(struct netfs_io_subrequest *subreq)
out:
	subreq->error = err;
	trace_netfs_sreq(subreq, netfs_sreq_trace_io_progress);
	netfs_read_subreq_terminated(subreq, false);
	netfs_read_subreq_terminated(subreq);
	return true;
}

@@ -431,7 +431,7 @@ static void ceph_netfs_issue_read(struct netfs_io_subrequest *subreq)
	ceph_osdc_put_request(req);
	if (err) {
		subreq->error = err;
		netfs_read_subreq_terminated(subreq, false);
		netfs_read_subreq_terminated(subreq);
	}
	doutc(cl, "%llx.%llx result %d\n", ceph_vinop(inode), err);
}
Loading