Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292957
b: refs/heads/master
c: 1a8ef41
h: refs/heads/master
i:
  292955: ed31fde
v: v3
  • Loading branch information
Robert Love authored and James Bottomley committed Feb 19, 2012
1 parent 694f8d3 commit 5904052
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 47 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ccefd23ed2d683ad3c0282280e6e6d0b163ad041
refs/heads/master: 1a8ef414d97bf3f293e286f02002f8db768f9867
48 changes: 5 additions & 43 deletions trunk/drivers/scsi/fcoe/fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ static struct fcoe_interface *fcoe_interface_create(struct net_device *netdev,
}

dev_hold(netdev);
kref_init(&fcoe->kref);

/*
* Initialize FIP.
Expand All @@ -411,42 +410,6 @@ static struct fcoe_interface *fcoe_interface_create(struct net_device *netdev,
return fcoe;
}

/**
* fcoe_interface_release() - fcoe_port kref release function
* @kref: Embedded reference count in an fcoe_interface struct
*/
static void fcoe_interface_release(struct kref *kref)
{
struct fcoe_interface *fcoe;
struct net_device *netdev;

fcoe = container_of(kref, struct fcoe_interface, kref);
netdev = fcoe->netdev;
/* tear-down the FCoE controller */
fcoe_ctlr_destroy(&fcoe->ctlr);
kfree(fcoe);
dev_put(netdev);
module_put(THIS_MODULE);
}

/**
* fcoe_interface_get() - Get a reference to a FCoE interface
* @fcoe: The FCoE interface to be held
*/
static inline void fcoe_interface_get(struct fcoe_interface *fcoe)
{
kref_get(&fcoe->kref);
}

/**
* fcoe_interface_put() - Put a reference to a FCoE interface
* @fcoe: The FCoE interface to be released
*/
static inline void fcoe_interface_put(struct fcoe_interface *fcoe)
{
kref_put(&fcoe->kref, fcoe_interface_release);
}

/**
* fcoe_interface_cleanup() - Clean up a FCoE interface
* @fcoe: The FCoE interface to be cleaned up
Expand Down Expand Up @@ -494,7 +457,11 @@ static void fcoe_interface_cleanup(struct fcoe_interface *fcoe)
rtnl_unlock();

/* Release the self-reference taken during fcoe_interface_create() */
fcoe_interface_put(fcoe);
/* tear-down the FCoE controller */
fcoe_ctlr_destroy(fip);
kfree(fcoe);
dev_put(netdev);
module_put(THIS_MODULE);
}

/**
Expand Down Expand Up @@ -976,9 +943,6 @@ static void fcoe_if_destroy(struct fc_lport *lport)
dev_uc_del(netdev, port->data_src_addr);
rtnl_unlock();

/* Release reference held in fcoe_if_create() */
fcoe_interface_put(fcoe);

/* Free queued packets for the per-CPU receive threads */
fcoe_percpu_clean(lport);

Expand Down Expand Up @@ -1168,7 +1132,6 @@ static struct fc_lport *fcoe_if_create(struct fcoe_interface *fcoe,
goto out_lp_destroy;
}

fcoe_interface_get(fcoe);
return lport;

out_lp_destroy:
Expand Down Expand Up @@ -2113,7 +2076,6 @@ static void fcoe_destroy_work(struct work_struct *work)

fcoe = port->priv;
fcoe_if_destroy(port->lport);

fcoe_interface_cleanup(fcoe);

mutex_unlock(&fcoe_config_mutex);
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/scsi/fcoe/fcoe.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ do { \
* @ctlr: The FCoE controller (for FIP)
* @oem: The offload exchange manager for all local port
* instances associated with this port
* @kref: The kernel reference
*
* This structure is 1:1 with a net devive.
*/
struct fcoe_interface {
Expand All @@ -83,7 +81,6 @@ struct fcoe_interface {
struct packet_type fip_packet_type;
struct fcoe_ctlr ctlr;
struct fc_exch_mgr *oem;
struct kref kref;
};

#define fcoe_from_ctlr(fip) container_of(fip, struct fcoe_interface, ctlr)
Expand Down

0 comments on commit 5904052

Please sign in to comment.