summaryrefslogtreecommitdiffstats
path: root/fs/afs/vlocation.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2017-11-02 15:27:47 +0000
committerDavid Howells <dhowells@redhat.com>2017-11-13 15:38:17 +0000
commit4d9df9868f31df6725481135c10ac6419ce58d44 (patch)
treec4fcbe437438c940485d438ad5c5871ab20d3288 /fs/afs/vlocation.c
parentad6a942a9e74edea8a4a126a1e434feff6a6d5c2 (diff)
afs: Keep and pass sockaddr_rxrpc addresses rather than in_addr
Keep and pass sockaddr_rxrpc addresses around rather than keeping and passing in_addr addresses to allow for the use of IPv6 and non-standard port numbers in future. This also allows the port and service_id fields to be removed from the afs_call struct. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs/vlocation.c')
-rw-r--r--fs/afs/vlocation.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/fs/afs/vlocation.c b/fs/afs/vlocation.c
index 745921171058..ec5ab8dc9bc8 100644
--- a/fs/afs/vlocation.c
+++ b/fs/afs/vlocation.c
@@ -30,7 +30,6 @@ static int afs_vlocation_access_vl_by_name(struct afs_vlocation *vl,
struct afs_cache_vlocation *vldb)
{
struct afs_cell *cell = vl->cell;
- struct in_addr addr;
int count, ret;
_enter("%s,%s", cell->name, vl->vldb.name);
@@ -38,12 +37,12 @@ static int afs_vlocation_access_vl_by_name(struct afs_vlocation *vl,
down_write(&vl->cell->vl_sem);
ret = -ENOMEDIUM;
for (count = cell->vl_naddrs; count > 0; count--) {
- addr = cell->vl_addrs[cell->vl_curr_svix];
+ struct sockaddr_rxrpc *addr = &cell->vl_addrs[cell->vl_curr_svix];
- _debug("CellServ[%hu]: %08x", cell->vl_curr_svix, addr.s_addr);
+ _debug("CellServ[%hu]: %pIS", cell->vl_curr_svix, &addr->transport);
/* attempt to access the VL server */
- ret = afs_vl_get_entry_by_name(cell->net, &addr, key,
+ ret = afs_vl_get_entry_by_name(cell->net, addr, key,
vl->vldb.name, vldb, false);
switch (ret) {
case 0:
@@ -88,7 +87,6 @@ static int afs_vlocation_access_vl_by_id(struct afs_vlocation *vl,
struct afs_cache_vlocation *vldb)
{
struct afs_cell *cell = vl->cell;
- struct in_addr addr;
int count, ret;
_enter("%s,%x,%d,", cell->name, volid, voltype);
@@ -96,12 +94,12 @@ static int afs_vlocation_access_vl_by_id(struct afs_vlocation *vl,
down_write(&vl->cell->vl_sem);
ret = -ENOMEDIUM;
for (count = cell->vl_naddrs; count > 0; count--) {
- addr = cell->vl_addrs[cell->vl_curr_svix];
+ struct sockaddr_rxrpc *addr = &cell->vl_addrs[cell->vl_curr_svix];
- _debug("CellServ[%hu]: %08x", cell->vl_curr_svix, addr.s_addr);
+ _debug("CellServ[%hu]: %pIS", cell->vl_curr_svix, &addr->transport);
/* attempt to access the VL server */
- ret = afs_vl_get_entry_by_id(cell->net, &addr, key, volid,
+ ret = afs_vl_get_entry_by_id(cell->net, addr, key, volid,
voltype, vldb, false);
switch (ret) {
case 0:
@@ -192,15 +190,7 @@ static int afs_vlocation_update_record(struct afs_vlocation *vl,
int ret;
/* try to look up a cached volume in the cell VL databases by ID */
- _debug("Locally Cached: %s %02x { %08x(%x) %08x(%x) %08x(%x) }",
- vl->vldb.name,
- vl->vldb.vidmask,
- ntohl(vl->vldb.servers[0].s_addr),
- vl->vldb.srvtmask[0],
- ntohl(vl->vldb.servers[1].s_addr),
- vl->vldb.srvtmask[1],
- ntohl(vl->vldb.servers[2].s_addr),
- vl->vldb.srvtmask[2]);
+ _debug("Locally Cached: %s %02x", vl->vldb.name, vl->vldb.vidmask);
_debug("Vids: %08x %08x %08x",
vl->vldb.vid[0],
@@ -258,11 +248,7 @@ static int afs_vlocation_update_record(struct afs_vlocation *vl,
static void afs_vlocation_apply_update(struct afs_vlocation *vl,
struct afs_cache_vlocation *vldb)
{
- _debug("Done VL Lookup: %s %02x { %08x(%x) %08x(%x) %08x(%x) }",
- vldb->name, vldb->vidmask,
- ntohl(vldb->servers[0].s_addr), vldb->srvtmask[0],
- ntohl(vldb->servers[1].s_addr), vldb->srvtmask[1],
- ntohl(vldb->servers[2].s_addr), vldb->srvtmask[2]);
+ _debug("Done VL Lookup: %s %02x", vldb->name, vldb->vidmask);
_debug("Vids: %08x %08x %08x",
vldb->vid[0], vldb->vid[1], vldb->vid[2]);