]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
afs: Eliminate the address pointer from the address list cursor
authorDavid Howells <dhowells@redhat.com>
Fri, 19 Oct 2018 23:57:59 +0000 (00:57 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 23 Oct 2018 23:41:09 +0000 (00:41 +0100)
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
fs/afs/internal.h
fs/afs/rxrpc.c
fs/afs/server.c
fs/afs/vl_rotate.c
fs/afs/volume.c

index bc5ce31a4ae45a9c960e6ef472ffb54ec8c1ea7e..1536d1d21c3352533b944f2ae8349ae21fd52338 100644 (file)
@@ -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;
index ac9da1e4050ea5cba8da7fd767ae6b09b6138891..e5b596bd8acf6f083bdbe94ee692e8ef4d2873b1 100644 (file)
@@ -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 */
index 444ba0d511ef77ba25ebd05b1b6ec4e4d9d0b3f7..42e1ea7372e965110a1aab731b4a1c46d4744d69 100644 (file)
@@ -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];
index aa35cfae544001050e567bc0dbac2014b56d57cb..7c1be8b4dc9a2d5bd2efdeee94c3e621c9258b0a 100644 (file)
@@ -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;
index 5b99ea7be194ad64708d791c35d4d1027b6e05ef..ead6dedbb561290e0a999251b88e8ecfb838a192 100644 (file)
@@ -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:
index f0020e35bf6fe3322847ca90c8c044d4c73a1800..7527c081726e09b5174e5469479e171008c60a3d 100644 (file)
@@ -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);
        }