Lines Matching refs:da
662 struct nfs4_pnfs_ds_addr *da = kzalloc(sizeof(*da), gfp_flags); in nfs4_pnfs_ds_addr_alloc() local
663 if (da) in nfs4_pnfs_ds_addr_alloc()
664 INIT_LIST_HEAD(&da->da_node); in nfs4_pnfs_ds_addr_alloc()
665 return da; in nfs4_pnfs_ds_addr_alloc()
668 static void nfs4_pnfs_ds_addr_free(struct nfs4_pnfs_ds_addr *da) in nfs4_pnfs_ds_addr_free() argument
670 kfree(da->da_remotestr); in nfs4_pnfs_ds_addr_free()
671 kfree(da->da_netid); in nfs4_pnfs_ds_addr_free()
672 kfree(da); in nfs4_pnfs_ds_addr_free()
677 struct nfs4_pnfs_ds_addr *da; in destroy_ds() local
686 da = list_first_entry(&ds->ds_addrs, in destroy_ds()
689 list_del_init(&da->da_node); in destroy_ds()
690 nfs4_pnfs_ds_addr_free(da); in destroy_ds()
715 struct nfs4_pnfs_ds_addr *da; in nfs4_pnfs_remotestr() local
721 list_for_each_entry(da, dsaddrs, da_node) { in nfs4_pnfs_remotestr()
722 len += strlen(da->da_remotestr) + 1; /* string plus comma */ in nfs4_pnfs_remotestr()
732 list_for_each_entry(da, dsaddrs, da_node) { in nfs4_pnfs_remotestr()
733 size_t ll = strlen(da->da_remotestr); in nfs4_pnfs_remotestr()
738 memcpy(p, da->da_remotestr, ll); in nfs4_pnfs_remotestr()
850 struct nfs4_pnfs_ds_addr *da; in _nfs4_pnfs_v3_ds_connect() local
858 list_for_each_entry(da, &ds->ds_addrs, da_node) { in _nfs4_pnfs_v3_ds_connect()
860 __func__, ds->ds_remotestr, da->da_remotestr); in _nfs4_pnfs_v3_ds_connect()
864 .ident = da->da_transport, in _nfs4_pnfs_v3_ds_connect()
866 .dstaddr = (struct sockaddr *)&da->da_addr, in _nfs4_pnfs_v3_ds_connect()
867 .addrlen = da->da_addrlen, in _nfs4_pnfs_v3_ds_connect()
871 if (da->da_transport != clp->cl_proto) in _nfs4_pnfs_v3_ds_connect()
873 if (da->da_addr.ss_family != clp->cl_addr.ss_family) in _nfs4_pnfs_v3_ds_connect()
881 (struct sockaddr *)&da->da_addr, in _nfs4_pnfs_v3_ds_connect()
882 da->da_addrlen, da->da_transport, in _nfs4_pnfs_v3_ds_connect()
909 struct nfs4_pnfs_ds_addr *da; in _nfs4_pnfs_v4_ds_connect() local
914 list_for_each_entry(da, &ds->ds_addrs, da_node) { in _nfs4_pnfs_v4_ds_connect()
916 __func__, ds->ds_remotestr, da->da_remotestr); in _nfs4_pnfs_v4_ds_connect()
920 .ident = da->da_transport, in _nfs4_pnfs_v4_ds_connect()
922 .dstaddr = (struct sockaddr *)&da->da_addr, in _nfs4_pnfs_v4_ds_connect()
923 .addrlen = da->da_addrlen, in _nfs4_pnfs_v4_ds_connect()
934 if (da->da_transport != clp->cl_proto) in _nfs4_pnfs_v4_ds_connect()
936 if (da->da_addr.ss_family != clp->cl_addr.ss_family) in _nfs4_pnfs_v4_ds_connect()
950 (struct sockaddr *)&da->da_addr, in _nfs4_pnfs_v4_ds_connect()
951 da->da_addrlen, in _nfs4_pnfs_v4_ds_connect()
952 da->da_transport, timeo, in _nfs4_pnfs_v4_ds_connect()
1041 struct nfs4_pnfs_ds_addr *da = NULL; in nfs4_decode_mp_ds_addr() local
1083 da = nfs4_pnfs_ds_addr_alloc(gfp_flags); in nfs4_decode_mp_ds_addr()
1084 if (unlikely(!da)) in nfs4_decode_mp_ds_addr()
1087 if (!rpc_pton(net, buf, portstr-buf, (struct sockaddr *)&da->da_addr, in nfs4_decode_mp_ds_addr()
1088 sizeof(da->da_addr))) { in nfs4_decode_mp_ds_addr()
1097 switch (da->da_addr.ss_family) { in nfs4_decode_mp_ds_addr()
1099 ((struct sockaddr_in *)&da->da_addr)->sin_port = port; in nfs4_decode_mp_ds_addr()
1100 da->da_addrlen = sizeof(struct sockaddr_in); in nfs4_decode_mp_ds_addr()
1104 ((struct sockaddr_in6 *)&da->da_addr)->sin6_port = port; in nfs4_decode_mp_ds_addr()
1105 da->da_addrlen = sizeof(struct sockaddr_in6); in nfs4_decode_mp_ds_addr()
1112 __func__, da->da_addr.ss_family); in nfs4_decode_mp_ds_addr()
1116 da->da_transport = xprt_find_transport_ident(netid); in nfs4_decode_mp_ds_addr()
1117 if (da->da_transport < 0) { in nfs4_decode_mp_ds_addr()
1123 da->da_netid = netid; in nfs4_decode_mp_ds_addr()
1127 da->da_remotestr = kzalloc(len, gfp_flags); in nfs4_decode_mp_ds_addr()
1130 if (da->da_remotestr) in nfs4_decode_mp_ds_addr()
1131 snprintf(da->da_remotestr, len, "%s%s%s:%u", startsep, in nfs4_decode_mp_ds_addr()
1134 dprintk("%s: Parsed DS addr %s\n", __func__, da->da_remotestr); in nfs4_decode_mp_ds_addr()
1136 return da; in nfs4_decode_mp_ds_addr()
1139 kfree(da); in nfs4_decode_mp_ds_addr()