Skip to content

Commit 2feeaf8

Browse files
committed
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>
1 parent 744bcd7 commit 2feeaf8

6 files changed

Lines changed: 5 additions & 10 deletions

File tree

‎fs/afs/addr_list.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ bool afs_iterate_addresses(struct afs_addr_cursor *ac)
371371

372372
ac->begun = true;
373373
ac->responded = false;
374-
ac->addr = &ac->alist->addrs[ac->index];
375374
return true;
376375
}
377376

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

392-
ac->addr = NULL;
393391
ac->alist = NULL;
394392
ac->begun = false;
395393
return ac->error;

‎fs/afs/internal.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,6 @@ struct afs_interface {
653653
*/
654654
struct afs_addr_cursor {
655655
struct afs_addr_list *alist; /* Current address list (pins ref) */
656-
struct sockaddr_rxrpc *addr;
657656
u32 abort_code;
658657
unsigned short start; /* Starting point in alist->addrs[] */
659658
unsigned short index; /* Wrapping offset from start to current addr */

‎fs/afs/rxrpc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ static int afs_send_pages(struct afs_call *call, struct msghdr *msg)
359359
long afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call,
360360
gfp_t gfp, bool async)
361361
{
362-
struct sockaddr_rxrpc *srx = ac->addr;
362+
struct sockaddr_rxrpc *srx = &ac->alist->addrs[ac->index];
363363
struct rxrpc_call *rxcall;
364364
struct msghdr msg;
365365
struct kvec iov[1];

‎fs/afs/server.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,6 @@ static void afs_destroy_server(struct afs_net *net, struct afs_server *server)
367367
.alist = alist,
368368
.start = alist->index,
369369
.index = 0,
370-
.addr = &alist->addrs[alist->index],
371370
.error = 0,
372371
};
373372
_enter("%p", server);
@@ -518,7 +517,6 @@ static bool afs_do_probe_fileserver(struct afs_fs_cursor *fc)
518517

519518
_enter("");
520519

521-
fc->ac.addr = NULL;
522520
fc->ac.start = READ_ONCE(fc->ac.alist->index);
523521
fc->ac.index = fc->ac.start;
524522
fc->ac.error = 0;

‎fs/afs/vl_rotate.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ bool afs_select_vlserver(struct afs_vl_cursor *vc)
209209
if (!afs_iterate_addresses(&vc->ac))
210210
goto next_server;
211211

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

215215
next_server:

‎fs/afs/volume.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,16 @@ static struct afs_vldb_entry *afs_vl_lookup_vldb(struct afs_cell *cell,
8888
case VL_SERVICE:
8989
clear_bit(vc.ac.index, &vc.ac.alist->yfs);
9090
set_bit(vc.ac.index, &vc.ac.alist->probed);
91-
vc.ac.addr->srx_service = ret;
91+
vc.ac.alist->addrs[vc.ac.index].srx_service = ret;
9292
break;
9393
case YFS_VL_SERVICE:
9494
set_bit(vc.ac.index, &vc.ac.alist->yfs);
9595
set_bit(vc.ac.index, &vc.ac.alist->probed);
96-
vc.ac.addr->srx_service = ret;
96+
vc.ac.alist->addrs[vc.ac.index].srx_service = ret;
9797
break;
9898
}
9999
}
100-
100+
101101
vldb = afs_vl_get_entry_by_name_u(&vc, volname, volnamesz);
102102
}
103103

0 commit comments

Comments
 (0)