From 66d942b0a55feeb8bfb23179dac0c424d4cc089e Mon Sep 17 00:00:00 2001 From: Aurelien Degremont Date: Mon, 4 May 2020 11:58:40 -0700 Subject: [PATCH] LU-12236 gss: remove unused code in gss_svc_upcall.c Delete rsc_flush() related functions which are never used. This patch is back-ported from the following one: Lustre-commit: 25b0bf5a23032394055b7b94b3169f5cf4068570 Lustre-change: https://review.whamcloud.com/34794 Test-Parameters: envdefinitions=SHARED_KEY=true testlist=sanity,recovery-small,sanity-sec Change-Id: Iedd6339b5fafdea81147c83e5f0499fa3ad60251 Signed-off-by: Aurelien Degremont Reviewed-on: https://review.whamcloud.com/38476 Tested-by: jenkins Reviewed-by: Sebastien Buisson Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/ptlrpc/gss/gss_svc_upcall.c | 79 -------------------------------------- 1 file changed, 79 deletions(-) diff --git a/lustre/ptlrpc/gss/gss_svc_upcall.c b/lustre/ptlrpc/gss/gss_svc_upcall.c index a1058b1..5e88332 100644 --- a/lustre/ptlrpc/gss/gss_svc_upcall.c +++ b/lustre/ptlrpc/gss/gss_svc_upcall.c @@ -735,85 +735,6 @@ static struct rsc *rsc_update(struct rsc *new, struct rsc *old) * rsc cache flush * ****************************************/ -typedef int rsc_entry_match(struct rsc *rscp, long data); - -static void rsc_flush(rsc_entry_match *match, long data) -{ -#ifdef HAVE_CACHE_HEAD_HLIST - struct cache_head *ch = NULL; - struct hlist_head *head; -#else - struct cache_head **ch; -#endif - struct rsc *rscp; - int n; - ENTRY; - - write_lock(&rsc_cache.hash_lock); - for (n = 0; n < RSC_HASHMAX; n++) { -#ifdef HAVE_CACHE_HEAD_HLIST - head = &rsc_cache.hash_table[n]; - hlist_for_each_entry(ch, head, cache_list) { - rscp = container_of(ch, struct rsc, h); -#else - for (ch = &rsc_cache.hash_table[n]; *ch;) { - rscp = container_of(*ch, struct rsc, h); -#endif - - if (!match(rscp, data)) { -#ifndef HAVE_CACHE_HEAD_HLIST - ch = &((*ch)->next); -#endif - continue; - } - - /* it seems simply set NEGATIVE doesn't work */ -#ifdef HAVE_CACHE_HEAD_HLIST - hlist_del_init(&ch->cache_list); -#else - *ch = (*ch)->next; - rscp->h.next = NULL; -#endif - cache_get(&rscp->h); - set_bit(CACHE_NEGATIVE, &rscp->h.flags); - COMPAT_RSC_PUT(&rscp->h, &rsc_cache); - rsc_cache.entries--; - } - } - write_unlock(&rsc_cache.hash_lock); - EXIT; -} - -static int match_uid(struct rsc *rscp, long uid) -{ - if ((int) uid == -1) - return 1; - return ((int) rscp->ctx.gsc_uid == (int) uid); -} - -static int match_target(struct rsc *rscp, long target) -{ - return (rscp->target == (struct obd_device *) target); -} - -static inline void rsc_flush_uid(int uid) -{ - if (uid == -1) - CWARN("flush all gss contexts...\n"); - - rsc_flush(match_uid, (long) uid); -} - -static inline void rsc_flush_target(struct obd_device *target) -{ - rsc_flush(match_target, (long) target); -} - -void gss_secsvc_flush(struct obd_device *target) -{ - rsc_flush_target(target); -} - static struct rsc *gss_svc_searchbyctx(rawobj_t *handle) { struct rsc rsci; -- 1.8.3.1