linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: viro@zeniv.linux.org.uk
Cc: dhowells@redhat.com, linux-afs@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 23/25] afs: Eliminate the address pointer from the address list cursor [ver #2]
Date: Wed, 24 Oct 2018 01:00:33 +0100	[thread overview]
Message-ID: <154033923375.12041.543621006004212309.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <154033906284.12041.12908874734066278152.stgit@warthog.procyon.org.uk>

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: David Howells <dhowells@redhat.com>
---

 fs/afs/addr_list.c |    2 --
 fs/afs/internal.h  |    1 -
 fs/afs/rxrpc.c     |    2 +-
 fs/afs/server.c    |    2 --
 fs/afs/vl_rotate.c |    2 +-
 fs/afs/volume.c    |    6 +++---
 6 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/fs/afs/addr_list.c b/fs/afs/addr_list.c
index bc5ce31a4ae4..1536d1d21c33 100644
--- a/fs/afs/addr_list.c
+++ b/fs/afs/addr_list.c
@@ -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;
diff --git a/fs/afs/internal.h b/fs/afs/internal.h
index ac9da1e4050e..e5b596bd8acf 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -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 */
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
index 444ba0d511ef..42e1ea7372e9 100644
--- a/fs/afs/rxrpc.c
+++ b/fs/afs/rxrpc.c
@@ -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];
diff --git a/fs/afs/server.c b/fs/afs/server.c
index aa35cfae5440..7c1be8b4dc9a 100644
--- a/fs/afs/server.c
+++ b/fs/afs/server.c
@@ -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;
diff --git a/fs/afs/vl_rotate.c b/fs/afs/vl_rotate.c
index 5b99ea7be194..ead6dedbb561 100644
--- a/fs/afs/vl_rotate.c
+++ b/fs/afs/vl_rotate.c
@@ -209,7 +209,7 @@ bool afs_select_vlserver(struct afs_vl_cursor *vc)
 	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:
diff --git a/fs/afs/volume.c b/fs/afs/volume.c
index f0020e35bf6f..7527c081726e 100644
--- a/fs/afs/volume.c
+++ b/fs/afs/volume.c
@@ -88,16 +88,16 @@ static struct afs_vldb_entry *afs_vl_lookup_vldb(struct afs_cell *cell,
 			case VL_SERVICE:
 				clear_bit(vc.ac.index, &vc.ac.alist->yfs);
 				set_bit(vc.ac.index, &vc.ac.alist->probed);
-				vc.ac.addr->srx_service = ret;
+				vc.ac.alist->addrs[vc.ac.index].srx_service = ret;
 				break;
 			case YFS_VL_SERVICE:
 				set_bit(vc.ac.index, &vc.ac.alist->yfs);
 				set_bit(vc.ac.index, &vc.ac.alist->probed);
-				vc.ac.addr->srx_service = ret;
+				vc.ac.alist->addrs[vc.ac.index].srx_service = ret;
 				break;
 			}
 		}
-		
+
 		vldb = afs_vl_get_entry_by_name_u(&vc, volname, volnamesz);
 	}
 


  parent reply	other threads:[~2018-10-24  3:38 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23 23:57 [PATCH 00/25] AFS development [ver #2] David Howells
2018-10-23 23:57 ` [PATCH 01/25] amd-gpu: Don't undefine READ and WRITE " David Howells
2018-11-01 22:06   ` Pavel Machek
2018-10-23 23:57 ` [PATCH 02/25] iov_iter: Use accessor function " David Howells
2018-11-28  1:39   ` NeilBrown
2018-10-23 23:58 ` [PATCH 03/25] iov_iter: Separate type from direction and use accessor functions " David Howells
2018-10-23 23:58 ` [PATCH 04/25] iov_iter: Add I/O discard iterator " David Howells
2018-10-23 23:58 ` [PATCH 05/25] afs: Better tracing of protocol errors " David Howells
2018-10-23 23:58 ` [PATCH 06/25] afs: Set up the iov_iter before calling afs_extract_data() " David Howells
2018-10-23 23:58 ` [PATCH 07/25] afs: Improve FS server rotation error handling " David Howells
2018-10-23 23:58 ` [PATCH 08/25] afs: Implement VL server rotation " David Howells
2018-10-23 23:58 ` [PATCH 09/25] afs: Fix TTL on VL server and address lists " David Howells
2018-10-23 23:59 ` [PATCH 10/25] afs: Handle EIO from delivery function " David Howells
2018-10-23 23:59 ` [PATCH 11/25] afs: Add a couple of tracepoints to log I/O errors " David Howells
2018-10-23 23:59 ` [PATCH 12/25] afs: Don't invoke the server to read data beyond EOF " David Howells
2018-10-23 23:59 ` [PATCH 13/25] afs: Increase to 64-bit volume ID and 96-bit vnode ID for YFS " David Howells
2018-10-23 23:59 ` [PATCH 14/25] afs: Commit the status on a new file/dir/symlink " David Howells
2018-10-23 23:59 ` [PATCH 15/25] afs: Remove callback details from afs_callback_break struct " David Howells
2018-10-23 23:59 ` [PATCH 16/25] afs: Implement the YFS cache manager service " David Howells
2018-10-23 23:59 ` [PATCH 17/25] afs: Fix FS.FetchStatus delivery from updating wrong vnode " David Howells
2018-10-23 23:59 ` [PATCH 18/25] afs: Calc callback expiry in op reply delivery " David Howells
2018-10-24  0:00 ` [PATCH 19/25] afs: Get the target vnode in afs_rmdir() and get a callback on it " David Howells
2018-10-24  0:00 ` [PATCH 20/25] afs: Expand data structure fields to support YFS " David Howells
2018-10-24  0:00 ` [PATCH 21/25] afs: Implement YFS support in the fs client " David Howells
2018-10-24  0:00 ` [PATCH 22/25] afs: Allow dumping of server cursor on operation failure " David Howells
2018-10-24  0:00 ` David Howells [this message]
2018-10-24  0:00 ` [PATCH 24/25] afs: Fix callback handling " David Howells
2018-10-24  0:00 ` [PATCH 25/25] afs: Probe multiple fileservers simultaneously " David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=154033923375.12041.543621006004212309.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).