* 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;