Staging: lustre: Code cleanups
cover Staging: lustre: Code cleanups
From: Shraddha Barke <[email protected]>
These patches remove unused code and declare functions as static
Shraddha Barke (5):
Staging: lustre: obdclass: Declare cl_env_peek as static
Staging: lustre: libcfs: Remove unused libcfs_debug_set_level
Staging: lustre: osc: Declare as static
Staging: lustre: osc: Declare osc_attr_set as static
Staging: lustre: obdclass: Declare lu_site_hash_ops as static
drivers/staging/lustre/lustre/libcfs/debug.c | 7 ------- drivers/staging/lustre/lustre/obdclass/cl_object.c | 3 +-- drivers/staging/lustre/lustre/obdclass/lu_object.c | 2 +- drivers/staging/lustre/lustre/osc/osc_cache.c | 10 +++++----- drivers/staging/lustre/lustre/osc/osc_object.c | 4 ++-- 5 files changed, 9 insertions(+), 17 deletions(-)
Signature · 1 line
2.1.4
PATCH 1/5 Staging: lustre: obdclass: Declare cl_env_peek as static
From: Shraddha Barke <[email protected]>
Declare cl_env_peek as static since it is used only in this file. Also remove the EXPORT SYMBOL.
--- drivers/staging/lustre/lustre/obdclass/cl_object.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/lustre/lustre/obdclass/cl_object.c +1 -2
@@ -704,7 +704,7 @@ static inline struct cl_env *cl_env_container(struct lu_env *env) return container_of(env, struct cl_env, ce_lu); } -struct lu_env *cl_env_peek (int *refcheck) +static struct lu_env *cl_env_peek (int *refcheck) {struct lu_env *env;struct cl_env *cle;
@@ -724,7 +724,6 @@ struct lu_env *cl_env_peek(int *refcheck)CDEBUG (D_OTHER ,"%d@%p\n" , cle ? cle->ce_ref :0 , cle);return env; } -EXPORT_SYMBOL (cl_env_peek);/** * Returns lu_env: if there already is an environment associated with the
Signature · 1 line
2.1.4
PATCH 2/5 Staging: lustre: libcfs: Remove unused libcfs_debug_set_level
In reply to ShraddhaFrom: Shraddha Barke <[email protected]>
Function libcfs_debug_set_level is defined but not used. Thus remove it.
--- drivers/staging/lustre/lustre/libcfs/debug.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/staging/lustre/lustre/libcfs/debug.c +0 -7
@@ -557,10 +557,3 @@ int libcfs_debug_mark_buffer(const char *text)#undef DEBUG_SUBSYSTEM#define DEBUG_SUBSYSTEM S_LNET - -void libcfs_debug_set_level (unsigned int debug_level) -{ -pr_warn ("Lustre: Setting portals debug level to %08x\n" , - debug_level); - libcfs_debug = debug_level; -}
Signature · 1 line
2.1.4
PATCH 3/5 Staging: lustre: osc: Declare as static
In reply to ShraddhaFrom: Shraddha Barke <[email protected]>
Declare osc_extent_find and osc_unreserve_grant as static since they are used only in this particular file.
--- drivers/staging/lustre/lustre/osc/osc_cache.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/lustre/lustre/osc/osc_cache.c +5 -5
@@ -619,9 +619,9 @@ static inline int overlapped(struct osc_extent *ex1, struct osc_extent *ex2)* Find or create an extent which includes @index, core function to manage * extent tree. */ -struct osc_extent *osc_extent_find (const struct lu_env *env, -struct osc_object *obj,pgoff_t index, -int *grants) +static struct osc_extent *osc_extent_find (const struct lu_env *env, +struct osc_object *obj,pgoff_t index, +int *grants) {struct client_obd *cli =osc_cli (obj);
@@ -1420,8 +1420,8 @@ static void __osc_unreserve_grant(struct client_obd *cli, } } -void osc_unreserve_grant (struct client_obd *cli, -unsigned int reserved,unsigned int unused) +static void osc_unreserve_grant (struct client_obd *cli, +unsigned int reserved,unsigned int unused) {client_obd_list_lock (&cli->cl_loi_list_lock);__osc_unreserve_grant (cli, reserved, unused);
Signature · 1 line
2.1.4
PATCH 4/5 Staging: lustre: osc: Declare osc_attr_set as static
In reply to ShraddhaFrom: Shraddha Barke <[email protected]>
osc_attr_set is used only in this particular file. Thus declare it as static.
--- drivers/staging/lustre/lustre/osc/osc_object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/lustre/lustre/osc/osc_object.c +2 -2
@@ -158,8 +158,8 @@ static int osc_attr_get(const struct lu_env *env, struct cl_object *obj,return 0 ; } -int osc_attr_set (const struct lu_env *env,struct cl_object *obj, -const struct cl_attr *attr,unsigned valid) +static int osc_attr_set (const struct lu_env *env,struct cl_object *obj, +const struct cl_attr *attr,unsigned valid) {struct lov_oinfo *oinfo =cl2osc (obj)->oo_oinfo;struct ost_lvb *lvb = &oinfo->loi_lvb;
Signature · 1 line
2.1.4
PATCH 5/5 Staging: lustre: obdclass: Declare lu_site_hash_ops as static
In reply to ShraddhaFrom: Shraddha Barke <[email protected]>
lu_site_hash_ops is used only in this particular file. Thus declare it as static.
--- drivers/staging/lustre/lustre/obdclass/lu_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/obdclass/lu_object.c +1 -1
@@ -916,7 +916,7 @@ static void lu_obj_hop_put_locked(struct cfs_hash *hs, struct hlist_node *hnode)LBUG ();/* we should never called it */ } -struct cfs_hash_ops lu_site_hash_ops = { +static struct cfs_hash_ops lu_site_hash_ops = { .hs_hash = lu_obj_hop_hash, .hs_key = lu_obj_hop_key, .hs_keycmp = lu_obj_hop_keycmp,
Signature · 1 line
2.1.4