#define DEBUG_SUBSYSTEM S_CLASS
+#include <linux/obd_support.h>
#include <linux/lustre_net.h>
int lustre_pack_msg(int count, int *lens, char **bufs, int *len,
m->status = NTOH__u32(m->status);
m->type = NTOH__u32(m->type);
m->bufcount = NTOH__u32(m->bufcount);
- m->last_rcvd = NTOH__u64(m->last_rcvd);
+ m->last_xid = NTOH__u64(m->last_xid);
m->last_committed = NTOH__u64(m->last_committed);
- m->target_id = NTOH__u32(m->target_id);
required_len = size_round(sizeof(*m) + m->bufcount * sizeof(__u32));
if (len < required_len)
{
int i, offset;
+ if (!m) {
+ CERROR("no message buffer!\n");
+ LBUG();
+ return NULL;
+ }
+
if (n < 0 || n >= m->bufcount) {
- CERROR("referencing bad sub buffer!\n");
+ CERROR("referencing bad sub buffer (want %d, count is %d)!\n",
+ n, m->bufcount);
LBUG();
return NULL;
}
- if (m->buflens[n] == 0)
+ if (m->buflens[n] == 0) {
+ CERROR("zero-length buffer requested for buffer %d\n", n);
return NULL;
+ }
offset = size_round(sizeof(*m) + m->bufcount * sizeof(__u32));