Commit 2feeaf84 authored by David Howells's avatar David Howells
Browse files

afs: Eliminate the address pointer from the address list cursor



Eliminate the address pointer from the address list cursor as it's
redundant (ac->addrs[ac->index] can be used to find the same address) and
address lists must be replaced rather than being rearranged, so is of
limited value.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 744bcd71
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -371,7 +371,6 @@ bool afs_iterate_addresses(struct afs_addr_cursor *ac)

	ac->begun = true;
	ac->responded = false;
	ac->addr = &ac->alist->addrs[ac->index];
	return true;
}

@@ -389,7 +388,6 @@ int afs_end_cursor(struct afs_addr_cursor *ac)
		afs_put_addrlist(alist);
	}

	ac->addr = NULL;
	ac->alist = NULL;
	ac->begun = false;
	return ac->error;
+0 −1
Original line number Diff line number Diff line
@@ -653,7 +653,6 @@ struct afs_interface {
 */
struct afs_addr_cursor {
	struct afs_addr_list	*alist;		/* Current address list (pins ref) */
	struct sockaddr_rxrpc	*addr;
	u32			abort_code;
	unsigned short		start;		/* Starting point in alist->addrs[] */
	unsigned short		index;		/* Wrapping offset from start to current addr */
+1 −1
Original line number Diff line number Diff line
@@ -359,7 +359,7 @@ static int afs_send_pages(struct afs_call *call, struct msghdr *msg)
long afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call,
		   gfp_t gfp, bool async)
{
	struct sockaddr_rxrpc *srx = ac->addr;
	struct sockaddr_rxrpc *srx = &ac->alist->addrs[ac->index];
	struct rxrpc_call *rxcall;
	struct msghdr msg;
	struct kvec iov[1];
+0 −2
Original line number Diff line number Diff line
@@ -367,7 +367,6 @@ static void afs_destroy_server(struct afs_net *net, struct afs_server *server)
		.alist	= alist,
		.start	= alist->index,
		.index	= 0,
		.addr	= &alist->addrs[alist->index],
		.error	= 0,
	};
	_enter("%p", server);
@@ -518,7 +517,6 @@ static bool afs_do_probe_fileserver(struct afs_fs_cursor *fc)

	_enter("");

	fc->ac.addr = NULL;
	fc->ac.start = READ_ONCE(fc->ac.alist->index);
	fc->ac.index = fc->ac.start;
	fc->ac.error = 0;
+1 −1
Original line number Diff line number Diff line
@@ -209,7 +209,7 @@ iterate_address:
	if (!afs_iterate_addresses(&vc->ac))
		goto next_server;

	_leave(" = t %pISpc", &vc->ac.addr->transport);
	_leave(" = t %pISpc", &vc->ac.alist->addrs[vc->ac.index].transport);
	return true;

next_server:
Loading