#define LDLM_FL_WARN 0x008000 /* see ldlm_cli_cancel_unused */
#define LDLM_FL_DISCARD_DATA 0x010000 /* discard (no writeback) on cancel */
-#define LDLM_FL_NO_TIMEOUT 0x020000 /* Blocked by CW lock - wait
- indefinitely */
+#define LDLM_FL_NO_TIMEOUT 0x020000 /* Blocked by group lock - wait
+ * indefinitely */
/* file & record locking */
#define LDLM_FL_BLOCK_NOWAIT 0x040000 // server told not to wait if blocked
struct list_head lr_converting;
struct list_head lr_waiting;
ldlm_mode_t lr_most_restr;
- ldlm_type_t lr_type; /* LDLM_PLAIN or LDLM_EXTENT */
+ ldlm_type_t lr_type; /* LDLM_{PLAIN,EXTENT,FLOCK} */
struct ldlm_resource *lr_root;
struct ldlm_res_id lr_name;
atomic_t lr_refcount;
int lustre_msg_size(int count, int *lengths);
int lustre_unpack_msg(struct lustre_msg *m, int len);
void *lustre_msg_buf(struct lustre_msg *m, int n, int minlen);
+int lustre_msg_buflen(struct lustre_msg *m, int n);
char *lustre_msg_string (struct lustre_msg *m, int n, int max_len);
void *lustre_swab_buf(struct lustre_msg *, int n, int minlen, void *swabber);
void *lustre_swab_reqbuf (struct ptlrpc_request *req, int n, int minlen,
RETURN(0);
}
+/**
+ * lustre_msg_buflen - return the length of buffer @n in message @m
+ * @m - lustre_msg (request or reply) to look at
+ * @n - message index (base 0)
+ *
+ * returns zero for non-existent message indices
+ */
+int lustre_msg_buflen(struct lustre_msg *m, int n)
+{
+ if (n >= m->bufcount)
+ return 0;
+
+ return m->buflens[n];
+}
+EXPORT_SYMBOL(lustre_msg_buflen);
+
void *lustre_msg_buf(struct lustre_msg *m, int n, int min_size)
{
int i;
/* the lock data is a union and the first two fields are always an
* extent so it's ok to process an LDLM_EXTENT and LDLM_FLOCK lock
* data the same way. */
- __swab64s (&d->l_flock.start);
- __swab64s (&d->l_flock.end);
- __swab32s (&d->l_flock.pid);
+ __swab64s(&d->l_extent.start);
+ __swab64s(&d->l_extent.end);
+ __swab64s(&d->l_extent.gid);
+ __swab32s(&d->l_flock.pid);
}
void lustre_swab_ldlm_intent (struct ldlm_intent *i)
(long long)OST_LAST_OPC);
LASSERTF(OBD_OBJECT_EOF == 0xffffffffffffffffULL," found %lld\n",
(long long)OBD_OBJECT_EOF);
- LASSERTF(OST_REQ_HAS_OA1 == 1, " found %lld\n",
- (long long)OST_REQ_HAS_OA1);
LASSERTF(MDS_GETATTR == 33, " found %lld\n",
(long long)MDS_GETATTR);
LASSERTF(MDS_GETATTR_NAME == 34, " found %lld\n",
(long long)(int)offsetof(struct ldlm_extent, end));
LASSERTF((int)sizeof(((struct ldlm_extent *)0)->end) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_extent *)0)->end));
+ LASSERTF((int)offsetof(struct ldlm_extent, gid) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_extent, gid));
+ LASSERTF((int)sizeof(((struct ldlm_extent *)0)->gid) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct ldlm_extent *)0)->gid));
/* Checks for struct ldlm_flock */
LASSERTF((int)sizeof(struct ldlm_flock) == 32, " found %lld\n",