#include <libcfs/util/list.h>
#include <lustre/lustreapi.h>
-#include <lustre/lustre_idl.h>
#include "lustreapi_internal.h"
/**
blob->lmm_pattern = 0;
else if (pattern == LLAPI_LAYOUT_RAID0)
blob->lmm_pattern = LOV_PATTERN_RAID0;
+ else if (pattern == LLAPI_LAYOUT_MDT)
+ blob->lmm_pattern = LOV_PATTERN_MDT;
else
blob->lmm_pattern = pattern;
}
/**
- * Set the RAID pattern of \a layout.
+ * Set the pattern of \a layout.
*
* \param[in] layout layout to set pattern in
* \param[in] pattern value to be set
return -1;
if (pattern != LLAPI_LAYOUT_DEFAULT &&
- pattern != LLAPI_LAYOUT_RAID0) {
+ pattern != LLAPI_LAYOUT_RAID0 &&
+ pattern != LLAPI_LAYOUT_MDT) {
errno = EOPNOTSUPP;
return -1;
}
return -1;
if (!layout->llot_is_composite) {
- errno = EINVAL;
- return -1;
+ if (pos == LLAPI_LAYOUT_COMP_USE_FIRST ||
+ pos == LLAPI_LAYOUT_COMP_USE_LAST)
+ return 0;
+ errno = ENOENT;
+ return 1;
}
head = list_entry(layout->llot_comp_list.next, typeof(*head), llc_list);