This patch improves llapi_layout_comp_use() to treat non-composite
file as single component file. When doing "is composite" check,
"1" is returned when LLAPI_LAYOUT_COMP_USE_NEXT/PREV is specified.
Signed-off-by: Emoly Liu <emoly.liu@intel.com>
Change-Id: I3ba4f07ec843d9b61273af331060d5f8827c2f8b
Reviewed-on: https://review.whamcloud.com/27865
Tested-by: Jenkins
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
return -1;
if (!layout->llot_is_composite) {
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);
}
head = list_entry(layout->llot_comp_list.next, typeof(*head), llc_list);