Details
-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
-
Upstream
-
None
-
9223372036854775807
Description
The llapi provides setters and getters around the struct llapi_layout. One of them is llapi_layout_pool_name_set(). The function's description gives the impression that it can be used to change an already existing layout's pool name to something else. In practice, there is information in the struct llapi_layout that is tied to the pool's name that must be erased after (or before) a pool name is set. Here is the definition of struct llapi_layout:
/** * Layout component, which contains all attributes of a plain * V1/V3 layout. */ struct llapi_layout_comp { uint64_t llc_pattern; uint64_t llc_stripe_size; uint64_t llc_stripe_count; uint64_t llc_stripe_offset; /* Add 1 so user always gets back a null terminated string. */ char llc_pool_name[LOV_MAXPOOLNAME + 1]; /** Number of objects in llc_objects array if was initialized. */ uint32_t llc_objects_count; struct lov_user_ost_data_v1 *llc_objects; /* fields used only for composite layouts */ struct lu_extent llc_extent; /* [start, end) of component */ uint32_t llc_id; /* unique ID of component */ uint32_t llc_flags; /* LCME_FL_* flags */ uint64_t llc_timestamp; /* snapshot timestamp */ struct list_head llc_list; /* linked to the llapi_layout components list */ }; /** * An Opaque data type abstracting the layout of a Lustre file. */ struct llapi_layout { uint32_t llot_magic; /* LLAPI_LAYOUT_MAGIC */ uint32_t llot_gen; uint32_t llot_flags; bool llot_is_composite; uint16_t llot_mirror_count; /* Cursor pointing to one of the components in llot_comp_list */ struct llapi_layout_comp *llot_cur_comp; struct list_head llot_comp_list; };
llc_objects_count and llc_objects are the fields that must be reset. This can be done with a call to llapi_layout_ost_index_set() with stripe_number = 0 and ost_index = LLAPI_LAYOUT_DEFAULT.
I think llapi_pool_name_set() should do this work itself. What do you think? Are there use cases to keeping a component's object list after a pool change?
Attachments
Issue Links
- is related to
-
LU-9961 FLR2: Relocating individual objects to a new OST
- Open