- rc = fsetxattr(fd, XATTR_LUSTRE_LOV".del", &id, sizeof(id), 0);
+ layout = llapi_layout_alloc();
+ if (layout == NULL)
+ return -1;
+
+ llapi_layout_comp_extent_set(layout, 0, LUSTRE_EOF);
+ comp = __llapi_layout_cur_comp(layout);
+ comp->llc_id = id;
+ comp->llc_flags = flags;
+
+ lum = llapi_layout_to_lum(layout);
+ if (lum == NULL) {
+ llapi_layout_free(layout);
+ return -1;
+ }
+ lum_size = ((struct lov_comp_md_v1 *)lum)->lcm_size;
+
+ fd = open(path, O_RDWR);
+ if (fd < 0) {
+ rc = -1;
+ goto out;
+ }
+
+ rc = fsetxattr(fd, XATTR_LUSTRE_LOV".del", lum, lum_size, 0);