+/**
+ * Allocate a striping using an algorithm with weights.
+ *
+ * The function allocates OST objects to create a striping. The algorithm
+ * used is based on weights (currently only using the free space), and it's
+ * trying to ensure the space is used evenly by OSTs and OSSs. The striping
+ * configuration (# of stripes, offset,
+ * pool) is taken from the object and is prepared by the caller.
+ * If LOV_USES_DEFAULT_STRIPE is not passed and prepared configuration can't
+ * be met due to too few OSTs, then allocation fails. If the flag is
+ * passed and less than 75% of the requested number of stripes can be
+ * allocated, then allocation fails.
+ * No concurrent allocation is allowed on the object and this must be
+ * ensured by the caller. All the internal structures are protected by the
+ * function.
+ * The algorithm has two steps: find available OSTs and calucate their weights,
+ * then select the OSTs the weights used as the probability. An OST with a
+ * higher weight is proportionately more likely to be selected than one with
+ * a lower weight.
+ *
+ * \param[in] env execution environment for this thread
+ * \param[in] lo LOD object
+ * \param[out] stripe striping created
+ * \param[in] flags 0 or LOV_USES_DEFAULT_STRIPE
+ * \param[in] th transaction handle
+ *
+ * \retval 0 on success
+ * \retval -E2BIG if no enough OSTs are found
+ * \retval -EINVAL requested offset is invalid
+ * \retval negative negated errno on error