/* "show" function for the bond_masters attribute. The class parameter is ignored.  */
static ssize_t bonding_show_bonds(struct class *cls, char *buf)
/* "show" function for the bond_masters attribute. The class parameter is ignored.  */
static ssize_t bonding_show_bonds(struct class *cls, char *buf)
{
	struct net *net = current->nsproxy->net_ns;
	struct bond_net *bn = net_generic(net, bond_net_id);
	int res = 0;
	struct bonding *bond;
	rtnl_lock();
	list_for_each_entry(bond, &bn->dev_list, bond_list) {
		if (res > (PAGE_SIZE - IFNAMSIZ)) {
			if ((PAGE_SIZE - res) > 10)
				res = PAGE_SIZE - 10;
			res += sprintf(buf + res, "++more++ ");
			break;
		}
		res += sprintf(buf + res, "%s ", bond->dev->name);
	}
	if (res)
		buf[res-1] = '\n';
	rtnl_unlock();
	return res;
}