niov = umd->length;
size = offsetof(struct lnet_libmd, md_iov.kiov[niov]);
} else {
- niov = ((umd->options & LNET_MD_IOVEC) != 0) ?
- umd->length : 1;
+ niov = 1;
size = offsetof(struct lnet_libmd, md_iov.iov[niov]);
}
* the number of entries in the array. The length can't be bigger
* than LNET_MAX_IOV. The struct bio_vec is used to describe page-based
* fragments that are not necessarily mapped in virtal memory.
- * - LNET_MD_IOVEC bit set: The start field points to the starting
- * address of an array of struct kvec and the length field specifies
- * the number of entries in the array. The length can't be bigger
- * than LNET_MAX_IOV. The struct kvec is used to describe fragments
- * that have virtual addresses.
* - Otherwise: The memory region is contiguous. The start field
* specifies the starting address for the memory region and the
* length field specifies its length.
* The data sent in the REPLY serves as an implicit acknowledgment.
* - LNET_MD_KIOV: The start and length fields specify an array of
* struct bio_vec.
- * - LNET_MD_IOVEC: The start and length fields specify an array of
- * struct iovec.
* - LNET_MD_MAX_SIZE: The max_size field is valid.
* - LNET_MD_BULK_HANDLE: The bulk_handle field is valid.
*
* Note:
- * - LNET_MD_KIOV or LNET_MD_IOVEC allows for a scatter/gather
- * capability for memory descriptors. They can't be both set.
+ * - LNET_MD_KIOV allows for a scatter/gather capability for memory
+ * descriptors.
* - When LNET_MD_MAX_SIZE is set, the total length of the memory
* region (i.e. sum of all fragment lengths) must not be less than
* \a max_size.
/** See struct lnet_md::options. */
#define LNET_MD_ACK_DISABLE (1 << 5)
/** See struct lnet_md::options. */
-#define LNET_MD_IOVEC (1 << 6)
+/* deprecated #define LNET_MD_IOVEC (1 << 6) */
/** See struct lnet_md::options. */
#define LNET_MD_MAX_SIZE (1 << 7)
/** See struct lnet_md::options. */
lmd->md_flags = (unlink == LNET_UNLINK) ? LNET_MD_FLAG_AUTO_UNLINK : 0;
lmd->md_bulk_handle = umd->bulk_handle;
- if ((umd->options & LNET_MD_IOVEC) != 0) {
-
- if ((umd->options & LNET_MD_KIOV) != 0) /* Can't specify both */
- return -EINVAL;
-
- lmd->md_niov = niov = umd->length;
- memcpy(lmd->md_iov.iov, umd->start,
- niov * sizeof(lmd->md_iov.iov[0]));
-
- for (i = 0; i < (int)niov; i++) {
- /* We take the base address on trust */
- if (lmd->md_iov.iov[i].iov_len <= 0) /* invalid length */
- return -EINVAL;
-
- total_length += lmd->md_iov.iov[i].iov_len;
- }
-
- lmd->md_length = total_length;
-
- if ((umd->options & LNET_MD_MAX_SIZE) != 0 && /* max size used */
- (umd->max_size < 0 ||
- umd->max_size > total_length)) // illegal max_size
- return -EINVAL;
-
- } else if ((umd->options & LNET_MD_KIOV) != 0) {
+ if ((umd->options & LNET_MD_KIOV) != 0) {
lmd->md_niov = niov = umd->length;
memcpy(lmd->md_iov.kiov, umd->start,
niov * sizeof(lmd->md_iov.kiov[0]));
* and that's all.
*/
umd->start = lmd->md_start;
- umd->length = ((lmd->md_options & (LNET_MD_IOVEC | LNET_MD_KIOV)) == 0) ?
+ umd->length = ((lmd->md_options & LNET_MD_KIOV) == 0) ?
lmd->md_length : lmd->md_niov;
umd->threshold = lmd->md_threshold;
umd->max_size = lmd->md_max_size;
return -EINVAL;
}
- if ((umd->options & (LNET_MD_KIOV | LNET_MD_IOVEC)) != 0 &&
+ if ((umd->options & LNET_MD_KIOV) &&
umd->length > LNET_MAX_IOV) {
CERROR("Invalid option: too many fragments %u, %d max\n",
umd->length, LNET_MAX_IOV);
LASSERT(mdidx < desc->bd_md_max_brw);
LASSERT(desc->bd_iov_count <= PTLRPC_MAX_BRW_PAGES);
- LASSERT(!(md->options & (LNET_MD_IOVEC | LNET_MD_KIOV |
- LNET_MD_PHYS)));
+ LASSERT(!(md->options & (LNET_MD_KIOV | LNET_MD_PHYS)));
md->length = max(0, desc->bd_iov_count - mdidx * LNET_MAX_IOV);
md->length = min_t(unsigned int, LNET_MAX_IOV, md->length);