net: sched: rename qdisc_destroy() to qdisc_put()
Current implementation of qdisc_destroy() decrements Qdisc reference counter and only actually destroy Qdisc if reference counter value reached zero. Rename qdisc_destroy() to qdisc_put() in order for it to better describe the way in which this function currently implemented and used. Extract code that deallocates Qdisc into new private qdisc_destroy() function. It is intended to be shared between regular qdisc_put() and its unlocked version that is introduced in next patch in this series. Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
6f99528e97
commit
86bd446b5c
@@ -40,7 +40,7 @@ static void mqprio_destroy(struct Qdisc *sch)
|
||||
for (ntx = 0;
|
||||
ntx < dev->num_tx_queues && priv->qdiscs[ntx];
|
||||
ntx++)
|
||||
qdisc_destroy(priv->qdiscs[ntx]);
|
||||
qdisc_put(priv->qdiscs[ntx]);
|
||||
kfree(priv->qdiscs);
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ static void mqprio_attach(struct Qdisc *sch)
|
||||
qdisc = priv->qdiscs[ntx];
|
||||
old = dev_graft_qdisc(qdisc->dev_queue, qdisc);
|
||||
if (old)
|
||||
qdisc_destroy(old);
|
||||
qdisc_put(old);
|
||||
if (ntx < dev->real_num_tx_queues)
|
||||
qdisc_hash_add(qdisc, false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user