summaryrefslogtreecommitdiff
path: root/fs/afs
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2018-10-20 02:57:59 +0300
committerDavid Howells <dhowells@redhat.com>2018-10-24 02:41:09 +0300
commit2feeaf8433c8e68de3d0a06a0ffe7742bcd13c1a (patch)
tree3df3266b2ae356ad67edf8fa5bf3491e2c865472 /fs/afs
parent744bcd713a4eabb248246f7deccfad30c579b7f5 (diff)
downloadlinux-2feeaf8433c8e68de3d0a06a0ffe7742bcd13c1a.tar.xz
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: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs')
-rw-r--r--fs/afs/addr_list.c2
-rw-r--r--fs/afs/internal.h1
-rw-r--r--fs/afs/rxrpc.c2
-rw-r--r--fs/afs/server.c2
-rw-r--r--fs/afs/vl_rotate.c2
-rw-r--r--fs/afs/volume.c6
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 @@ 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:
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);
}