Static analysis shows that a number of functions
could be made static. This patch declares several
functions in lmv, lod, and lov static.
Also, remove one unused function: lov_lsm_entry()
Another function is intentionally unused for
debugging purposes. It was detected by static
analysis, but it has been left untouched.
Lustre-change: https://review.whamcloud.com/51479
Lustre-commit:
78605b74a56a5338aa93bbf394fe35d0f7c17c5b
Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: If409226ea201587c7f95d4a65ffaef72671b5ac2
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54627
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
le16_to_cpu(comp->lcm_entry_count) - 1); \
entry++)
-int lod_erase_dom_stripe(struct lov_comp_md_v1 *comp_v1,
- struct lov_comp_md_entry_v1 *dom_ent)
+static int lod_erase_dom_stripe(struct lov_comp_md_v1 *comp_v1,
+ struct lov_comp_md_entry_v1 *dom_ent)
{
struct lov_comp_md_entry_v1 *ent;
__u16 entries;
return d->lod_dom_stripesize_cur_kb << 10;
}
-int lod_dom_stripesize_choose(const struct lu_env *env, struct lod_device *d,
- struct lov_comp_md_v1 *comp_v1,
- struct lov_comp_md_entry_v1 *dom_ent,
- __u32 stripe_size)
+static int lod_dom_stripesize_choose(const struct lu_env *env,
+ struct lod_device *d,
+ struct lov_comp_md_v1 *comp_v1,
+ struct lov_comp_md_entry_v1 *dom_ent,
+ __u32 stripe_size)
{
struct lov_comp_md_entry_v1 *ent;
struct lu_extent *dom_ext, *ext;
* \retval 0 on success
* \retval negative if failed
*/
-int lod_alloc_foreign_lmv(struct lod_object *lo, size_t size)
+static int lod_alloc_foreign_lmv(struct lod_object *lo, size_t size)
{
OBD_ALLOC_LARGE(lo->ldo_foreign_lmv, size);
if (lo->ldo_foreign_lmv == NULL)
*
* \param[in] lo object
*/
-void lod_free_foreign_lmv(struct lod_object *lo)
+static void lod_free_foreign_lmv(struct lod_object *lo)
{
if (lo->ldo_foreign_lmv != NULL)
OBD_FREE_LARGE(lo->ldo_foreign_lmv, lo->ldo_foreign_lmv_size);
/**
* prepare enough OST avoidance bitmap space
*/
-int lod_prepare_avoidance(const struct lu_env *env, struct lod_object *lo)
+static int lod_prepare_avoidance(const struct lu_env *env,
+ struct lod_object *lo)
{
struct lod_device *lod = lu2lod_dev(lo->ldo_obj.do_lu.lo_dev);
struct lod_avoid_guide *lag = &lod_env_info(env)->lti_avoid;
* Collect information of used OSTs and OSSs in the overlapped components
* of other mirrors
*/
-void lod_collect_avoidance(struct lod_object *lo, struct lod_avoid_guide *lag,
- int comp_idx)
+static void lod_collect_avoidance(struct lod_object *lo,
+ struct lod_avoid_guide *lag,
+ int comp_idx)
{
struct lod_device *lod = lu2lod_dev(lo->ldo_obj.do_lu.lo_dev);
struct lod_layout_component *lod_comp = &lo->ldo_comp_entries[comp_idx];
* Preferred mirror is initialized by the preferred
* bit of lsme. It can be changed when the preferred
* is inaccessible.
- * In order to make lov_lsm_entry() return the same
- * mirror in the same IO context, it's only possible
- * to change the preferred mirror when the
- * lo_active_ios reaches zero.
*/
int lo_preferred_mirror;
/**
const struct lu_object_header *hdr,
struct lu_device *dev);
-int lov_lsm_entry(const struct lov_stripe_md *lsm, __u64 offset);
int lov_io_layout_at(struct lov_io *lio, __u64 offset);
#define lov_foreach_target(lov, var) \
}
}
-int lov_lsm_entry(const struct lov_stripe_md *lsm, __u64 offset)
-{
- int i;
-
- for (i = 0; i < lsm->lsm_entry_count; i++) {
- struct lov_stripe_md_entry *lse = lsm->lsm_entries[i];
-
- if ((offset >= lse->lsme_extent.e_start &&
- offset < lse->lsme_extent.e_end) ||
- (offset == OBD_OBJECT_EOF &&
- lse->lsme_extent.e_end == OBD_OBJECT_EOF))
- return i;
- }
-
- return -1;
-}
-
/**
* lmm_layout_gen overlaps stripe_offset field, it needs to be reset back when
* sending to MDT for passing striping checks
RETURN(0);
}
-int lov_io_lru_reserve(const struct lu_env *env,
- const struct cl_io_slice *ios, loff_t pos, size_t bytes)
+static int lov_io_lru_reserve(const struct lu_env *env,
+ const struct cl_io_slice *ios, loff_t pos,
+ size_t bytes)
{
struct lov_io *lio = cl2lov_io(env, ios);
struct lov_stripe_md *lsm = lio->lis_object->lo_lsm;
static int lov_notify(struct obd_device *obd, struct obd_device *watched,
enum obd_notify_event ev);
-int lov_connect_osc(struct obd_device *obd, u32 index, int activate,
- struct obd_connect_data *data)
+static int lov_connect_osc(struct obd_device *obd, u32 index, int activate,
+ struct obd_connect_data *data)
{
struct lov_obd *lov = &obd->u.lov;
struct obd_uuid *tgt_uuid;