}
/**
- * Check whether the target is available for new objects.
+ * lod_statfs_and_check() - Check whether target is available for new objects.
+ * @env: execution environment for this thread
+ * @d: LOD device
+ * @ltd: target table
+ * @tgt: target
+ * @reserve: space to reserve on target device
*
* Request statfs data from the given target and verify it's active and not
* read-only. If so, then it can be used to place new objects. This
* dirty flags if those numbers change so others can run re-balance procedures.
* No external locking is required.
*
- * \param[in] env execution environment for this thread
- * \param[in] d LOD device
- * \param[in] ltd target table
- * \param[in] tgt target
- *
- * \retval 0 if the target is good
- * \retval negative negated errno on error
+ * Return:
+ * * %0 if the target is good
+ * * %negative negated errno on error
*/
static int lod_statfs_and_check(const struct lu_env *env, struct lod_device *d,
struct lu_tgt_descs *ltd,
}
/**
- * Maintain per-target statfs data.
+ * lod_qos_statfs_update() - Maintain per-target statfs data.
+ * @env: execution environment for this thread
+ * @lod: LOD device
+ * @ltd: tgt table
*
* The function refreshes statfs data for all the targets every N seconds.
* The actual N is controlled via procfs and set to LOV_DESC_QOS_MAXAGE_DEFAULT
* initially.
- *
- * \param[in] env execution environment for this thread
- * \param[in] lod LOD device
- * \param[in] ltd tgt table
*/
void lod_qos_statfs_update(const struct lu_env *env, struct lod_device *lod,
struct lu_tgt_descs *ltd)
#define LOV_QOS_EMPTY ((__u32)-1)
/**
- * Calculate optimal round-robin order with regard to OSSes.
+ * lod_qos_calc_rr() - Calculate optimal round-robin order with regard to OSSes
+ * @lod: LOD device
+ * @ltd: tgt table
+ * @src_pool: tgt pool
+ * @lqr: round-robin list
*
- * Place all the OSTs from pool \a src_pool in a special array to be used for
+ * Place all the OSTs from pool @src_pool in a special array to be used for
* round-robin (RR) stripe allocation. The placement algorithm interleaves
* OSTs from the different OSSs so that RR allocation can balance OSSs evenly.
* Resorts the targets when the number of active targets changes (because of
* a new target or activation/deactivation).
*
- * \param[in] lod LOD device
- * \param[in] ltd tgt table
- * \param[in] src_pool tgt pool
- * \param[in] lqr round-robin list
- *
- * \retval 0 on success
- * \retval -ENOMEM fails to allocate the array
+ * Return:
+ * * %0 on success
+ * * %-ENOMEM fails to allocate the array
*/
static int lod_qos_calc_rr(struct lod_device *lod, struct lu_tgt_descs *ltd,
const struct lu_tgt_pool *src_pool,
}
/**
- * Instantiate and declare creation of a new object.
+ * lod_qos_declare_object_on() - Instantiate & declare creation of a new object.
+ * @env: execution environment for this thread
+ * @d: LOD device
+ * @ost_idx: OST target index where the object is being created
+ * @can_block: operation blockable or not
+ * @th: transaction handle
*
* The function instantiates LU representation for a new object on the
* specified device. Also it declares an intention to create that
* special method instantiates FID-less object in the cache and later it
* will get a FID and proper placement in LU cache.
*
- * \param[in] env execution environment for this thread
- * \param[in] d LOD device
- * \param[in] ost_idx OST target index where the object is being created
- * \param[in] th transaction handle
- *
- * \retval object ptr on success, ERR_PTR() otherwise
+ * Return object ptr on success, ERR_PTR() otherwise
*/
static struct dt_object *lod_qos_declare_object_on(const struct lu_env *env,
struct lod_device *d,
}
/**
- * Calculate a minimum acceptable stripe count.
+ * lod_stripe_count_min() - Calculate a minimum acceptable stripe count.
+ * @stripe_count: number of stripes requested
+ * @flags: 0 or LOD_USES_DEFAULT_STRIPE
*
* Return an acceptable stripe count depending on flag LOD_USES_DEFAULT_STRIPE:
* all stripes or 3/4 of stripes. The code is written this way to avoid
* returning 0 for stripe_count < 4, like "stripe_count * 3 / 4" would do.
*
- * \param[in] stripe_count number of stripes requested
- * \param[in] flags 0 or LOD_USES_DEFAULT_STRIPE
- *
- * \retval acceptable stripecount
+ * Returns acceptable stripecount
*/
static int lod_stripe_count_min(__u32 stripe_count, enum lod_uses_hint flags)
{
#define LOV_CREATE_RESEED_MIN 2000
/**
- * Initialize temporary tgt-in-use array.
+ * lod_qos_tgt_in_use_clear() - Initialize temporary tgt-in-use array.
+ * @env: execution environment for this thread
+ * @stripes: number of items needed in the array
*
* Allocate or extend the array used to mark targets already assigned to a new
* striping so they are not used more than once.
*
- * \param[in] env execution environment for this thread
- * \param[in] stripes number of items needed in the array
- *
- * \retval 0 on success
- * \retval -ENOMEM on error
+ * Return:
+ * * %0 on success
+ * * %-ENOMEM on error
*/
static inline int lod_qos_tgt_in_use_clear(const struct lu_env *env,
__u32 stripes)
}
/**
- * Remember a target in the array of used targets.
+ * lod_qos_tgt_in_use() - Remember a target in the array of used targets.
+ * @env: execution environment for this thread
+ * @idx: index in the array
+ * @tgt_idx: target index to mark as used
*
* Mark the given target as used for a new striping being created. The status
* of an tgt in a striping can be checked with lod_qos_is_tgt_used().
- *
- * \param[in] env execution environment for this thread
- * \param[in] idx index in the array
- * \param[in] tgt_idx target index to mark as used
*/
static inline void lod_qos_tgt_in_use(const struct lu_env *env,
int idx, int tgt_idx)
}
/**
- * Check is tgt used in a striping.
+ * lod_qos_is_tgt_used() - Check is tgt used in a striping.
+ * @env: execution environment for this thread
+ * @tgt_idx: target index to check
+ * @stripes: the number of items used in the array already
*
* Checks whether tgt with the given index is marked as used in the temporary
* array (see lod_qos_tgt_in_use()).
*
- * \param[in] env execution environment for this thread
- * \param[in] tgt_idx target index to check
- * \param[in] stripes the number of items used in the array already
- *
- * \retval 0 not used
- * \retval 1 used
+ * Return:
+ * * %0 not used
+ * * %1 used
*/
static int lod_qos_is_tgt_used(const struct lu_env *env, int tgt_idx,
__u32 stripes)
}
/**
- * Check is OST used in a composite layout
- *
- * \param[in] lo lod object
- * \param[in] ost OST target index to check
- *
- * \retval false not used
- * \retval true used
+ * lod_comp_is_ost_used() - Check is OST used in a composite layout
+ * @env: execution environment
+ * @lo: lod object
+ * @ost: OST target index to check
+ *
+ * Return:
+ * * %false not used
+ * * %true used
*/
static inline bool lod_comp_is_ost_used(const struct lu_env *env,
struct lod_object *lo, int ost)
}
/**
- * Allocate a striping using round-robin algorithm.
+ * lod_ost_alloc_rr() - Allocate a striping using round-robin algorithm.
+ * @env: execution environment for this thread
+ * @lo: LOD object
+ * @stripe: striping created [out]
+ * @ost_indices: ost indices of striping created [out]
+ * @flags: allocation flags (0 or LOD_USES_DEFAULT_STRIPE)
+ * @th: transaction handle
+ * @comp_idx: index of ldo_comp_entries
+ * @reserve: space to reserve on the target device
*
* Allocates a new striping using round-robin algorithm. The function refreshes
* all the internal structures (statfs cache, array of available OSTs sorted
* time we give priority to targets which already have objects precreated.
* Full OSTs are skipped (see lod_qos_dev_is_full() for the details).
*
- * \param[in] env execution environment for this thread
- * \param[in] lo LOD object
- * \param[out] stripe striping created
- * \param[out] ost_indices ost indices of striping created
- * \param[in] flags allocation flags (0 or LOD_USES_DEFAULT_STRIPE)
- * \param[in] th transaction handle
- * \param[in] comp_idx index of ldo_comp_entries
- *
- * \retval 0 on success
- * \retval -ENOSPC if not enough OSTs are found
- * \retval negative negated errno for other failures
+ * Return:
+ * * %0 on success
+ * * %-ENOSPC if not enough OSTs are found
+ * * %negative negated errno for other failures
*/
static int lod_ost_alloc_rr(const struct lu_env *env, struct lod_object *lo,
struct dt_object **stripe, __u32 *ost_indices,
}
/**
- * Allocate a striping using round-robin algorithm.
+ * lod_mdt_alloc_rr() - Allocate a striping using round-robin algorithm.
+ * @env: execution environment for this thread
+ * @lo: LOD object
+ * @stripes: striping created
+ * @stripe_idx: starting index of stripe allocation
+ * @stripe_count: Number of stripe objects needed
*
* Allocates a new striping using round-robin algorithm. The function refreshes
* all the internal structures (statfs cache, array of available remote MDTs
* internal structures (like pools, etc) are protected and no additional locking
* is required. The function succeeds even if a single stripe is allocated.
*
- * \param[in] env execution environment for this thread
- * \param[in] lo LOD object
- * \param[out] stripes striping created
- *
- * \retval positive stripe objects allocated, including the first stripe
- * allocated outside
- * \retval -ENOSPC if not enough MDTs are found
- * \retval negative negated errno for other failures
+ * Return:
+ * * %positive stripe objects allocated, including first stripe allocated
+ * outside the function
+ * * %-ENOSPC if not enough MDTs are found
+ * * %negative negated errno for other failures
*/
int lod_mdt_alloc_rr(const struct lu_env *env, struct lod_object *lo,
struct dt_object **stripes, u32 stripe_idx,
}
/**
- * Allocate a specific striping layout on a user defined set of OSTs.
+ * lod_alloc_ost_list() - Allocate a specific striping layout on a user defined
+ * set of OSTs.
+ * @env: execution environment for this thread
+ * @lo: LOD object
+ * @stripe: striping created [out]
+ * @ost_indices: ost indices of striping created [out]
+ * @th: transaction handle
+ * @comp_idx: index of ldo_comp_entries
+ * @reserve: space to reserve on the target device
*
* Allocates new striping using the OST index range provided by the data from
* the lmm_objects contained in the lov_user_md passed to this method. Full
* structures are protected, but no concurrent allocation is allowed on the
* same objects.
*
- * \param[in] env execution environment for this thread
- * \param[in] lo LOD object
- * \param[out] stripe striping created
- * \param[out] ost_indices ost indices of striping created
- * \param[in] th transaction handle
- * \param[in] comp_idx index of ldo_comp_entries
- *
- * \retval 0 on success
- * \retval -ENODEV OST index does not exist on file system
- * \retval -EINVAL requested OST index is invalid
- * \retval negative negated errno on error
+ * Return:
+ * * %0 on success
+ * * %-ENODEV OST index does not exist on file system
+ * * %-EINVAL requested OST index is invalid
+ * * %negative negated errno on error
*/
static int lod_alloc_ost_list(const struct lu_env *env, struct lod_object *lo,
struct dt_object **stripe, __u32 *ost_indices,
}
/**
- * Allocate a striping on a predefined set of OSTs.
+ * lod_ost_alloc_specific() - Allocate a striping on a predefined set of OSTs.
+ * @env: execution environment for this thread
+ * @lo: LOD object
+ * @stripe: striping created [out]
+ * @ost_indices: ost indices of striping created [out]
+ * @flags: not used
+ * @th: transaction handle
+ * @comp_idx: index of ldo_comp_entries
+ * @reserve: space to reserve on the target device
*
* Allocates new layout starting from OST index in lo->ldo_stripe_offset.
* Full OSTs are not considered. The exact order of OSTs is not important and
* release the stripes allocated. All the internal structures are protected,
* but no concurrent allocation is allowed on the same objects.
*
- * \param[in] env execution environment for this thread
- * \param[in] lo LOD object
- * \param[out] stripe striping created
- * \param[out] ost_indices ost indices of striping created
- * \param[in] flags not used
- * \param[in] th transaction handle
- * \param[in] comp_idx index of ldo_comp_entries
- *
- * \retval 0 on success
- * \retval -ENOSPC if no OST objects are available at all
- * \retval -EFBIG if not enough OST objects are found
- * \retval -EINVAL requested offset is invalid
- * \retval negative errno on failure
+ * Return:
+ * * %0 on success
+ * * %-ENOSPC if no OST objects are available at all
+ * * %-EFBIG if not enough OST objects are found
+ * * %-EINVAL requested offset is invalid
+ * * %negative errno on failure
*/
static int lod_ost_alloc_specific(const struct lu_env *env,
struct lod_object *lo,
#endif
/**
- * Calculate penalties per-ost in a pool
+ * lod_pool_qos_penalties_calc() - Calculate penalties per-ost in a pool
+ * @lod: lod_device
+ * @pool: pool_desc
*
* The algorithm is similar to ltd_qos_penalties_calc(), but much simpler,
* just considering the space of each OST in this pool.
*
- * \param[in] lod lod_device
- * \param[in] pool pool_desc
- *
- * \retval 0 on success
- * \retval -EAGAIN the number of OSTs isn't enough or all tgt spaces are
- * almost the same
+ * Return:
+ * * %0 on success
+ * * %-EAGAIN the number of OSTs isn't enough or all tgt spaces are almost the
+ * same
*/
static int lod_pool_qos_penalties_calc(struct lod_device *lod,
struct lod_pool_desc *pool)
}
/**
- * Allocate a striping using an algorithm with weights.
+ * lod_ost_alloc_qos() - Allocate a striping using an algorithm with weights.
+ * @env: execution environment for this thread
+ * @lo: LOD object
+ * @stripe: striping created
+ * @ost_indices: ost indices of striping created
+ * @flags: 0 or LOD_USES_DEFAULT_STRIPE
+ * @th: transaction handle
+ * @comp_idx: index of ldo_comp_entries
+ * @reserve: space to reserve on the target device
*
* 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
* 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[out] ost_indices ost indices of striping created
- * \param[in] flags 0 or LOD_USES_DEFAULT_STRIPE
- * \param[in] th transaction handle
- * \param[in] comp_idx index of ldo_comp_entries
- *
- * \retval 0 on success
- * \retval -EAGAIN not enough OSTs are found for specified stripe count
- * \retval -EINVAL requested OST index is invalid
- * \retval negative errno on failure
+ * Return:
+ * * %0 on success
+ * * %-EAGAIN not enough OSTs are found for specified stripe count
+ * * %-EINVAL requested OST index is invalid
+ * * %negative errno on failure
*/
static int lod_ost_alloc_qos(const struct lu_env *env, struct lod_object *lo,
struct dt_object **stripe, __u32 *ost_indices,
}
/**
- * Allocate a striping using an algorithm with weights.
+ * lod_mdt_alloc_qos() - Allocate a striping using an algorithm with weights.
+ * @env: execution environment for this thread
+ * @lo: LOD object
+ * @stripe_idx: starting stripe index to allocate, if it's not 0,
+ * we are restriping directory
+ * @stripe_count: total stripe count
+ * @stripes: striping created
*
* The function allocates remote MDT objects to create a striping, the first
* object was already allocated on current MDT to ensure master object and
* An MDT 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[in] stripe_idx starting stripe index to allocate, if it's not
- * 0, we are restriping directory
- * \param[in] stripe_count total stripe count
- * \param[out] stripes striping created
- *
- * \retval positive stripes allocated, and it should be equal to
- * lo->ldo_dir_stripe_count
- * \retval -EAGAIN not enough tgts are found for specified stripe count
- * \retval -EINVAL requested MDT index is invalid
- * \retval negative errno on failure
+ * Return:
+ * * %positive stripes allocated, and it should be equal to
+ * lo->ldo_dir_stripe_count
+ * * %-EAGAIN not enough tgts are found for specified stripe count
+ * * %-EINVAL requested MDT index is invalid
+ * * %negative errno on failure
*/
int lod_mdt_alloc_qos(const struct lu_env *env, struct lod_object *lo,
struct dt_object **stripes, u32 stripe_idx,
}
/**
- * Check stripe count the caller can use.
+ * lod_get_stripe_count_plain() - Check stripe count the caller can use.
+ * @lod: LOD device
+ * @lo: The lod_object
+ * @stripe_count: count the caller would like to use
+ * @overstriping: if overstriping is allowed (overstriping is allowing more
+ * stripes than available target)
+ * @flags: Indicates if user specifed stripe count is to be used for default
*
* For new layouts (no initialized components), check the total size of the
* layout against the maximum EA size from the backing file system. This
* Find the maximal possible stripe count not greater than \a stripe_count.
* If the provided stripe count is 0, then the filesystem's default is used.
*
- * \param[in] lod LOD device
- * \param[in] lo The lod_object
- * \param[in] comp_idx The component id, which the amount of stripes is
- calculated for
- * \param[in] stripe_count count the caller would like to use
- *
- * \retval the maximum usable stripe count
+ * Returns the maximum usable stripe count
*/
__u16 lod_get_stripe_count_plain(struct lod_device *lod, struct lod_object *lo,
__u16 stripe_count, bool overstriping,
}
/**
- * Create in-core respresentation for a fully-defined striping
+ * lod_use_defined_striping() - Create in-core respresentation for a
+ * fully-defined striping
+ * @env: execution environment for this thread
+ * @mo: LOD object
+ * @buf: buffer containing the striping
*
* When the caller passes a fully-defined striping (i.e. everything including
* OST object FIDs are defined), then we still need to instantiate LU-cache
* with the objects representing the stripes defined. This function completes
* that task.
*
- * \param[in] env execution environment for this thread
- * \param[in] mo LOD object
- * \param[in] buf buffer containing the striping
- *
- * \retval 0 on success
- * \retval negative negated errno on error
+ * Return:
+ * * %0 on success
+ * * %negative negated errno on error
*/
int lod_use_defined_striping(const struct lu_env *env,
struct lod_object *mo,
}
/**
- * Parse suggested striping configuration.
+ * lod_qos_parse_config() - Parse suggested striping configuration.
+ * @env: execution environment for this thread
+ * @lo: LOD object
+ * @buf: buffer containing the striping
*
* The caller gets a suggested striping configuration from a number of sources
* including per-directory default and applications. Then it needs to verify
* called concurrently against the same object. It's OK to provide a
* fully-defined striping.
*
- * \param[in] env execution environment for this thread
- * \param[in] lo LOD object
- * \param[in] buf buffer containing the striping
- *
- * \retval 0 on success
- * \retval negative negated errno on error
+ * Return:
+ * * %0 on success
+ * * %negative negated errno on error
*/
int lod_qos_parse_config(const struct lu_env *env, struct lod_object *lo,
const struct lu_buf *buf)
RETURN(rc);
}
-/**
+/*
* prepare enough OST avoidance bitmap space
*/
static int lod_prepare_avoidance(const struct lu_env *env,
return 0;
}
-/**
+/*
* Collect information of used OSTs and OSSs in the overlapped components
* of other mirrors
*/
}
/**
- * Create a striping for an object.
+ * lod_qos_prep_create() - Create a striping for an object.
+ * @env: execution environment for this thread
+ * @lo: LOD object
+ * @attr: attributes OST objects will be declared with
+ * @th: transaction handle
+ * @comp_idx: index of ldo_comp_entries
+ * @reserve: space to reserve on target device
*
* The function creates a new striping for the object. The function tries QoS
* algorithm first unless free space is distributed evenly among OSTs, but
* serialized). The caller must ensure no concurrent calls to the function
* are made against the same object.
*
- * \param[in] env execution environment for this thread
- * \param[in] lo LOD object
- * \param[in] attr attributes OST objects will be declared with
- * \param[in] th transaction handle
- * \param[in] comp_idx index of ldo_comp_entries
- *
- * \retval 0 on success
- * \retval negative negated errno on error
+ * Return:
+ * * %0 on success
+ * * %negative negated errno on error
*/
int lod_qos_prep_create(const struct lu_env *env, struct lod_object *lo,
struct lu_attr *attr, struct thandle *th,