netpoll: Remove gfp parameter from __netpoll_setup
The gfp parameter was added in: commit47be03a28c
Author: Amerigo Wang <amwang@redhat.com> Date: Fri Aug 10 01:24:37 2012 +0000 netpoll: use GFP_ATOMIC in slave_enable_netpoll() and __netpoll_setup() slave_enable_netpoll() and __netpoll_setup() may be called with read_lock() held, so should use GFP_ATOMIC to allocate memory. Eric suggested to pass gfp flags to __netpoll_setup(). Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: "David S. Miller" <davem@davemloft.net> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> The reason for the gfp parameter was removed in: commitc4cdef9b71
Author: dingtianhong <dingtianhong@huawei.com> Date: Tue Jul 23 15:25:27 2013 +0800 bonding: don't call slave_xxx_netpoll under spinlocks The slave_xxx_netpoll will call synchronize_rcu_bh(), so the function may schedule and sleep, it should't be called under spinlocks. bond_netpoll_setup() and bond_netpoll_cleanup() are always protected by rtnl lock, it is no need to take the read lock, as the slave list couldn't be changed outside rtnl lock. Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Cc: Jay Vosburgh <fubar@us.ibm.com> Cc: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: David S. Miller <davem@davemloft.net> Nothing else that calls __netpoll_setup or ndo_netpoll_setup requires a gfp paramter, so remove the gfp parameter from both of these functions making the code clearer. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
3f705f73a0
commit
a8779ec1c5
@@ -1031,8 +1031,7 @@ static void team_port_leave(struct team *team, struct team_port *port)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
static int team_port_enable_netpoll(struct team *team, struct team_port *port,
|
||||
gfp_t gfp)
|
||||
static int team_port_enable_netpoll(struct team *team, struct team_port *port)
|
||||
{
|
||||
struct netpoll *np;
|
||||
int err;
|
||||
@@ -1040,11 +1039,11 @@ static int team_port_enable_netpoll(struct team *team, struct team_port *port,
|
||||
if (!team->dev->npinfo)
|
||||
return 0;
|
||||
|
||||
np = kzalloc(sizeof(*np), gfp);
|
||||
np = kzalloc(sizeof(*np), GFP_KERNEL);
|
||||
if (!np)
|
||||
return -ENOMEM;
|
||||
|
||||
err = __netpoll_setup(np, port->dev, gfp);
|
||||
err = __netpoll_setup(np, port->dev);
|
||||
if (err) {
|
||||
kfree(np);
|
||||
return err;
|
||||
@@ -1067,8 +1066,7 @@ static void team_port_disable_netpoll(struct team_port *port)
|
||||
kfree(np);
|
||||
}
|
||||
#else
|
||||
static int team_port_enable_netpoll(struct team *team, struct team_port *port,
|
||||
gfp_t gfp)
|
||||
static int team_port_enable_netpoll(struct team *team, struct team_port *port)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1156,7 +1154,7 @@ static int team_port_add(struct team *team, struct net_device *port_dev)
|
||||
goto err_vids_add;
|
||||
}
|
||||
|
||||
err = team_port_enable_netpoll(team, port, GFP_KERNEL);
|
||||
err = team_port_enable_netpoll(team, port);
|
||||
if (err) {
|
||||
netdev_err(dev, "Failed to enable netpoll on device %s\n",
|
||||
portname);
|
||||
@@ -1850,7 +1848,7 @@ static void team_netpoll_cleanup(struct net_device *dev)
|
||||
}
|
||||
|
||||
static int team_netpoll_setup(struct net_device *dev,
|
||||
struct netpoll_info *npifo, gfp_t gfp)
|
||||
struct netpoll_info *npifo)
|
||||
{
|
||||
struct team *team = netdev_priv(dev);
|
||||
struct team_port *port;
|
||||
@@ -1858,7 +1856,7 @@ static int team_netpoll_setup(struct net_device *dev,
|
||||
|
||||
mutex_lock(&team->lock);
|
||||
list_for_each_entry(port, &team->port_list, list) {
|
||||
err = team_port_enable_netpoll(team, port, gfp);
|
||||
err = team_port_enable_netpoll(team, port);
|
||||
if (err) {
|
||||
__team_netpoll_cleanup(team);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user