Staging: lustre: Declare as static and remove unused code
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: Remove unused structures
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
PATCH 3/3 Staging: lustre: libcfs: Remove unused structures
The structures cfs_hash_bd_findadd_locked and -cfs_hash_bd_finddel_locked are not used anywhere. Thus remove these structures.
--- .../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
@@ -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
@@ -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
PATCH 1/3 Staging: lustre: ptlrpc: Remove unused function declarations
In reply to Shraddha BarkeFunctions ptlrpc_handle_failed_import and ptlrpc_lprocfs_do_request_stat have been declared but not used. Thus drop the declarations.
--- drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h | 3 --- 1 file changed, 3 deletions(-)
drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +0 -3
@@ -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
PATCH 2/3 Staging: lustre: obdclass: Declare local function cl_lock_mutex_try as static
In reply to Shraddha BarkeFunction cl_lock_mutex_try has been used only in this particular file. Thus declare the function as static.Also remove the corresponding declaration from header file.
--- 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
@@ -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
Re: [Outreachy kernel] [PATCH 3/3] Staging: lustre: libcfs: Remove unused structures
In reply to Shraddha BarkeQuoted 2 lines · Shraddha Barke
The structures
cfs_hash_bd_findadd_lockedand -cfs_hash_bd_finddel_locked are not used anywhere. Thus remove these structures.
These look like functions, not structures. Also there is a strange - in front of cfs_hash_bd_finddel_locked in the commit message.
julia
Quoted 67 lines
Signed-off-by Shraddha Barke <[email protected]>--- .../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@@ -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@@ -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 · 8 lines
2.1.4 -- You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1446376246-6959-2-git-send-email-shraddha.6596%40gmail.com. For more options, visit https://groups.google.com/d/optout.