Skip to contentSkip to conversation

Staging: lustre: Declare as static and remove unused code

PATCH New Shraddha Barke 1 participant 4 messages Nov 1, 2015 Staging

lore
Share & tools
lore
#0 lore raw

v2 cover Staging: lustre: Declare as static and remove unused code

These patches declare local functions as static and remove unused code.

Shraddha Barke (3):
Staging: lustre: ptlrpc: Remove unused function declarations
Staging: lustre: obdclass: Declare local function cl_lock_mutex_try as
static
Staging: lustre: libcfs: Declare local structures as static

 drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h | 7 -------
 drivers/staging/lustre/lustre/libcfs/hash.c               | 21 ---------------------
 drivers/staging/lustre/lustre/obdclass/cl_lock.c          | 3 +--
 drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h    | 3 ---
 4 files changed, 1 insertions(+), 33 deletions(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH v2 1/3 Staging: lustre: ptlrpc: Remove unused function declarations

Functions ptlrpc_handle_failed_import and ptlrpc_lprocfs_do_request_stat have been declared but not used. Thus drop the declarations.

---
Changes in v2-
No change.

 drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +0 -3
index ab6c458..833ed94 100644
@@ -73,7 +73,6 @@ void ptlrpc_request_handle_notconn(struct ptlrpc_request *);
 void lustre_assert_wire_constants(void);
 int ptlrpc_import_in_recovery(struct obd_import *imp);
 int ptlrpc_set_import_discon(struct obd_import *imp, __u32 conn_cnt);
-void ptlrpc_handle_failed_import(struct obd_import *imp);
 int ptlrpc_replay_next(struct obd_import *imp, int *inflight);
 void ptlrpc_initiate_recovery(struct obd_import *imp);
 
@@ -88,8 +87,6 @@ void ptlrpc_ldebugfs_register_service(struct dentry *debugfs_entry,
 				      struct ptlrpc_service *svc);
 void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc);
 void ptlrpc_lprocfs_rpc_sent(struct ptlrpc_request *req, long amount);
-void ptlrpc_lprocfs_do_request_stat(struct ptlrpc_request *req,
-				     long q_usec, long work_usec);
 
 /* NRS */
 
Signature · 1 line
2.1.4
#2 lore raw

PATCH v2 2/3 Staging: lustre: obdclass: Declare local function cl_lock_mutex_try as static

In reply to Shraddha Barke

Function cl_lock_mutex_try has been used only in this particular file. Thus declare the function as static.

---
Changes in v2-
No change

 drivers/staging/lustre/lustre/obdclass/cl_lock.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/lustre/lustre/obdclass/cl_lock.c +1 -2
index 5621beb..1836dc0 100644
@@ -687,7 +687,7 @@ EXPORT_SYMBOL(cl_lock_mutex_get);
  *
  * \see cl_lock_mutex_get()
  */
-int cl_lock_mutex_try(const struct lu_env *env, struct cl_lock *lock)
+static int cl_lock_mutex_try(const struct lu_env *env, struct cl_lock *lock)
 {
 	int result;
 
@@ -705,7 +705,6 @@ int cl_lock_mutex_try(const struct lu_env *env, struct cl_lock *lock)
 		result = -EBUSY;
 	return result;
 }
-EXPORT_SYMBOL(cl_lock_mutex_try);
 
 /**
  {* Unlocks cl_lock object.
Signature · 1 line
2.1.4
#3 lore raw

PATCH v2 3/3 Staging: lustre: libcfs: Remove unused functions

In reply to Shraddha Barke

The functions cfs_hash_bd_findadd_locked and cfs_hash_bd_finddel_locked are not used anywhere. Thus remove these functions.

---
Changes in v2-
Fix commit message.

 .../lustre/include/linux/libcfs/libcfs_hash.h       |  7 -------
 drivers/staging/lustre/lustre/libcfs/hash.c         | 21 ---------------------
 2 files changed, 28 deletions(-)
drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h +0 -7
index 70b8b29..d29e359 100644
@@ -641,13 +641,6 @@ cfs_hash_bd_lookup_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd,
 struct hlist_node *
 cfs_hash_bd_peek_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd,
 			const void *key);
-struct hlist_node *
-cfs_hash_bd_findadd_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd,
-			   const void *key, struct hlist_node *hnode,
-			   int insist_add);
-struct hlist_node *
-cfs_hash_bd_finddel_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd,
-			   const void *key, struct hlist_node *hnode);
 
 /**
  * operations on cfs_hash bucket (bd: bucket descriptor),
drivers/staging/lustre/lustre/libcfs/hash.c +0 -21
index 0308744..ae6c646 100644
@@ -680,27 +680,6 @@ cfs_hash_bd_peek_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, const void
 }
 EXPORT_SYMBOL(cfs_hash_bd_peek_locked);
 
-struct hlist_node *
-cfs_hash_bd_findadd_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd,
-			   const void *key, struct hlist_node *hnode,
-			   int noref)
-{
-	return cfs_hash_bd_lookup_intent(hs, bd, key, hnode,
-					 (!noref * CFS_HS_LOOKUP_MASK_REF) |
-					 CFS_HS_LOOKUP_IT_ADD);
-}
-EXPORT_SYMBOL(cfs_hash_bd_findadd_locked);
-
-struct hlist_node *
-cfs_hash_bd_finddel_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd,
-			   const void *key, struct hlist_node *hnode)
-{
-	/* hnode can be NULL, we find the first item with @key */
-	return cfs_hash_bd_lookup_intent(hs, bd, key, hnode,
-					 CFS_HS_LOOKUP_IT_FINDDEL);
-}
-EXPORT_SYMBOL(cfs_hash_bd_finddel_locked);
-
 static void
 cfs_hash_multi_bd_lock(struct cfs_hash *hs, struct cfs_hash_bd *bds,
 		       unsigned n, int excl)
Signature · 1 line
2.1.4