diff options
Diffstat (limited to 'src/net')
| -rw-r--r-- | src/net/aoe.c | 2 | ||||
| -rw-r--r-- | src/net/dhcppkt.c | 1 | ||||
| -rw-r--r-- | src/net/infiniband/ib_cmrc.c | 1 | ||||
| -rw-r--r-- | src/net/netdevice.c | 2 | ||||
| -rw-r--r-- | src/net/tcp.c | 1 | ||||
| -rw-r--r-- | src/net/tcp/ftp.c | 2 | ||||
| -rw-r--r-- | src/net/tcp/http.c | 2 | ||||
| -rw-r--r-- | src/net/tcp/iscsi.c | 2 | ||||
| -rw-r--r-- | src/net/tls.c | 2 | ||||
| -rw-r--r-- | src/net/udp.c | 1 | ||||
| -rw-r--r-- | src/net/udp/dhcp.c | 4 | ||||
| -rw-r--r-- | src/net/udp/dns.c | 1 | ||||
| -rw-r--r-- | src/net/udp/slam.c | 2 | ||||
| -rw-r--r-- | src/net/udp/tftp.c | 2 |
14 files changed, 15 insertions, 10 deletions
diff --git a/src/net/aoe.c b/src/net/aoe.c index 497c12a02..80403db7a 100644 --- a/src/net/aoe.c +++ b/src/net/aoe.c @@ -438,7 +438,7 @@ int aoe_attach ( struct ata_device *ata, struct net_device *netdev, aoe = zalloc ( sizeof ( *aoe ) ); if ( ! aoe ) return -ENOMEM; - aoe->refcnt.free = aoe_free; + ref_init ( &aoe->refcnt, aoe_free ); aoe->netdev = netdev_get ( netdev ); memcpy ( aoe->target, netdev->ll_broadcast, sizeof ( aoe->target ) ); aoe->tag = AOE_TAG_MAGIC; diff --git a/src/net/dhcppkt.c b/src/net/dhcppkt.c index bc99401f2..b2a33363a 100644 --- a/src/net/dhcppkt.c +++ b/src/net/dhcppkt.c @@ -271,6 +271,7 @@ static struct settings_operations dhcppkt_settings_operations = { */ void dhcppkt_init ( struct dhcp_packet *dhcppkt, struct dhcphdr *data, size_t len ) { + ref_init ( &dhcppkt->refcnt, NULL ); dhcppkt->dhcphdr = data; dhcppkt->max_len = len; dhcpopt_init ( &dhcppkt->options, &dhcppkt->dhcphdr->options, diff --git a/src/net/infiniband/ib_cmrc.c b/src/net/infiniband/ib_cmrc.c index de19c51f7..b7b9cd819 100644 --- a/src/net/infiniband/ib_cmrc.c +++ b/src/net/infiniband/ib_cmrc.c @@ -383,6 +383,7 @@ int ib_cmrc_open ( struct xfer_interface *xfer, struct ib_device *ibdev, rc = -ENOMEM; goto err_alloc; } + ref_init ( &cmrc->refcnt, NULL ); xfer_init ( &cmrc->xfer, &ib_cmrc_xfer_operations, &cmrc->refcnt ); cmrc->ibdev = ibdev; memcpy ( &cmrc->dgid, dgid, sizeof ( cmrc->dgid ) ); diff --git a/src/net/netdevice.c b/src/net/netdevice.c index 6c91b4897..01fa1d55e 100644 --- a/src/net/netdevice.c +++ b/src/net/netdevice.c @@ -328,7 +328,7 @@ struct net_device * alloc_netdev ( size_t priv_size ) { total_len = ( sizeof ( *netdev ) + priv_size ); netdev = zalloc ( total_len ); if ( netdev ) { - netdev->refcnt.free = free_netdev; + ref_init ( &netdev->refcnt, free_netdev ); netdev->link_rc = -EUNKNOWN_LINK_STATUS; INIT_LIST_HEAD ( &netdev->tx_queue ); INIT_LIST_HEAD ( &netdev->rx_queue ); diff --git a/src/net/tcp.c b/src/net/tcp.c index b01345fa2..449f434ae 100644 --- a/src/net/tcp.c +++ b/src/net/tcp.c @@ -224,6 +224,7 @@ static int tcp_open ( struct xfer_interface *xfer, struct sockaddr *peer, if ( ! tcp ) return -ENOMEM; DBGC ( tcp, "TCP %p allocated\n", tcp ); + ref_init ( &tcp->refcnt, NULL ); xfer_init ( &tcp->xfer, &tcp_xfer_operations, &tcp->refcnt ); tcp->prev_tcp_state = TCP_CLOSED; tcp->tcp_state = TCP_STATE_SENT ( TCP_SYN ); diff --git a/src/net/tcp/ftp.c b/src/net/tcp/ftp.c index 3ef71b610..58794c8b2 100644 --- a/src/net/tcp/ftp.c +++ b/src/net/tcp/ftp.c @@ -491,7 +491,7 @@ static int ftp_open ( struct xfer_interface *xfer, struct uri *uri ) { ftp = zalloc ( sizeof ( *ftp ) ); if ( ! ftp ) return -ENOMEM; - ftp->refcnt.free = ftp_free; + ref_init ( &ftp->refcnt, ftp_free ); xfer_init ( &ftp->xfer, &ftp_xfer_operations, &ftp->refcnt ); ftp->uri = uri_get ( uri ); xfer_init ( &ftp->control, &ftp_control_operations, &ftp->refcnt ); diff --git a/src/net/tcp/http.c b/src/net/tcp/http.c index 5faffe99d..d6a9fad7e 100644 --- a/src/net/tcp/http.c +++ b/src/net/tcp/http.c @@ -547,7 +547,7 @@ int http_open_filter ( struct xfer_interface *xfer, struct uri *uri, http = zalloc ( sizeof ( *http ) ); if ( ! http ) return -ENOMEM; - http->refcnt.free = http_free; + ref_init ( &http->refcnt, http_free ); xfer_init ( &http->xfer, &http_xfer_operations, &http->refcnt ); http->uri = uri_get ( uri ); xfer_init ( &http->socket, &http_socket_operations, &http->refcnt ); diff --git a/src/net/tcp/iscsi.c b/src/net/tcp/iscsi.c index 69d185047..24cbda2c5 100644 --- a/src/net/tcp/iscsi.c +++ b/src/net/tcp/iscsi.c @@ -1792,7 +1792,7 @@ int iscsi_attach ( struct scsi_device *scsi, const char *root_path ) { iscsi = zalloc ( sizeof ( *iscsi ) ); if ( ! iscsi ) return -ENOMEM; - iscsi->refcnt.free = iscsi_free; + ref_init ( &iscsi->refcnt, iscsi_free ); xfer_init ( &iscsi->socket, &iscsi_socket_operations, &iscsi->refcnt ); process_init ( &iscsi->process, iscsi_tx_step, &iscsi->refcnt ); diff --git a/src/net/tls.c b/src/net/tls.c index 3c72b45c4..8825c5c13 100644 --- a/src/net/tls.c +++ b/src/net/tls.c @@ -1731,7 +1731,7 @@ int add_tls ( struct xfer_interface *xfer, struct xfer_interface **next ) { if ( ! tls ) return -ENOMEM; memset ( tls, 0, sizeof ( *tls ) ); - tls->refcnt.free = free_tls; + ref_init ( &tls->refcnt, free_tls ); filter_init ( &tls->plainstream, &tls_plainstream_operations, &tls->cipherstream, &tls_cipherstream_operations, &tls->refcnt ); diff --git a/src/net/udp.c b/src/net/udp.c index 1aa0e4968..dcc69c36c 100644 --- a/src/net/udp.c +++ b/src/net/udp.c @@ -110,6 +110,7 @@ static int udp_open_common ( struct xfer_interface *xfer, if ( ! udp ) return -ENOMEM; DBGC ( udp, "UDP %p allocated\n", udp ); + ref_init ( &udp->refcnt, NULL ); xfer_init ( &udp->xfer, &udp_xfer_operations, &udp->refcnt ); if ( st_peer ) memcpy ( &udp->peer, st_peer, sizeof ( udp->peer ) ); diff --git a/src/net/udp/dhcp.c b/src/net/udp/dhcp.c index 31e420c4f..33212b062 100644 --- a/src/net/udp/dhcp.c +++ b/src/net/udp/dhcp.c @@ -1439,7 +1439,7 @@ int start_dhcp ( struct job_interface *job, struct net_device *netdev ) { dhcp = zalloc ( sizeof ( *dhcp ) ); if ( ! dhcp ) return -ENOMEM; - dhcp->refcnt.free = dhcp_free; + ref_init ( &dhcp->refcnt, dhcp_free ); job_init ( &dhcp->job, &dhcp_job_operations, &dhcp->refcnt ); xfer_init ( &dhcp->xfer, &dhcp_xfer_operations, &dhcp->refcnt ); dhcp->netdev = netdev_get ( netdev ); @@ -1542,7 +1542,7 @@ int start_pxebs ( struct job_interface *job, struct net_device *netdev, sizeof ( *ip ) /* terminator */ ); if ( ! dhcp ) return -ENOMEM; - dhcp->refcnt.free = dhcp_free; + ref_init ( &dhcp->refcnt, dhcp_free ); job_init ( &dhcp->job, &dhcp_job_operations, &dhcp->refcnt ); xfer_init ( &dhcp->xfer, &dhcp_xfer_operations, &dhcp->refcnt ); dhcp->netdev = netdev_get ( netdev ); diff --git a/src/net/udp/dns.c b/src/net/udp/dns.c index db9c03622..47fc6c75a 100644 --- a/src/net/udp/dns.c +++ b/src/net/udp/dns.c @@ -503,6 +503,7 @@ static int dns_resolv ( struct resolv_interface *resolv, rc = -ENOMEM; goto err_alloc_dns; } + ref_init ( &dns->refcnt, NULL ); resolv_init ( &dns->resolv, &null_resolv_ops, &dns->refcnt ); xfer_init ( &dns->socket, &dns_socket_operations, &dns->refcnt ); dns->timer.expired = dns_timer_expired; diff --git a/src/net/udp/slam.c b/src/net/udp/slam.c index aa15933ec..3f0b0e2ea 100644 --- a/src/net/udp/slam.c +++ b/src/net/udp/slam.c @@ -748,7 +748,7 @@ static int slam_open ( struct xfer_interface *xfer, struct uri *uri ) { slam = zalloc ( sizeof ( *slam ) ); if ( ! slam ) return -ENOMEM; - slam->refcnt.free = slam_free; + ref_init ( &slam->refcnt, slam_free ); xfer_init ( &slam->xfer, &slam_xfer_operations, &slam->refcnt ); xfer_init ( &slam->socket, &slam_socket_operations, &slam->refcnt ); xfer_init ( &slam->mc_socket, &slam_mc_socket_operations, diff --git a/src/net/udp/tftp.c b/src/net/udp/tftp.c index d49f4256c..49c857fbf 100644 --- a/src/net/udp/tftp.c +++ b/src/net/udp/tftp.c @@ -1134,7 +1134,7 @@ static int tftp_core_open ( struct xfer_interface *xfer, struct uri *uri, tftp = zalloc ( sizeof ( *tftp ) ); if ( ! tftp ) return -ENOMEM; - tftp->refcnt.free = tftp_free; + ref_init ( &tftp->refcnt, tftp_free ); xfer_init ( &tftp->xfer, &tftp_xfer_operations, &tftp->refcnt ); tftp->uri = uri_get ( uri ); xfer_init ( &tftp->socket, &tftp_socket_operations, &tftp->refcnt ); |
