m4_define([LUSTRE_MAJOR],[1])
-m4_define([LUSTRE_MINOR],[7])
-m4_define([LUSTRE_PATCH],[91])
+m4_define([LUSTRE_MINOR],[9])
+m4_define([LUSTRE_PATCH],[50])
m4_define([LUSTRE_FIX],[0])
dnl # liblustre delta is 0.0.1.32 , next version with fixes is ok, but
tgt->cookie = src->cookie;
}
-/* we depend on this structure to be 8-byte aligned */
-/* this type is only endian-adjusted in lustre_unpack_msg() */
-struct lustre_msg_v1 {
- struct lustre_handle lm_handle;
- __u32 lm_magic;
- __u32 lm_type;
- __u32 lm_version;
- __u32 lm_opc;
- __u64 lm_last_xid;
- __u64 lm_last_committed;
- __u64 lm_transno;
- __u32 lm_status;
- __u32 lm_flags;
- __u32 lm_conn_cnt;
- __u32 lm_bufcount;
- __u32 lm_buflens[0];
-};
-
#define lustre_msg lustre_msg_v2
/* we depend on this structure to be 8-byte aligned */
/* this type is only endian-adjusted in lustre_unpack_msg() */
int lustre_msg_size_v2(int count, int *lengths);
int lustre_packed_msg_size(struct lustre_msg *msg);
int lustre_unpack_msg(struct lustre_msg *m, int len);
-void *lustre_msg_buf_v1(void *msg, int n, int min_size);
void *lustre_msg_buf_v2(struct lustre_msg_v2 *m, int n, int min_size);
void *lustre_msg_buf(struct lustre_msg *m, int n, int minlen);
int lustre_msg_buflen(struct lustre_msg *m, int n);
static inline int ptlrpc_req_get_repsize(struct ptlrpc_request *req)
{
switch (req->rq_reqmsg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- CERROR("function not supported for lustre_msg V1!\n");
- return -ENOTSUPP;
case LUSTRE_MSG_MAGIC_V2:
return req->rq_reqmsg->lm_repsize;
default:
revimp->imp_remote_handle = conn;
revimp->imp_dlm_fake = 1;
revimp->imp_state = LUSTRE_IMP_FULL;
-
- if (req->rq_reqmsg->lm_magic == LUSTRE_MSG_MAGIC_V1 &&
- lustre_msg_get_op_flags(req->rq_reqmsg) & MSG_CONNECT_NEXT_VER) {
- revimp->imp_msg_magic = LUSTRE_MSG_MAGIC_V2;
- lustre_msg_add_op_flags(req->rq_repmsg, MSG_CONNECT_NEXT_VER);
- } else {
- /* unknown magic has been filtered out by unpack */
- revimp->imp_msg_magic = req->rq_reqmsg->lm_magic;
- }
+ revimp->imp_msg_magic = req->rq_reqmsg->lm_magic;
rc = sptlrpc_import_sec_adapt(revimp, req->rq_svc_ctx,
req->rq_flvr.sf_rpc);
if (size < 0)
return size;
- if (magic == LUSTRE_MSG_MAGIC_V1)
- i++;
-
for (; i < fmt->rf_fields[loc].nr; ++i)
if (fmt->rf_fields[loc].d[i]->rmf_size != -1)
size += size_round(fmt->rf_fields[loc].d[i]->rmf_size);
#include <obd_class.h>
#include <lustre_net.h>
-#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(1,8,0,0)
-#error "lustre_msg_v1 has been deprecated since 1.6.0, please remove it"
-#elif LUSTRE_VERSION_CODE > OBD_OCD_VERSION(1,6,50,0)
-#warning "lustre_msg_v1 has been deprecated since 1.6.0, consider removing it"
-#endif
-
-static inline int lustre_msg_hdr_size_v1(int count)
-{
- return size_round(offsetof(struct lustre_msg_v1, lm_buflens[count]));
-}
-
static inline int lustre_msg_hdr_size_v2(int count)
{
return size_round(offsetof(struct lustre_msg_v2, lm_buflens[count]));
int lustre_msg_hdr_size(__u32 magic, int count)
{
switch (magic) {
- case LUSTRE_MSG_MAGIC_V1:
- return lustre_msg_hdr_size_v1(count - 1);
case LUSTRE_MSG_MAGIC_V2:
return lustre_msg_hdr_size_v2(count);
default:
int lustre_msg_swabbed(struct lustre_msg *msg)
{
- return (msg->lm_magic == LUSTRE_MSG_MAGIC_V1_SWABBED) ||
- (msg->lm_magic == LUSTRE_MSG_MAGIC_V2_SWABBED);
+ return (msg->lm_magic == LUSTRE_MSG_MAGIC_V2_SWABBED);
}
static inline int
switch (msg->lm_magic) {
case LUSTRE_MSG_MAGIC_V1:
case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return 0;
+ CERROR("msg v1 not supported - please upgrade you system\n");
+ return -EINVAL;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED:
return lustre_msg_check_version_v2(msg, version);
}
}
-static inline int lustre_msg_size_v1(int count, int *lengths)
-{
- int size;
- int i;
-
- LASSERT(count >= 0);
- size = lustre_msg_hdr_size_v1(count);
- for (i = 0; i < count; i++)
- size += size_round(lengths[i]);
-
- return size;
-}
-
int lustre_msg_size_v2(int count, int *lengths)
{
int size;
LASSERT(lens[MSG_PTLRPC_BODY_OFF] == sizeof(struct ptlrpc_body));
switch (magic) {
- case LUSTRE_MSG_MAGIC_V1:
- return lustre_msg_size_v1(count - 1, lens + 1);
case LUSTRE_MSG_MAGIC_V2:
return lustre_msg_size_v2(count, lens);
default:
int lustre_packed_msg_size(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1: {
- struct lustre_msg_v1 *v1_msg = (struct lustre_msg_v1 *)msg;
- return lustre_msg_size_v1(v1_msg->lm_bufcount,
- v1_msg->lm_buflens);
- }
case LUSTRE_MSG_MAGIC_V2:
return lustre_msg_size_v2(msg->lm_bufcount, msg->lm_buflens);
default:
}
}
-static
-void lustre_init_msg_v1(void *m, int count, int *lens, char **bufs)
-{
- struct lustre_msg_v1 *msg = (struct lustre_msg_v1 *)m;
- char *ptr;
- int i;
-
- LASSERT(count >= 0);
- msg->lm_magic = LUSTRE_MSG_MAGIC_V1;
- msg->lm_version = PTLRPC_MSG_VERSION;
- msg->lm_bufcount = count;
-
- for (i = 0; i < count; i++)
- msg->lm_buflens[i] = lens[i];
-
- if (bufs == NULL)
- return;
-
- ptr = (char *)msg + lustre_msg_hdr_size_v1(count);
- for (i = 0; i < count; i++) {
- char *tmp = bufs[i];
- LOGL(tmp, lens[i], ptr);
- }
-}
-
void lustre_init_msg_v2(struct lustre_msg_v2 *msg, int count, int *lens,
char **bufs)
{
}
EXPORT_SYMBOL(lustre_init_msg_v2);
-static int lustre_pack_request_v1(struct ptlrpc_request *req,
- int count, int *lens, char **bufs)
-{
- int reqlen, rc;
-
- reqlen = lustre_msg_size_v1(count, lens);
-
- rc = sptlrpc_cli_alloc_reqbuf(req, reqlen);
- if (rc)
- return rc;
-
- req->rq_reqlen = reqlen;
-
- lustre_init_msg_v1(req->rq_reqmsg, count, lens, bufs);
- return 0;
-}
-
static int lustre_pack_request_v2(struct ptlrpc_request *req,
int count, int *lens, char **bufs)
{
magic = LUSTRE_MSG_MAGIC_V2;
switch (magic) {
- case LUSTRE_MSG_MAGIC_V1:
- return lustre_pack_request_v1(req, count - 1, lens + 1,
- bufs ? bufs + 1 : NULL);
case LUSTRE_MSG_MAGIC_V2:
return lustre_pack_request_v2(req, count, lens, bufs);
default:
cfs_waitq_signal(&svc->srv_free_rs_waitq);
}
-static int lustre_pack_reply_v1(struct ptlrpc_request *req, int count,
- int *lens, char **bufs)
-{
- struct ptlrpc_reply_state *rs;
- int msg_len, rc;
- ENTRY;
-
- LASSERT (req->rq_reply_state == NULL);
-
- msg_len = lustre_msg_size_v1(count, lens);
- rc = sptlrpc_svc_alloc_rs(req, msg_len);
- if (rc)
- RETURN(rc);
-
- rs = req->rq_reply_state;
- atomic_set(&rs->rs_refcount, 1); /* 1 ref for rq_reply_state */
- rs->rs_cb_id.cbid_fn = reply_out_callback;
- rs->rs_cb_id.cbid_arg = rs;
- rs->rs_service = req->rq_rqbd->rqbd_service;
- CFS_INIT_LIST_HEAD(&rs->rs_exp_list);
- CFS_INIT_LIST_HEAD(&rs->rs_obd_list);
-
- req->rq_replen = msg_len;
- req->rq_reply_state = rs;
- req->rq_repmsg = rs->rs_msg;
- lustre_init_msg_v1(rs->rs_msg, count, lens, bufs);
-
- PTLRPC_RS_DEBUG_LRU_ADD(rs);
-
- RETURN (0);
-}
-
int lustre_pack_reply_v2(struct ptlrpc_request *req, int count,
int *lens, char **bufs)
{
LASSERT(lens[MSG_PTLRPC_BODY_OFF] == sizeof(struct ptlrpc_body));
switch (req->rq_reqmsg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- rc = lustre_pack_reply_v1(req, count - 1, lens + 1,
- bufs ? bufs + 1 : NULL);
- break;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED:
rc = lustre_pack_reply_v2(req, count, lens, bufs);
return rc;
}
-void *lustre_msg_buf_v1(void *msg, int n, int min_size)
-{
- struct lustre_msg_v1 *m = (struct lustre_msg_v1 *)msg;
- int i, offset, buflen, bufcount;
-
- LASSERT(m != NULL);
- LASSERT(n >= 0);
-
- bufcount = m->lm_bufcount;
- if (unlikely(n >= bufcount)) {
- CDEBUG(D_INFO, "msg %p buffer[%d] not present (count %d)\n",
- m, n, bufcount);
- return NULL;
- }
-
- buflen = m->lm_buflens[n];
- if (unlikely(buflen < min_size)) {
- CERROR("msg %p buffer[%d] size %d too small (required %d)\n",
- m, n, buflen, min_size);
- LBUG();
- return NULL;
- }
-
- offset = lustre_msg_hdr_size_v1(bufcount);
- for (i = 0; i < n; i++)
- offset += size_round(m->lm_buflens[i]);
-
- return (char *)m + offset;
-}
-
void *lustre_msg_buf_v2(struct lustre_msg_v2 *m, int n, int min_size)
{
int i, offset, buflen, bufcount;
void *lustre_msg_buf(struct lustre_msg *m, int n, int min_size)
{
switch (m->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return lustre_msg_buf_v1(m, n - 1, min_size);
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED:
return lustre_msg_buf_v2(m, n, min_size);
}
}
-int lustre_shrink_msg_v1(struct lustre_msg_v1 *msg, int segment,
- unsigned int newlen, int move_data)
-{
- char *tail = NULL, *newpos;
- int tail_len = 0, n;
-
- LASSERT(msg);
- LASSERT(segment >= 0);
- LASSERT(msg->lm_bufcount > segment);
- LASSERT(msg->lm_buflens[segment] >= newlen);
-
- if (msg->lm_buflens[segment] == newlen)
- goto out;
-
- if (move_data && msg->lm_bufcount > segment + 1) {
- tail = lustre_msg_buf_v1(msg, segment + 1, 0);
- for (n = segment + 1; n < msg->lm_bufcount; n++)
- tail_len += size_round(msg->lm_buflens[n]);
- }
-
- msg->lm_buflens[segment] = newlen;
-
- if (tail && tail_len) {
- newpos = lustre_msg_buf_v1(msg, segment + 1, 0);
- LASSERT(newpos <= tail);
- if (newpos != tail)
- memcpy(newpos, tail, tail_len);
- }
-
- if (newlen == 0 && msg->lm_bufcount > segment + 1) {
- memmove(&msg->lm_buflens[segment], &msg->lm_buflens[segment + 1],
- (msg->lm_bufcount - segment - 1) * sizeof(__u32));
- msg->lm_buflens[msg->lm_bufcount - 1] = 0;
- }
-
-out:
- return lustre_msg_size_v1(msg->lm_bufcount, (int *)msg->lm_buflens);
-}
-
int lustre_shrink_msg_v2(struct lustre_msg_v2 *msg, int segment,
unsigned int newlen, int move_data)
{
unsigned int newlen, int move_data)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- return lustre_shrink_msg_v1((struct lustre_msg_v1 *) msg,
- segment - 1, newlen, move_data);
case LUSTRE_MSG_MAGIC_V2:
return lustre_shrink_msg_v2(msg, segment, newlen, move_data);
default:
sptlrpc_svc_free_rs(rs);
}
-int lustre_unpack_msg_v1(void *msg, int len)
-{
- struct lustre_msg_v1 *m = (struct lustre_msg_v1 *)msg;
- int flipped, required_len, i;
- ENTRY;
-
- /* Now we know the sender speaks my language. */
- required_len = lustre_msg_hdr_size_v1(0);
- if (len < required_len) {
- /* can't even look inside the message */
- CERROR("message length %d too small for lustre_msg\n", len);
- RETURN(-EINVAL);
- }
-
- flipped = lustre_msg_swabbed((struct lustre_msg *)m);
-
- if (flipped) {
- __swab32s(&m->lm_type);
- __swab32s(&m->lm_version);
- __swab32s(&m->lm_opc);
- __swab64s(&m->lm_last_xid);
- __swab64s(&m->lm_last_committed);
- __swab64s(&m->lm_transno);
- __swab32s(&m->lm_status);
- __swab32s(&m->lm_flags);
- __swab32s(&m->lm_conn_cnt);
- __swab32s(&m->lm_bufcount);
- }
-
- if (m->lm_version != PTLRPC_MSG_VERSION) {
- CERROR("wrong lustre_msg version %08x\n", m->lm_version);
- RETURN(-EINVAL);
- }
-
- required_len = lustre_msg_hdr_size_v1(m->lm_bufcount);
- if (len < required_len) {
- /* didn't receive all the buffer lengths */
- CERROR("message length %d too small for %d buflens\n",
- len, m->lm_bufcount);
- RETURN(-EINVAL);
- }
-
- for (i = 0; i < m->lm_bufcount; i++) {
- if (flipped)
- __swab32s (&m->lm_buflens[i]);
- required_len += size_round(m->lm_buflens[i]);
- }
-
- if (len < required_len) {
- CERROR("len: %d, required_len %d\n", len, required_len);
- CERROR("bufcount: %d\n", m->lm_bufcount);
- for (i = 0; i < m->lm_bufcount; i++)
- CERROR("buffer %d length %d\n", i, m->lm_buflens[i]);
- RETURN(-EINVAL);
- }
-
- RETURN(0);
-}
-
static int lustre_unpack_msg_v2(struct lustre_msg_v2 *m, int len)
{
int flipped, required_len, i;
}
switch (m->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- rc = lustre_unpack_msg_v1(m, len);
- break;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED:
rc = lustre_unpack_msg_v2(m, len);
int lustre_unpack_req_ptlrpc_body(struct ptlrpc_request *req, int offset)
{
switch (req->rq_reqmsg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return 0;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED:
lustre_set_req_swabbed(req, offset);
int lustre_unpack_rep_ptlrpc_body(struct ptlrpc_request *req, int offset)
{
switch (req->rq_repmsg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return 0;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED:
lustre_set_rep_swabbed(req, offset);
}
}
-static inline int lustre_msg_buflen_v1(void *msg, int n)
-{
- struct lustre_msg_v1 *m = (struct lustre_msg_v1 *)msg;
-
- LASSERT(n >= 0);
- if (n >= m->lm_bufcount)
- return 0;
-
- return m->lm_buflens[n];
-}
-
static inline int lustre_msg_buflen_v2(struct lustre_msg_v2 *m, int n)
{
if (n >= m->lm_bufcount)
int lustre_msg_buflen(struct lustre_msg *m, int n)
{
switch (m->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return lustre_msg_buflen_v1(m, n - 1);
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED:
return lustre_msg_buflen_v2(m, n);
}
EXPORT_SYMBOL(lustre_msg_buflen);
-static inline void lustre_msg_set_buflen_v1(void *msg, int n, int len)
-{
- struct lustre_msg_v1 *m = (struct lustre_msg_v1 *)msg;
-
- LASSERT(n >= 0);
- if (n >= m->lm_bufcount)
- LBUG();
-
- m->lm_buflens[n] = len;
-}
-
static inline void
lustre_msg_set_buflen_v2(struct lustre_msg_v2 *m, int n, int len)
{
void lustre_msg_set_buflen(struct lustre_msg *m, int n, int len)
{
switch (m->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- lustre_msg_set_buflen_v1(m, n - 1, len);
- return;
case LUSTRE_MSG_MAGIC_V2:
lustre_msg_set_buflen_v2(m, n, len);
return;
int lustre_msg_bufcount(struct lustre_msg *m)
{
switch (m->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return ((struct lustre_msg_v1 *)m)->lm_bufcount + 1;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED:
return m->lm_bufcount;
int slen, blen;
switch (m->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- str = lustre_msg_buf_v1(m, index - 1, 0);
- blen = lustre_msg_buflen_v1(m, index - 1);
- break;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED:
str = lustre_msg_buf_v2(m, index, 0);
void *ptr = NULL;
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- ptr = lustre_msg_buf_v1(msg, index - 1, min_size);
- break;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED:
ptr = lustre_msg_buf_v2(msg, index, min_size);
__u32 lustre_msg_get_flags(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return ((struct lustre_msg_v1 *)msg)->lm_flags &
- MSG_GEN_FLAG_MASK;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED: {
struct ptlrpc_body *pb;
void lustre_msg_add_flags(struct lustre_msg *msg, int flags)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- ((struct lustre_msg_v1 *)msg)->lm_flags |=
- MSG_GEN_FLAG_MASK & flags;
- return;
case LUSTRE_MSG_MAGIC_V2: {
struct ptlrpc_body *pb;
void lustre_msg_set_flags(struct lustre_msg *msg, int flags)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- ((struct lustre_msg_v1 *)msg)->lm_flags &= ~MSG_GEN_FLAG_MASK;
- ((struct lustre_msg_v1 *)msg)->lm_flags |=
- MSG_GEN_FLAG_MASK & flags;
- return;
case LUSTRE_MSG_MAGIC_V2: {
struct ptlrpc_body *pb;
void lustre_msg_clear_flags(struct lustre_msg *msg, int flags)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- ((struct lustre_msg_v1 *)msg)->lm_flags &=
- ~(MSG_GEN_FLAG_MASK & flags);
- return;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED: {
struct ptlrpc_body *pb;
__u32 lustre_msg_get_op_flags(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return ((struct lustre_msg_v1 *)msg)->lm_flags >>
- MSG_OP_FLAG_SHIFT;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED: {
struct ptlrpc_body *pb;
void lustre_msg_add_op_flags(struct lustre_msg *msg, int flags)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- ((struct lustre_msg_v1 *)msg)->lm_flags |=
- (flags & MSG_GEN_FLAG_MASK) << MSG_OP_FLAG_SHIFT;
- return;
case LUSTRE_MSG_MAGIC_V2: {
struct ptlrpc_body *pb;
void lustre_msg_set_op_flags(struct lustre_msg *msg, int flags)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- ((struct lustre_msg_v1 *)msg)->lm_flags &= ~MSG_OP_FLAG_MASK;
- ((struct lustre_msg_v1 *)msg)->lm_flags |=
- ((flags & MSG_GEN_FLAG_MASK) <<MSG_OP_FLAG_SHIFT);
- return;
case LUSTRE_MSG_MAGIC_V2: {
struct ptlrpc_body *pb;
struct lustre_handle *lustre_msg_get_handle(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return &((struct lustre_msg_v1 *)msg)->lm_handle;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED: {
struct ptlrpc_body *pb;
__u32 lustre_msg_get_type(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return ((struct lustre_msg_v1 *)msg)->lm_type;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED: {
struct ptlrpc_body *pb;
__u32 lustre_msg_get_version(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return ((struct lustre_msg_v1 *)msg)->lm_version;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED: {
struct ptlrpc_body *pb;
void lustre_msg_add_version(struct lustre_msg *msg, int version)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED: {
struct ptlrpc_body *pb;
__u32 lustre_msg_get_opc(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return ((struct lustre_msg_v1 *)msg)->lm_opc;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED: {
struct ptlrpc_body *pb;
__u64 lustre_msg_get_last_xid(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return ((struct lustre_msg_v1 *)msg)->lm_last_xid;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED: {
struct ptlrpc_body *pb;
__u64 lustre_msg_get_last_committed(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return ((struct lustre_msg_v1 *)msg)->lm_last_committed;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED: {
struct ptlrpc_body *pb;
__u64 lustre_msg_get_transno(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return ((struct lustre_msg_v1 *)msg)->lm_transno;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED: {
struct ptlrpc_body *pb;
int lustre_msg_get_status(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return ((struct lustre_msg_v1 *)msg)->lm_status;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED: {
struct ptlrpc_body *pb;
__u64 lustre_msg_get_slv(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return 1;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED: {
struct ptlrpc_body *pb;
void lustre_msg_set_slv(struct lustre_msg *msg, __u64 slv)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED: {
struct ptlrpc_body *pb;
__u32 lustre_msg_get_limit(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return 1;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED: {
struct ptlrpc_body *pb;
void lustre_msg_set_limit(struct lustre_msg *msg, __u64 limit)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED: {
struct ptlrpc_body *pb;
__u32 lustre_msg_get_conn_cnt(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return ((struct lustre_msg_v1 *)msg)->lm_conn_cnt;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED: {
struct ptlrpc_body *pb;
__u32 lustre_msg_get_magic(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED:
return msg->lm_magic;
void lustre_msg_set_handle(struct lustre_msg *msg, struct lustre_handle *handle)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- ((struct lustre_msg_v1 *)msg)->lm_handle = *handle;
- return;
case LUSTRE_MSG_MAGIC_V2: {
struct ptlrpc_body *pb;
void lustre_msg_set_type(struct lustre_msg *msg, __u32 type)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- ((struct lustre_msg_v1 *)msg)->lm_type = type;
- return;
case LUSTRE_MSG_MAGIC_V2: {
struct ptlrpc_body *pb;
void lustre_msg_set_opc(struct lustre_msg *msg, __u32 opc)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- ((struct lustre_msg_v1 *)msg)->lm_opc = opc;
- return;
case LUSTRE_MSG_MAGIC_V2: {
struct ptlrpc_body *pb;
void lustre_msg_set_last_xid(struct lustre_msg *msg, __u64 last_xid)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- ((struct lustre_msg_v1 *)msg)->lm_last_xid = last_xid;
- return;
case LUSTRE_MSG_MAGIC_V2: {
struct ptlrpc_body *pb;
void lustre_msg_set_last_committed(struct lustre_msg *msg, __u64 last_committed)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- ((struct lustre_msg_v1 *)msg)->lm_last_committed=last_committed;
- return;
case LUSTRE_MSG_MAGIC_V2: {
struct ptlrpc_body *pb;
void lustre_msg_set_transno(struct lustre_msg *msg, __u64 transno)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- ((struct lustre_msg_v1 *)msg)->lm_transno = transno;
- return;
case LUSTRE_MSG_MAGIC_V2: {
struct ptlrpc_body *pb;
void lustre_msg_set_status(struct lustre_msg *msg, __u32 status)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- ((struct lustre_msg_v1 *)msg)->lm_status = status;
- return;
case LUSTRE_MSG_MAGIC_V2: {
struct ptlrpc_body *pb;
void lustre_msg_set_conn_cnt(struct lustre_msg *msg, __u32 conn_cnt)
{
switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- ((struct lustre_msg_v1 *)msg)->lm_conn_cnt = conn_cnt;
- return;
case LUSTRE_MSG_MAGIC_V2: {
struct ptlrpc_body *pb;
LASSERT(req->rq_reqmsg);
switch (req->rq_reqmsg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return 1;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED:
return lustre_req_swabbed(req, MSG_PTLRPC_BODY_OFF);
LASSERT(req->rq_repmsg);
switch (req->rq_repmsg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V1:
- case LUSTRE_MSG_MAGIC_V1_SWABBED:
- return 1;
case LUSTRE_MSG_MAGIC_V2:
case LUSTRE_MSG_MAGIC_V2_SWABBED:
return lustre_rep_swabbed(req, MSG_PTLRPC_BODY_OFF);
{
struct ptlrpc_cli_ctx *ctx = req->rq_cli_ctx;
int rc;
+ __u16 rpc_flvr;
ENTRY;
LASSERT(ctx);
}
- if (req->rq_repbuf->lm_magic == LUSTRE_MSG_MAGIC_V1 ||
- req->rq_repbuf->lm_magic == LUSTRE_MSG_MAGIC_V1_SWABBED) {
- /*
- * v1 message, it's must be null flavor, so our requets also
- * should be in null flavor
- */
- if (RPC_FLVR_POLICY(req->rq_flvr.sf_rpc) !=
- SPTLRPC_POLICY_NULL) {
- CERROR("request was %s but reply with null\n",
- sptlrpc_rpcflavor2name(req->rq_flvr.sf_rpc));
- RETURN(-EPROTO);
- }
- } else {
- /*
- * v2 message, check request/reply policy match
- */
- __u16 rpc_flvr = WIRE_FLVR_RPC(req->rq_repbuf->lm_secflvr);
-
- if (req->rq_repbuf->lm_magic == LUSTRE_MSG_MAGIC_V2_SWABBED)
- __swab16s(&rpc_flvr);
+ /*
+ * v2 message, check request/reply policy match
+ */
+ rpc_flvr = WIRE_FLVR_RPC(req->rq_repbuf->lm_secflvr);
- if (RPC_FLVR_POLICY(rpc_flvr) !=
- RPC_FLVR_POLICY(req->rq_flvr.sf_rpc)) {
- CERROR("request policy was %u while reply with %u\n",
- RPC_FLVR_POLICY(req->rq_flvr.sf_rpc),
- RPC_FLVR_POLICY(rpc_flvr));
- RETURN(-EPROTO);
- }
+ if (req->rq_repbuf->lm_magic == LUSTRE_MSG_MAGIC_V2_SWABBED)
+ __swab16s(&rpc_flvr);
- /* do nothing if it's null policy; otherwise unpack the
- * wrapper message
- */
- if (RPC_FLVR_POLICY(rpc_flvr) != SPTLRPC_POLICY_NULL &&
- lustre_unpack_msg(req->rq_repbuf, req->rq_nob_received))
- RETURN(-EPROTO);
+ if (RPC_FLVR_POLICY(rpc_flvr) !=
+ RPC_FLVR_POLICY(req->rq_flvr.sf_rpc)) {
+ CERROR("request policy was %u while reply with %u\n",
+ RPC_FLVR_POLICY(req->rq_flvr.sf_rpc),
+ RPC_FLVR_POLICY(rpc_flvr));
+ RETURN(-EPROTO);
}
+ /* do nothing if it's null policy; otherwise unpack the
+ * wrapper message
+ */
+ if (RPC_FLVR_POLICY(rpc_flvr) != SPTLRPC_POLICY_NULL &&
+ lustre_unpack_msg(req->rq_repbuf, req->rq_nob_received))
+ RETURN(-EPROTO);
+
switch (RPC_FLVR_SVC(req->rq_flvr.sf_rpc)) {
case SPTLRPC_SVC_NULL:
case SPTLRPC_SVC_AUTH:
RETURN(SECSVC_DROP);
}
- if (msg->lm_magic == LUSTRE_MSG_MAGIC_V1 ||
- msg->lm_magic == LUSTRE_MSG_MAGIC_V1_SWABBED) {
- /*
- * v1 message, treat as to be null
- */
- req->rq_flvr.sf_rpc = SPTLRPC_FLVR_NULL;
- } else {
- /*
- * v2 message.
- */
- if (msg->lm_magic == LUSTRE_MSG_MAGIC_V2)
- req->rq_flvr.sf_rpc = WIRE_FLVR_RPC(msg->lm_secflvr);
- else
- req->rq_flvr.sf_rpc = WIRE_FLVR_RPC(
- __swab32(msg->lm_secflvr));
-
- /* unpack the wrapper message if the policy is not null */
- if ((RPC_FLVR_POLICY(req->rq_flvr.sf_rpc) !=
- SPTLRPC_POLICY_NULL) &&
- lustre_unpack_msg(msg, req->rq_reqdata_len))
- RETURN(SECSVC_DROP);
- }
+ /*
+ * v2 message.
+ */
+ if (msg->lm_magic == LUSTRE_MSG_MAGIC_V2)
+ req->rq_flvr.sf_rpc = WIRE_FLVR_RPC(msg->lm_secflvr);
+ else
+ req->rq_flvr.sf_rpc = WIRE_FLVR_RPC(__swab32(msg->lm_secflvr));
+
+ /* unpack the wrapper message if the policy is not null */
+ if ((RPC_FLVR_POLICY(req->rq_flvr.sf_rpc) != SPTLRPC_POLICY_NULL) &&
+ lustre_unpack_msg(msg, req->rq_reqdata_len))
+ RETURN(SECSVC_DROP);
policy = sptlrpc_rpcflavor2policy(req->rq_flvr.sf_rpc);
if (!policy) {
static
int null_ctx_sign(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
{
- if (req->rq_reqbuf->lm_magic != LUSTRE_MSG_MAGIC_V1) {
- req->rq_reqbuf->lm_secflvr = SPTLRPC_FLVR_NULL;
-
- if (!req->rq_import->imp_dlm_fake) {
- struct obd_device *obd = req->rq_import->imp_obd;
- null_encode_sec_part(req->rq_reqbuf,
- obd->u.cli.cl_sec_part);
- }
+ req->rq_reqbuf->lm_secflvr = SPTLRPC_FLVR_NULL;
+
+ if (!req->rq_import->imp_dlm_fake) {
+ struct obd_device *obd = req->rq_import->imp_obd;
+ null_encode_sec_part(req->rq_reqbuf,
+ obd->u.cli.cl_sec_part);
}
req->rq_reqdata_len = req->rq_reqlen;
return 0;
struct ptlrpc_reply_state *rs = req->rq_reply_state;
LASSERT(rs);
- if (rs->rs_repbuf->lm_magic != LUSTRE_MSG_MAGIC_V1)
- rs->rs_repbuf->lm_secflvr = SPTLRPC_FLVR_NULL;
+ rs->rs_repbuf->lm_secflvr = SPTLRPC_FLVR_NULL;
rs->rs_repdata_len = req->rq_replen;
return 0;
}
# include <liblustre.h>
#endif
+#ifdef __KERNEL__
+# ifndef AUTOCONF_INCLUDED
+# include <linux/config.h>
+# endif
+# ifdef CONFIG_FS_POSIX_ACL
+# include <linux/fs.h>
+# ifdef HAVE_XATTR_ACL
+# include <linux/xattr_acl.h>
+# else
+# define xattr_acl_entry posix_acl_xattr_entry
+# define xattr_acl_header posix_acl_xattr_header
+# endif
+# ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
+# include <linux/posix_acl_xattr.h>
+# endif
+# endif
+#endif
+
#include <obd_support.h>
#include <obd_class.h>
#include <lustre_net.h>
# include <liblustre.h>
#endif
+#ifdef __KERNEL__
+# ifndef AUTOCONF_INCLUDED
+# include <linux/config.h>
+# endif
+# ifdef CONFIG_FS_POSIX_ACL
+# include <linux/fs.h>
+# ifdef HAVE_XATTR_ACL
+# include <linux/xattr_acl.h>
+# else
+# define xattr_acl_entry posix_acl_xattr_entry
+# define xattr_acl_header posix_acl_xattr_header
+# endif
+# ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
+# include <linux/posix_acl_xattr.h>
+# endif
+# endif
+#endif
+
#include <obd_support.h>
#include <obd_class.h>
#include <lustre_net.h>
{
/* Wire protocol assertions generated by 'wirecheck'
* (make -C lustre/utils newwirecheck)
- * running on Linux hideous 2.6.9-prep.qp3.5.34.4qsnet #3 Mon Aug 13 08:38:55 EEST 2007 i686
- * with gcc version 3.4.6 20060404 (Red Hat 3.4.6-3) */
+ * running on Linux rhel5.vbox 2.6.18-prep #1 SMP Fri Feb 22 14:24:02 EET 2008 i686 i686 i386
+ * with gcc version 4.1.2 20070626 (Red Hat 4.1.2-14) */
/* Constants... */
- LASSERTF(LUSTRE_MSG_MAGIC_V1 == 0x0BD00BD0," found %lld\n",
- (long long)LUSTRE_MSG_MAGIC_V1);
LASSERTF(LUSTRE_MSG_MAGIC_V2 == 0x0BD00BD3," found %lld\n",
(long long)LUSTRE_MSG_MAGIC_V2);
LASSERTF(PTLRPC_MSG_VERSION == 0x00000003," found %lld\n",
(long long)LCK_GROUP);
LASSERTF(LCK_MAXMODE == 65, " found %lld\n",
(long long)LCK_MAXMODE);
- LASSERTF(LCK_MODE_NUM == 7, " found %lld\n",
- (long long)LCK_MODE_NUM);
CLASSERT(LDLM_PLAIN == 10);
CLASSERT(LDLM_EXTENT == 11);
CLASSERT(LDLM_FLOCK == 12);
LASSERTF((int)sizeof(((struct lustre_handle *)0)->cookie) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lustre_handle *)0)->cookie));
- /* Checks for struct lustre_msg_v1 */
- LASSERTF((int)sizeof(struct lustre_msg_v1) == 64, " found %lld\n",
- (long long)(int)sizeof(struct lustre_msg_v1));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_handle) == 0, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_handle));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_handle) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_handle));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_magic) == 8, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_magic));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_magic) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_magic));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_type) == 12, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_type));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_type) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_type));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_version) == 16, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_version));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_version) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_version));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_opc) == 20, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_opc));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_opc) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_opc));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_last_xid) == 24, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_last_xid));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_last_xid) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_last_xid));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_last_committed) == 32, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_last_committed));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_last_committed) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_last_committed));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_transno) == 40, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_transno));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_transno) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_transno));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_status) == 48, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_status));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_status) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_status));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_flags) == 52, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_flags));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_flags) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_flags));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_conn_cnt) == 56, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_conn_cnt));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_conn_cnt) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_conn_cnt));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_bufcount) == 60, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_bufcount));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_bufcount) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_bufcount));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_buflens[0]) == 64, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_buflens[0]));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_buflens[0]) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_buflens[0]));
-
/* Checks for struct lustre_msg_v2 */
LASSERTF((int)sizeof(struct lustre_msg_v2) == 32, " found %lld\n",
(long long)(int)sizeof(struct lustre_msg_v2));
(long long)(int)offsetof(struct lustre_msg_v2, lm_buflens[0]));
LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_buflens[0]) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lustre_msg_v2 *)0)->lm_buflens[0]));
- LASSERT(offsetof(struct lustre_msg_v1, lm_magic) == offsetof(struct lustre_msg_v2, lm_magic));
/* Checks for struct ptlrpc_body */
LASSERTF((int)sizeof(struct ptlrpc_body) == 88, " found %lld\n",
CLASSERT(OBD_CONNECT_REQPORTAL == 0x00000040ULL);
CLASSERT(OBD_CONNECT_ACL == 0x00000080ULL);
CLASSERT(OBD_CONNECT_XATTR == 0x00000100ULL);
+ CLASSERT(OBD_CONNECT_REAL == 0x08000000ULL);
+ CLASSERT(OBD_CONNECT_CKSUM == 0x20000000ULL);
CLASSERT(OBD_CONNECT_TRUNCLOCK == 0x00000400ULL);
CLASSERT(OBD_CONNECT_IBITS == 0x00001000ULL);
CLASSERT(OBD_CONNECT_JOIN == 0x00002000ULL);
CLASSERT(OBD_CONNECT_QUOTA64 == 0x00080000ULL);
CLASSERT(OBD_CONNECT_MDS_CAPA == 0x00100000ULL);
CLASSERT(OBD_CONNECT_OSS_CAPA == 0x00200000ULL);
- CLASSERT(OBD_CONNECT_CANCELSET == 0x00400000ULL);
+ CLASSERT(OBD_CONNECT_MDS_MDS == 0x04000000ULL);
CLASSERT(OBD_CONNECT_SOM == 0x00800000ULL);
CLASSERT(OBD_CONNECT_AT == 0x01000000ULL);
+ CLASSERT(OBD_CONNECT_CANCELSET == 0x00400000ULL);
CLASSERT(OBD_CONNECT_LRU_RESIZE == 0x02000000ULL);
- CLASSERT(OBD_CONNECT_MDS_MDS == 0x04000000ULL);
- CLASSERT(OBD_CONNECT_REAL == 0x08000000ULL);
- CLASSERT(OBD_CONNECT_CKSUM == 0x20000000ULL);
/* Checks for struct obdo */
LASSERTF((int)sizeof(struct obdo) == 208, " found %lld\n",
CLASSERT(OBD_FL_TRUNCLOCK == (0x00000800));
CLASSERT(OBD_FL_CKSUM_CRC32 == (0x00001000));
CLASSERT(OBD_FL_CKSUM_ADLER == (0x00002000));
- CLASSERT(OBD_CKSUM_CRC32 == (0x00000001));
- CLASSERT(OBD_CKSUM_ADLER == (0x00000002));
+ CLASSERT(OBD_CKSUM_CRC32 == OBD_CKSUM_CRC32);
+ CLASSERT(OBD_CKSUM_ADLER == OBD_CKSUM_ADLER);
/* Checks for struct lov_mds_md_v1 */
LASSERTF((int)sizeof(struct lov_mds_md_v1) == 32, " found %lld\n",
(long long)(int)offsetof(struct mds_rec_setattr, sa_attr_flags));
LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_attr_flags) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_attr_flags));
- CLASSERT(MDS_ATTR_MODE == 1);
- CLASSERT(MDS_ATTR_UID == 2);
- CLASSERT(MDS_ATTR_GID == 4);
- CLASSERT(MDS_ATTR_SIZE == 8);
- CLASSERT(MDS_ATTR_ATIME == 16);
- CLASSERT(MDS_ATTR_MTIME == 32);
- CLASSERT(MDS_ATTR_CTIME == 64);
- CLASSERT(MDS_ATTR_ATIME_SET == 128);
- CLASSERT(MDS_ATTR_MTIME_SET == 256);
- CLASSERT(MDS_ATTR_FORCE == 512);
- CLASSERT(MDS_ATTR_ATTR_FLAG == 1024);
- CLASSERT(MDS_ATTR_KILL_SUID == 2048);
- CLASSERT(MDS_ATTR_KILL_SGID == 4096);
- CLASSERT(MDS_ATTR_CTIME_SET == 8192);
- CLASSERT(MDS_ATTR_FROM_OPEN == 16384);
- CLASSERT(MDS_ATTR_BLOCKS == 32768);
+ CLASSERT(MDS_ATTR_MODE == 0x1ULL);
+ CLASSERT(MDS_ATTR_UID == 0x2ULL);
+ CLASSERT(MDS_ATTR_GID == 0x4ULL);
+ CLASSERT(MDS_ATTR_SIZE == 0x8ULL);
+ CLASSERT(MDS_ATTR_ATIME == 0x10ULL);
+ CLASSERT(MDS_ATTR_MTIME == 0x20ULL);
+ CLASSERT(MDS_ATTR_CTIME == 0x40ULL);
+ CLASSERT(MDS_ATTR_ATIME_SET == 0x80ULL);
+ CLASSERT(MDS_ATTR_MTIME_SET == 0x100ULL);
+ CLASSERT(MDS_ATTR_FORCE == 0x200ULL);
+ CLASSERT(MDS_ATTR_ATTR_FLAG == 0x400ULL);
+ CLASSERT(MDS_ATTR_KILL_SUID == 0x800ULL);
+ CLASSERT(MDS_ATTR_KILL_SGID == 0x1000ULL);
+ CLASSERT(MDS_ATTR_CTIME_SET == 0x2000ULL);
+ CLASSERT(MDS_ATTR_FROM_OPEN == 0x4000ULL);
+ CLASSERT(MDS_ATTR_BLOCKS == 0x8000ULL);
/* Checks for struct mds_rec_create */
LASSERTF((int)sizeof(struct mds_rec_create) == 96, " found %lld\n",
(long long)(int)offsetof(struct lustre_disk_data, ldd_params));
LASSERTF((int)sizeof(((struct lustre_disk_data *)0)->ldd_params) == 4096, " found %lld\n",
(long long)(int)sizeof(((struct lustre_disk_data *)0)->ldd_params));
+
+ /* Checks for type posix_acl_xattr_entry */
+ LASSERTF((int)sizeof(xattr_acl_entry) == 8, " found %lld\n",
+ (long long)(int)sizeof(xattr_acl_entry));
+ LASSERTF((int)offsetof(xattr_acl_entry, e_tag) == 0, " found %lld\n",
+ (long long)(int)offsetof(xattr_acl_entry, e_tag));
+ LASSERTF((int)sizeof(((xattr_acl_entry *)0)->e_tag) == 2, " found %lld\n",
+ (long long)(int)sizeof(((xattr_acl_entry *)0)->e_tag));
+ LASSERTF((int)offsetof(xattr_acl_entry, e_perm) == 2, " found %lld\n",
+ (long long)(int)offsetof(xattr_acl_entry, e_perm));
+ LASSERTF((int)sizeof(((xattr_acl_entry *)0)->e_perm) == 2, " found %lld\n",
+ (long long)(int)sizeof(((xattr_acl_entry *)0)->e_perm));
+ LASSERTF((int)offsetof(xattr_acl_entry, e_id) == 4, " found %lld\n",
+ (long long)(int)offsetof(xattr_acl_entry, e_id));
+ LASSERTF((int)sizeof(((xattr_acl_entry *)0)->e_id) == 4, " found %lld\n",
+ (long long)(int)sizeof(((xattr_acl_entry *)0)->e_id));
+
+ /* Checks for type posix_acl_xattr_header */
+ LASSERTF((int)sizeof(xattr_acl_header) == 4, " found %lld\n",
+ (long long)(int)sizeof(xattr_acl_header));
+ LASSERTF((int)offsetof(xattr_acl_header, a_version) == 0, " found %lld\n",
+ (long long)(int)offsetof(xattr_acl_header, a_version));
+ LASSERTF((int)sizeof(((xattr_acl_header *)0)->a_version) == 4, " found %lld\n",
+ (long long)(int)sizeof(((xattr_acl_header *)0)->a_version));
+ LASSERTF((int)offsetof(xattr_acl_header, a_entries) == 4, " found %lld\n",
+ (long long)(int)offsetof(xattr_acl_header, a_entries));
+ LASSERTF((int)sizeof(((xattr_acl_header *)0)->a_entries) == 0, " found %lld\n",
+ (long long)(int)sizeof(((xattr_acl_header *)0)->a_entries));
}
}
void
-check_lustre_msg_v1(void)
-{
- BLANK_LINE();
- CHECK_STRUCT(lustre_msg_v1);
- CHECK_MEMBER(lustre_msg_v1, lm_handle);
- CHECK_MEMBER(lustre_msg_v1, lm_magic);
- CHECK_MEMBER(lustre_msg_v1, lm_type);
- CHECK_MEMBER(lustre_msg_v1, lm_version);
- CHECK_MEMBER(lustre_msg_v1, lm_opc);
- CHECK_MEMBER(lustre_msg_v1, lm_last_xid);
- CHECK_MEMBER(lustre_msg_v1, lm_last_committed);
- CHECK_MEMBER(lustre_msg_v1, lm_transno);
- CHECK_MEMBER(lustre_msg_v1, lm_status);
- CHECK_MEMBER(lustre_msg_v1, lm_flags);
- CHECK_MEMBER(lustre_msg_v1, lm_conn_cnt);
- CHECK_MEMBER(lustre_msg_v1, lm_bufcount);
- CHECK_MEMBER(lustre_msg_v1, lm_buflens[0]);
-}
-
-void
check_lustre_msg_v2(void)
{
BLANK_LINE();
BLANK_LINE ();
COMMENT("Constants...");
- CHECK_DEFINE(LUSTRE_MSG_MAGIC_V1);
CHECK_DEFINE(LUSTRE_MSG_MAGIC_V2);
CHECK_DEFINE(PTLRPC_MSG_VERSION);
BLANK_LINE();
CHECK_STRUCT(obd_uuid);
check_lustre_handle();
- check_lustre_msg_v1();
check_lustre_msg_v2();
- printf(" LASSERT(offsetof(struct lustre_msg_v1, lm_magic) == "
- "offsetof(struct lustre_msg_v2, lm_magic));\n");
check_ptlrpc_body();
check_obd_connect_data();
check_obdo();
{
/* Wire protocol assertions generated by 'wirecheck'
* (make -C lustre/utils newwirecheck)
- * running on Linux hideous 2.6.9-prep.qp3.5.34.4qsnet #3 Mon Aug 13 08:38:55 EEST 2007 i686
- * with gcc version 3.4.6 20060404 (Red Hat 3.4.6-3) */
+ * running on Linux rhel5.vbox 2.6.18-prep #1 SMP Fri Feb 22 14:24:02 EET 2008 i686 i686 i386
+ * with gcc version 4.1.2 20070626 (Red Hat 4.1.2-14) */
/* Constants... */
- LASSERTF(LUSTRE_MSG_MAGIC_V1 == 0x0BD00BD0," found %lld\n",
- (long long)LUSTRE_MSG_MAGIC_V1);
LASSERTF(LUSTRE_MSG_MAGIC_V2 == 0x0BD00BD3," found %lld\n",
(long long)LUSTRE_MSG_MAGIC_V2);
LASSERTF(PTLRPC_MSG_VERSION == 0x00000003," found %lld\n",
(long long)REINT_RENAME);
LASSERTF(REINT_OPEN == 6, " found %lld\n",
(long long)REINT_OPEN);
- LASSERTF(REINT_SETXATTR == 7, " found %lld\n",
- (long long)REINT_SETXATTR);
LASSERTF(REINT_MAX == 8, " found %lld\n",
(long long)REINT_MAX);
LASSERTF(MGS_CONNECT == 250, " found %lld\n",
(long long)LCK_GROUP);
LASSERTF(LCK_MAXMODE == 65, " found %lld\n",
(long long)LCK_MAXMODE);
- LASSERTF(LCK_MODE_NUM == 7, " found %lld\n",
- (long long)LCK_MODE_NUM);
CLASSERT(LDLM_PLAIN == 10);
CLASSERT(LDLM_EXTENT == 11);
CLASSERT(LDLM_FLOCK == 12);
LASSERTF((int)sizeof(((struct lustre_handle *)0)->cookie) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lustre_handle *)0)->cookie));
- /* Checks for struct lustre_msg_v1 */
- LASSERTF((int)sizeof(struct lustre_msg_v1) == 64, " found %lld\n",
- (long long)(int)sizeof(struct lustre_msg_v1));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_handle) == 0, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_handle));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_handle) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_handle));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_magic) == 8, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_magic));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_magic) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_magic));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_type) == 12, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_type));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_type) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_type));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_version) == 16, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_version));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_version) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_version));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_opc) == 20, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_opc));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_opc) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_opc));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_last_xid) == 24, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_last_xid));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_last_xid) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_last_xid));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_last_committed) == 32, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_last_committed));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_last_committed) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_last_committed));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_transno) == 40, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_transno));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_transno) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_transno));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_status) == 48, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_status));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_status) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_status));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_flags) == 52, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_flags));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_flags) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_flags));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_conn_cnt) == 56, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_conn_cnt));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_conn_cnt) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_conn_cnt));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_bufcount) == 60, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_bufcount));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_bufcount) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_bufcount));
- LASSERTF((int)offsetof(struct lustre_msg_v1, lm_buflens[0]) == 64, " found %lld\n",
- (long long)(int)offsetof(struct lustre_msg_v1, lm_buflens[0]));
- LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_buflens[0]) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_buflens[0]));
-
/* Checks for struct lustre_msg_v2 */
LASSERTF((int)sizeof(struct lustre_msg_v2) == 32, " found %lld\n",
(long long)(int)sizeof(struct lustre_msg_v2));
(long long)(int)offsetof(struct lustre_msg_v2, lm_buflens[0]));
LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_buflens[0]) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lustre_msg_v2 *)0)->lm_buflens[0]));
- LASSERT(offsetof(struct lustre_msg_v1, lm_magic) == offsetof(struct lustre_msg_v2, lm_magic));
/* Checks for struct ptlrpc_body */
LASSERTF((int)sizeof(struct ptlrpc_body) == 88, " found %lld\n",
CLASSERT(OBD_CONNECT_REQPORTAL == 0x00000040ULL);
CLASSERT(OBD_CONNECT_ACL == 0x00000080ULL);
CLASSERT(OBD_CONNECT_XATTR == 0x00000100ULL);
+ CLASSERT(OBD_CONNECT_REAL == 0x08000000ULL);
+ CLASSERT(OBD_CONNECT_CKSUM == 0x20000000ULL);
CLASSERT(OBD_CONNECT_TRUNCLOCK == 0x00000400ULL);
CLASSERT(OBD_CONNECT_IBITS == 0x00001000ULL);
CLASSERT(OBD_CONNECT_JOIN == 0x00002000ULL);
CLASSERT(OBD_CONNECT_QUOTA64 == 0x00080000ULL);
CLASSERT(OBD_CONNECT_MDS_CAPA == 0x00100000ULL);
CLASSERT(OBD_CONNECT_OSS_CAPA == 0x00200000ULL);
- CLASSERT(OBD_CONNECT_CANCELSET == 0x00400000ULL);
+ CLASSERT(OBD_CONNECT_MDS_MDS == 0x04000000ULL);
CLASSERT(OBD_CONNECT_SOM == 0x00800000ULL);
CLASSERT(OBD_CONNECT_AT == 0x01000000ULL);
+ CLASSERT(OBD_CONNECT_CANCELSET == 0x00400000ULL);
CLASSERT(OBD_CONNECT_LRU_RESIZE == 0x02000000ULL);
- CLASSERT(OBD_CONNECT_MDS_MDS == 0x04000000ULL);
- CLASSERT(OBD_CONNECT_REAL == 0x08000000ULL);
- CLASSERT(OBD_CONNECT_CKSUM == 0x20000000ULL);
/* Checks for struct obdo */
LASSERTF((int)sizeof(struct obdo) == 208, " found %lld\n",
CLASSERT(OBD_FL_TRUNCLOCK == (0x00000800));
CLASSERT(OBD_FL_CKSUM_CRC32 == (0x00001000));
CLASSERT(OBD_FL_CKSUM_ADLER == (0x00002000));
- CLASSERT(OBD_CKSUM_CRC32 == (0x00000001));
- CLASSERT(OBD_CKSUM_ADLER == (0x00000002));
-
+ CLASSERT(OBD_CKSUM_CRC32 == OBD_CKSUM_CRC32);
+ CLASSERT(OBD_CKSUM_ADLER == OBD_CKSUM_ADLER);
+
/* Checks for struct lov_mds_md_v1 */
LASSERTF((int)sizeof(struct lov_mds_md_v1) == 32, " found %lld\n",
(long long)(int)sizeof(struct lov_mds_md_v1));
(long long)(int)offsetof(struct mds_rec_setattr, sa_attr_flags));
LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_attr_flags) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_attr_flags));
- CLASSERT(MDS_ATTR_MODE == 1);
- CLASSERT(MDS_ATTR_UID == 2);
- CLASSERT(MDS_ATTR_GID == 4);
- CLASSERT(MDS_ATTR_SIZE == 8);
- CLASSERT(MDS_ATTR_ATIME == 16);
- CLASSERT(MDS_ATTR_MTIME == 32);
- CLASSERT(MDS_ATTR_CTIME == 64);
- CLASSERT(MDS_ATTR_ATIME_SET == 128);
- CLASSERT(MDS_ATTR_MTIME_SET == 256);
- CLASSERT(MDS_ATTR_FORCE == 512);
- CLASSERT(MDS_ATTR_ATTR_FLAG == 1024);
- CLASSERT(MDS_ATTR_KILL_SUID == 2048);
- CLASSERT(MDS_ATTR_KILL_SGID == 4096);
- CLASSERT(MDS_ATTR_CTIME_SET == 8192);
- CLASSERT(MDS_ATTR_FROM_OPEN == 16384);
- CLASSERT(MDS_ATTR_BLOCKS == 32768);
+ CLASSERT(MDS_ATTR_MODE == 0x1ULL);
+ CLASSERT(MDS_ATTR_UID == 0x2ULL);
+ CLASSERT(MDS_ATTR_GID == 0x4ULL);
+ CLASSERT(MDS_ATTR_SIZE == 0x8ULL);
+ CLASSERT(MDS_ATTR_ATIME == 0x10ULL);
+ CLASSERT(MDS_ATTR_MTIME == 0x20ULL);
+ CLASSERT(MDS_ATTR_CTIME == 0x40ULL);
+ CLASSERT(MDS_ATTR_ATIME_SET == 0x80ULL);
+ CLASSERT(MDS_ATTR_MTIME_SET == 0x100ULL);
+ CLASSERT(MDS_ATTR_FORCE == 0x200ULL);
+ CLASSERT(MDS_ATTR_ATTR_FLAG == 0x400ULL);
+ CLASSERT(MDS_ATTR_KILL_SUID == 0x800ULL);
+ CLASSERT(MDS_ATTR_KILL_SGID == 0x1000ULL);
+ CLASSERT(MDS_ATTR_CTIME_SET == 0x2000ULL);
+ CLASSERT(MDS_ATTR_FROM_OPEN == 0x4000ULL);
+ CLASSERT(MDS_ATTR_BLOCKS == 0x8000ULL);
/* Checks for struct mds_rec_create */
LASSERTF((int)sizeof(struct mds_rec_create) == 96, " found %lld\n",
LASSERTF((int)sizeof(((struct lustre_disk_data *)0)->ldd_params) == 4096, " found %lld\n",
(long long)(int)sizeof(((struct lustre_disk_data *)0)->ldd_params));
-#ifdef LIBLUSTRE_POSIX_ACL
/* Checks for type posix_acl_xattr_entry */
- LASSERTF((int)sizeof(posix_acl_xattr_entry) == 8, " found %lld\n",
- (long long)(int)sizeof(posix_acl_xattr_entry));
- LASSERTF((int)offsetof(posix_acl_xattr_entry, e_tag) == 0, " found %lld\n",
- (long long)(int)offsetof(posix_acl_xattr_entry, e_tag));
- LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_tag) == 2, " found %lld\n",
- (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_tag));
- LASSERTF((int)offsetof(posix_acl_xattr_entry, e_perm) == 2, " found %lld\n",
- (long long)(int)offsetof(posix_acl_xattr_entry, e_perm));
- LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_perm) == 2, " found %lld\n",
- (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_perm));
- LASSERTF((int)offsetof(posix_acl_xattr_entry, e_id) == 4, " found %lld\n",
- (long long)(int)offsetof(posix_acl_xattr_entry, e_id));
- LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_id) == 4, " found %lld\n",
- (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_id));
+ LASSERTF((int)sizeof(xattr_acl_entry) == 8, " found %lld\n",
+ (long long)(int)sizeof(xattr_acl_entry));
+ LASSERTF((int)offsetof(xattr_acl_entry, e_tag) == 0, " found %lld\n",
+ (long long)(int)offsetof(xattr_acl_entry, e_tag));
+ LASSERTF((int)sizeof(((xattr_acl_entry *)0)->e_tag) == 2, " found %lld\n",
+ (long long)(int)sizeof(((xattr_acl_entry *)0)->e_tag));
+ LASSERTF((int)offsetof(xattr_acl_entry, e_perm) == 2, " found %lld\n",
+ (long long)(int)offsetof(xattr_acl_entry, e_perm));
+ LASSERTF((int)sizeof(((xattr_acl_entry *)0)->e_perm) == 2, " found %lld\n",
+ (long long)(int)sizeof(((xattr_acl_entry *)0)->e_perm));
+ LASSERTF((int)offsetof(xattr_acl_entry, e_id) == 4, " found %lld\n",
+ (long long)(int)offsetof(xattr_acl_entry, e_id));
+ LASSERTF((int)sizeof(((xattr_acl_entry *)0)->e_id) == 4, " found %lld\n",
+ (long long)(int)sizeof(((xattr_acl_entry *)0)->e_id));
/* Checks for type posix_acl_xattr_header */
- LASSERTF((int)sizeof(posix_acl_xattr_header) == 4, " found %lld\n",
- (long long)(int)sizeof(posix_acl_xattr_header));
- LASSERTF((int)offsetof(posix_acl_xattr_header, a_version) == 0, " found %lld\n",
- (long long)(int)offsetof(posix_acl_xattr_header, a_version));
- LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_version) == 4, " found %lld\n",
- (long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_version));
- LASSERTF((int)offsetof(posix_acl_xattr_header, a_entries) == 4, " found %lld\n",
- (long long)(int)offsetof(posix_acl_xattr_header, a_entries));
- LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_entries) == 0, " found %lld\n",
- (long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_entries));
-#endif
-
+ LASSERTF((int)sizeof(xattr_acl_header) == 4, " found %lld\n",
+ (long long)(int)sizeof(xattr_acl_header));
+ LASSERTF((int)offsetof(xattr_acl_header, a_version) == 0, " found %lld\n",
+ (long long)(int)offsetof(xattr_acl_header, a_version));
+ LASSERTF((int)sizeof(((xattr_acl_header *)0)->a_version) == 4, " found %lld\n",
+ (long long)(int)sizeof(((xattr_acl_header *)0)->a_version));
+ LASSERTF((int)offsetof(xattr_acl_header, a_entries) == 4, " found %lld\n",
+ (long long)(int)offsetof(xattr_acl_header, a_entries));
+ LASSERTF((int)sizeof(((xattr_acl_header *)0)->a_entries) == 0, " found %lld\n",
+ (long long)(int)sizeof(((xattr_acl_header *)0)->a_entries));
}