Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 690486 | Differences between
and this patch

Collapse All | Expand All

(-)a/devlink/devlink.c (-9 / +7 lines)
Lines 25-31 Link Here
25
#include <linux/devlink.h>
25
#include <linux/devlink.h>
26
#include <libmnl/libmnl.h>
26
#include <libmnl/libmnl.h>
27
#include <netinet/ether.h>
27
#include <netinet/ether.h>
28
#include <sys/queue.h>
29
28
30
#include "SNAPSHOT.h"
29
#include "SNAPSHOT.h"
31
#include "list.h"
30
#include "list.h"
Lines 5981-5993 static int fmsg_value_show(struct dl *dl, int type, struct nlattr *nl_data) Link Here
5981
5980
5982
struct nest_qentry {
5981
struct nest_qentry {
5983
	int attr_type;
5982
	int attr_type;
5984
	TAILQ_ENTRY(nest_qentry) nest_entries;
5983
	struct list_head nest_entries;
5985
};
5984
};
5986
5985
5987
struct fmsg_cb_data {
5986
struct fmsg_cb_data {
5988
	struct dl *dl;
5987
	struct dl *dl;
5989
	uint8_t value_type;
5988
	uint8_t value_type;
5990
	TAILQ_HEAD(, nest_qentry) qhead;
5989
	struct list_head qhead;
5991
};
5990
};
5992
5991
5993
static int cmd_fmsg_nest_queue(struct fmsg_cb_data *fmsg_data,
5992
static int cmd_fmsg_nest_queue(struct fmsg_cb_data *fmsg_data,
Lines 6001-6013 static int cmd_fmsg_nest_queue(struct fmsg_cb_data *fmsg_data, Link Here
6001
			return -ENOMEM;
6000
			return -ENOMEM;
6002
6001
6003
		entry->attr_type = *attr_value;
6002
		entry->attr_type = *attr_value;
6004
		TAILQ_INSERT_HEAD(&fmsg_data->qhead, entry, nest_entries);
6003
		list_add(&fmsg_data->qhead, &entry->nest_entries);
6005
	} else {
6004
	} else {
6006
		if (TAILQ_EMPTY(&fmsg_data->qhead))
6005
		if (list_empty(&fmsg_data->qhead))
6007
			return MNL_CB_ERROR;
6006
			return MNL_CB_ERROR;
6008
		entry = TAILQ_FIRST(&fmsg_data->qhead);
6007
		entry = list_first_entry(&fmsg_data->qhead, struct nest_qentry, nest_entries);
6009
		*attr_value = entry->attr_type;
6008
		*attr_value = entry->attr_type;
6010
		TAILQ_REMOVE(&fmsg_data->qhead, entry, nest_entries);
6009
		list_del(&entry->nest_entries);
6011
		free(entry);
6010
		free(entry);
6012
	}
6011
	}
6013
	return MNL_CB_OK;
6012
	return MNL_CB_OK;
Lines 6116-6122 static int cmd_health_object_common(struct dl *dl, uint8_t cmd, uint16_t flags) Link Here
6116
		return err;
6115
		return err;
6117
6116
6118
	data.dl = dl;
6117
	data.dl = dl;
6119
	TAILQ_INIT(&data.qhead);
6118
	INIT_LIST_HEAD(&data.qhead);
6120
	err = _mnlg_socket_sndrcv(dl->nlg, nlh, cmd_fmsg_object_cb, &data);
6119
	err = _mnlg_socket_sndrcv(dl->nlg, nlh, cmd_fmsg_object_cb, &data);
6121
	return err;
6120
	return err;
6122
}
6121
}
6123
- 

Return to bug 690486