Whamcloud - gitweb
LU-6245 libcfs: move lucache from libcfs to lustre 83/13783/8
authorJames Simmons <uja.ornl@gmail.com>
Mon, 9 Mar 2015 20:06:38 +0000 (16:06 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 25 Mar 2015 14:38:03 +0000 (14:38 +0000)
The lucache handling in libcfs is used only for
idmap handling in the obdclass and mdt layers.
Since this is the case we can move the lucache
handling into the lustre stack. As a bonus the
lucache will only be built when we enable server
support instead of the current state of it being
built for clients as well.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I812f2c5952ea79bd023435e5fac1955316c9c59f
Reviewed-on: http://review.whamcloud.com/13783
Tested-by: Jenkins
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
12 files changed:
libcfs/include/libcfs/Makefile.am
libcfs/libcfs/Makefile.in
lustre/include/Makefile.am
lustre/include/upcall_cache.h [moved from libcfs/include/libcfs/lucache.h with 55% similarity]
lustre/mdt/autoMakefile.am
lustre/mdt/mdt_identity.c
lustre/mdt/mdt_idmap.c
lustre/mdt/mdt_internal.h
lustre/obdclass/Makefile.in
lustre/obdclass/autoMakefile.am
lustre/obdclass/idmap.c
lustre/obdclass/upcall_cache.c [moved from libcfs/libcfs/upcall_cache.c with 66% similarity]

index d5b179b..cdbf5e4 100644 (file)
@@ -28,7 +28,6 @@ EXTRA_DIST = \
        libcfs_workitem.h \
        libcfsutil.h \
        list.h \
-       lucache.h \
        types.h \
        user-bitops.h \
        user-crypto.h \
index bb9e551..f2fb3a3 100644 (file)
@@ -15,7 +15,7 @@ libcfs-linux-objs := $(addprefix linux/,$(libcfs-linux-objs))
 
 libcfs-all-objs := debug.o fail.o nidstrings.o module.o tracefile.o \
                   watchdog.o libcfs_string.o hash.o kernel_user_comm.o \
-                  prng.o workitem.o upcall_cache.o libcfs_cpu.o \
+                  prng.o workitem.o libcfs_cpu.o \
                   libcfs_mem.o libcfs_lock.o heap.o
 
 libcfs-objs := $(libcfs-linux-objs) $(libcfs-all-objs)
index 25adaa8..98c0756 100644 (file)
@@ -91,4 +91,5 @@ EXTRA_DIST = \
        obd_class.h \
        obd.h \
        obd_support.h \
-       obd_target.h
+       obd_target.h \
+       upcall_cache.h
similarity index 55%
rename from libcfs/include/libcfs/lucache.h
rename to lustre/include/upcall_cache.h
index 5158645..46cfe65 100644 (file)
@@ -34,8 +34,8 @@
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
-#ifndef _LUCACHE_H
-#define _LUCACHE_H
+#ifndef _UPCALL_CACHE_H
+#define _UPCALL_CACHE_H
 
 #include <libcfs/libcfs.h>
 #include <lnet/types.h>
 #define UC_CACHE_IS_EXPIRED(i)      ((i)->ue_flags & UC_CACHE_EXPIRED)
 #define UC_CACHE_IS_VALID(i)        ((i)->ue_flags == 0)
 
-#define UC_CACHE_SET_NEW(i)         (i)->ue_flags |= UC_CACHE_NEW
-#define UC_CACHE_SET_INVALID(i)     (i)->ue_flags |= UC_CACHE_INVALID
-#define UC_CACHE_SET_ACQUIRING(i)   (i)->ue_flags |= UC_CACHE_ACQUIRING
-#define UC_CACHE_SET_EXPIRED(i)     (i)->ue_flags |= UC_CACHE_EXPIRED
-#define UC_CACHE_SET_VALID(i)       (i)->ue_flags = 0
+#define UC_CACHE_SET_NEW(i)         ((i)->ue_flags |= UC_CACHE_NEW)
+#define UC_CACHE_SET_INVALID(i)     ((i)->ue_flags |= UC_CACHE_INVALID)
+#define UC_CACHE_SET_ACQUIRING(i)   ((i)->ue_flags |= UC_CACHE_ACQUIRING)
+#define UC_CACHE_SET_EXPIRED(i)     ((i)->ue_flags |= UC_CACHE_EXPIRED)
+#define UC_CACHE_SET_VALID(i)       ((i)->ue_flags = 0)
 
-#define UC_CACHE_CLEAR_NEW(i)       (i)->ue_flags &= ~UC_CACHE_NEW
-#define UC_CACHE_CLEAR_ACQUIRING(i) (i)->ue_flags &= ~UC_CACHE_ACQUIRING
-#define UC_CACHE_CLEAR_INVALID(i)   (i)->ue_flags &= ~UC_CACHE_INVALID
-#define UC_CACHE_CLEAR_EXPIRED(i)   (i)->ue_flags &= ~UC_CACHE_EXPIRED
+#define UC_CACHE_CLEAR_NEW(i)       ((i)->ue_flags &= ~UC_CACHE_NEW)
+#define UC_CACHE_CLEAR_ACQUIRING(i) ((i)->ue_flags &= ~UC_CACHE_ACQUIRING)
+#define UC_CACHE_CLEAR_INVALID(i)   ((i)->ue_flags &= ~UC_CACHE_INVALID)
+#define UC_CACHE_CLEAR_EXPIRED(i)   ((i)->ue_flags &= ~UC_CACHE_EXPIRED)
 
 struct upcall_cache_entry;
 
 struct md_perm {
-        lnet_nid_t      mp_nid;
-        __u32           mp_perm;
+       lnet_nid_t      mp_nid;
+       uint32_t        mp_perm;
 };
 
 struct md_identity {
@@ -85,7 +85,7 @@ struct md_identity {
 
 struct upcall_cache_entry {
        struct list_head        ue_hash;
-       __u64                   ue_key;
+       uint64_t                ue_key;
        atomic_t                ue_refcount;
        int                     ue_flags;
        wait_queue_head_t       ue_waitq;
@@ -103,19 +103,19 @@ struct upcall_cache_entry {
 struct upcall_cache;
 
 struct upcall_cache_ops {
-        void            (*init_entry)(struct upcall_cache_entry *, void *args);
-        void            (*free_entry)(struct upcall_cache *,
-                                      struct upcall_cache_entry *);
-        int             (*upcall_compare)(struct upcall_cache *,
-                                          struct upcall_cache_entry *,
-                                          __u64 key, void *args);
-        int             (*downcall_compare)(struct upcall_cache *,
-                                            struct upcall_cache_entry *,
-                                            __u64 key, void *args);
-        int             (*do_upcall)(struct upcall_cache *,
-                                     struct upcall_cache_entry *);
-        int             (*parse_downcall)(struct upcall_cache *,
-                                          struct upcall_cache_entry *, void *);
+       void            (*init_entry)(struct upcall_cache_entry *, void *args);
+       void            (*free_entry)(struct upcall_cache *,
+                                     struct upcall_cache_entry *);
+       int             (*upcall_compare)(struct upcall_cache *,
+                                         struct upcall_cache_entry *,
+                                         __u64 key, void *args);
+       int             (*downcall_compare)(struct upcall_cache *,
+                                           struct upcall_cache_entry *,
+                                           __u64 key, void *args);
+       int             (*do_upcall)(struct upcall_cache *,
+                                    struct upcall_cache_entry *);
+       int             (*parse_downcall)(struct upcall_cache *,
+                                         struct upcall_cache_entry *, void *);
 };
 
 struct upcall_cache {
@@ -131,33 +131,28 @@ struct upcall_cache {
 };
 
 struct upcall_cache_entry *upcall_cache_get_entry(struct upcall_cache *cache,
-                                                  __u64 key, void *args);
+                                                 __u64 key, void *args);
 void upcall_cache_put_entry(struct upcall_cache *cache,
-                            struct upcall_cache_entry *entry);
+                           struct upcall_cache_entry *entry);
 int upcall_cache_downcall(struct upcall_cache *cache, __u32 err, __u64 key,
-                          void *args);
-void upcall_cache_flush_idle(struct upcall_cache *cache);
-void upcall_cache_flush_all(struct upcall_cache *cache);
+                         void *args);
+void upcall_cache_flush(struct upcall_cache *cache, int force);
+
+static inline void upcall_cache_flush_idle(struct upcall_cache *cache)
+{
+       upcall_cache_flush(cache, 0);
+}
+
+static inline void upcall_cache_flush_all(struct upcall_cache *cache)
+{
+       upcall_cache_flush(cache, 1);
+}
+
 void upcall_cache_flush_one(struct upcall_cache *cache, __u64 key, void *args);
 struct upcall_cache *upcall_cache_init(const char *name, const char *upcall,
-                                       struct upcall_cache_ops *ops);
+                                      struct upcall_cache_ops *ops);
 void upcall_cache_cleanup(struct upcall_cache *cache);
 
-#if 0
-struct upcall_cache_entry *upcall_cache_get_entry(struct upcall_cache *hash,
-                                                  __u64 key, __u32 primary,
-                                                  __u32 ngroups, __u32 *groups);
-void upcall_cache_put_entry(struct upcall_cache *hash,
-                            struct upcall_cache_entry *entry);
-int upcall_cache_downcall(struct upcall_cache *hash, __u32 err, __u64 key,
-                          __u32 primary, __u32 ngroups, __u32 *groups);
-void upcall_cache_flush_idle(struct upcall_cache *cache);
-void upcall_cache_flush_all(struct upcall_cache *cache);
-struct upcall_cache *upcall_cache_init(const char *name);
-void upcall_cache_cleanup(struct upcall_cache *hash);
-
-#endif
-
 /** @} ucache */
 
-#endif /* _LUCACHE_H */
+#endif /* _UPCALL_CACHE_H */
index d05b2d6..5b77469 100644 (file)
@@ -38,5 +38,5 @@ if MODULES
 modulefs_DATA = mdt$(KMODEXT)
 endif
 
-MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ 
+MOSTLYCLEANFILES := @MOSTLYCLEANFILES@
 EXTRA_DIST := $(mdt-objs:%.o=%.c) mdt_internal.h
index 1b23332..595a6d0 100644 (file)
@@ -57,7 +57,6 @@
 #include <linux/slab.h>
 
 #include <libcfs/libcfs.h>
-#include <libcfs/lucache.h>
 #include <obd.h>
 #include <obd_class.h>
 #include <obd_support.h>
index 6718079..d829beb 100644 (file)
@@ -57,7 +57,6 @@
 #include <linux/slab.h>
 
 #include <libcfs/libcfs.h>
-#include <libcfs/lucache.h>
 #include <obd.h>
 #include <obd_class.h>
 #include <obd_support.h>
index 16a390d..688b3d1 100644 (file)
@@ -49,7 +49,7 @@
 #define _MDT_INTERNAL_H
 
 
-#include <libcfs/lucache.h>
+#include <upcall_cache.h>
 #include <lustre_net.h>
 #include <lustre/lustre_idl.h>
 #include <obd_class.h>
index a8e589b..8a48593 100644 (file)
@@ -16,6 +16,7 @@ obdclass-all-objs += acl.o
 obdclass-all-objs += linkea.o
 
 @SERVER_TRUE@obdclass-all-objs += idmap.o
+@SERVER_TRUE@obdclass-all-objs += upcall_cache.o
 @SERVER_TRUE@obdclass-all-objs += lprocfs_jobstats.o
 @SERVER_TRUE@obdclass-all-objs += lprocfs_status_server.o
 @SERVER_TRUE@obdclass-all-objs += lu_ucred.o
@@ -30,6 +31,7 @@ EXTRA_DIST = $(obdclass-all-objs:.o=.c) llog_test.c llog_internal.h
 EXTRA_DIST += cl_internal.h local_storage.h
 
 @SERVER_FALSE@EXTRA_DIST += idmap.c
+@SERVER_FALSE@EXTRA_DIST += upcall_cache.c
 @SERVER_FALSE@EXTRA_DIST += lprocfs_jobstats.c
 @SERVER_FALSE@EXTRA_DIST += lprocfs_status_server.c
 @SERVER_FALSE@EXTRA_DIST += lu_ucred.c
index 66b7c25..f290acf 100644 (file)
@@ -1,21 +1,6 @@
 SUBDIRS = linux
 DIST_SUBDIRS = linux
 
-if LIBLUSTRE
-noinst_LIBRARIES = liblustreclass.a
-liblustreclass_a_SOURCES = class_obd.c debug.c genops.c statfs_pack.c uuid.c
-liblustreclass_a_SOURCES += lustre_handles.c lustre_peer.c lprocfs_status.c
-liblustreclass_a_SOURCES += obdo.c obd_config.c llog.c llog_obd.c llog_cat.c
-liblustreclass_a_SOURCES += llog_swab.c capa.c lprocfs_counters.c
-liblustreclass_a_SOURCES += lu_object.c cl_object.c lu_ref.c
-liblustreclass_a_SOURCES += cl_page.c cl_lock.c cl_io.c
-liblustreclass_a_SOURCES += #llog_ioctl.c rbtree.c
-liblustreclass_a_CPPFLAGS = $(LLCPPFLAGS) -I$(SYSIO)/include
-liblustreclass_a_CFLAGS = $(LLCFLAGS) -I$(SYSIO)/include
-
-endif
-
-
 if MODULES
 
 if LINUX
index 74d0229..8fc299d 100644 (file)
@@ -42,9 +42,8 @@
 
 #define DEBUG_SUBSYSTEM S_SEC
 
-#include <libcfs/lucache.h>
-
 #include <lustre_idmap.h>
+#include <upcall_cache.h>
 #include <md_object.h>
 #include <obd_support.h>
 
similarity index 66%
rename from libcfs/libcfs/upcall_cache.c
rename to lustre/obdclass/upcall_cache.c
index f3f8d2e..4d9ef1c 100644 (file)
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  *
- * libcfs/libcfs/upcall_cache.c
+ * lustre/obdclass/upcall_cache.c
  *
  * Supplementary groups cache.
  */
 #define DEBUG_SUBSYSTEM S_SEC
 
-#include <libcfs/lucache.h>
+#include <libcfs/libcfs.h>
 #include <lnet/types.h>
+#include <upcall_cache.h>
 
 static struct upcall_cache_entry *alloc_entry(struct upcall_cache *cache,
-                                              __u64 key, void *args)
+                                             __u64 key, void *args)
 {
        struct upcall_cache_entry *entry;
 
@@ -63,7 +64,7 @@ static struct upcall_cache_entry *alloc_entry(struct upcall_cache *cache,
 
 /* protected by cache lock */
 static void free_entry(struct upcall_cache *cache,
-                       struct upcall_cache_entry *entry)
+                      struct upcall_cache_entry *entry)
 {
        if (cache->uc_ops->free_entry)
                cache->uc_ops->free_entry(cache, entry);
@@ -75,29 +76,29 @@ static void free_entry(struct upcall_cache *cache,
 }
 
 static inline int upcall_compare(struct upcall_cache *cache,
-                                 struct upcall_cache_entry *entry,
-                                 __u64 key, void *args)
+                                struct upcall_cache_entry *entry,
+                                __u64 key, void *args)
 {
-        if (entry->ue_key != key)
-                return -1;
+       if (entry->ue_key != key)
+               return -1;
 
-        if (cache->uc_ops->upcall_compare)
-                return cache->uc_ops->upcall_compare(cache, entry, key, args);
+       if (cache->uc_ops->upcall_compare)
+               return cache->uc_ops->upcall_compare(cache, entry, key, args);
 
-        return 0;
+       return 0;
 }
 
 static inline int downcall_compare(struct upcall_cache *cache,
-                                   struct upcall_cache_entry *entry,
-                                   __u64 key, void *args)
+                                  struct upcall_cache_entry *entry,
+                                  __u64 key, void *args)
 {
-        if (entry->ue_key != key)
-                return -1;
+       if (entry->ue_key != key)
+               return -1;
 
-        if (cache->uc_ops->downcall_compare)
-                return cache->uc_ops->downcall_compare(cache, entry, key, args);
+       if (cache->uc_ops->downcall_compare)
+               return cache->uc_ops->downcall_compare(cache, entry, key, args);
 
-        return 0;
+       return 0;
 }
 
 static inline void get_entry(struct upcall_cache_entry *entry)
@@ -140,14 +141,14 @@ static int check_unlink_entry(struct upcall_cache *cache,
 }
 
 static inline int refresh_entry(struct upcall_cache *cache,
-                         struct upcall_cache_entry *entry)
+                        struct upcall_cache_entry *entry)
 {
-        LASSERT(cache->uc_ops->do_upcall);
-        return cache->uc_ops->do_upcall(cache, entry);
+       LASSERT(cache->uc_ops->do_upcall);
+       return cache->uc_ops->do_upcall(cache, entry);
 }
 
 struct upcall_cache_entry *upcall_cache_get_entry(struct upcall_cache *cache,
-                                                  __u64 key, void *args)
+                                                 __u64 key, void *args)
 {
        struct upcall_cache_entry *entry = NULL, *new = NULL, *next;
        struct list_head *head;
@@ -155,7 +156,7 @@ struct upcall_cache_entry *upcall_cache_get_entry(struct upcall_cache *cache,
        int rc, found;
        ENTRY;
 
-        LASSERT(cache);
+       LASSERT(cache);
 
        head = &cache->uc_hashtable[UC_CACHE_HASH_INDEX(key)];
 find_again:
@@ -193,16 +194,16 @@ find_again:
        }
        get_entry(entry);
 
-        /* acquire for new one */
-        if (UC_CACHE_IS_NEW(entry)) {
-                UC_CACHE_SET_ACQUIRING(entry);
-                UC_CACHE_CLEAR_NEW(entry);
+       /* acquire for new one */
+       if (UC_CACHE_IS_NEW(entry)) {
+               UC_CACHE_SET_ACQUIRING(entry);
+               UC_CACHE_CLEAR_NEW(entry);
                spin_unlock(&cache->uc_lock);
                rc = refresh_entry(cache, entry);
                spin_lock(&cache->uc_lock);
-                entry->ue_acquire_expire =
-                        cfs_time_shift(cache->uc_acquire_expire);
-                if (rc < 0) {
+               entry->ue_acquire_expire =
+                       cfs_time_shift(cache->uc_acquire_expire);
+               if (rc < 0) {
                        UC_CACHE_CLEAR_ACQUIRING(entry);
                        UC_CACHE_SET_INVALID(entry);
                        wake_up_all(&entry->ue_waitq);
@@ -210,13 +211,13 @@ find_again:
                                put_entry(cache, entry);
                                GOTO(out, entry = ERR_PTR(rc));
                        }
-                }
-        }
-        /* someone (and only one) is doing upcall upon this item,
-         * wait it to complete */
-        if (UC_CACHE_IS_ACQUIRING(entry)) {
-                long expiry = (entry == new) ?
-                              cfs_time_seconds(cache->uc_acquire_expire) :
+               }
+       }
+       /* someone (and only one) is doing upcall upon this item,
+        * wait it to complete */
+       if (UC_CACHE_IS_ACQUIRING(entry)) {
+               long expiry = (entry == new) ?
+                             cfs_time_seconds(cache->uc_acquire_expire) :
                              MAX_SCHEDULE_TIMEOUT;
                long left;
 
@@ -238,24 +239,24 @@ find_again:
                        put_entry(cache, entry);
                        GOTO(out, entry = ERR_PTR(rc));
                }
-        }
-
-        /* invalid means error, don't need to try again */
-        if (UC_CACHE_IS_INVALID(entry)) {
-                put_entry(cache, entry);
-                GOTO(out, entry = ERR_PTR(-EIDRM));
-        }
-
-        /* check expired
-         * We can't refresh the existing one because some
-         * memory might be shared by multiple processes.
-         */
-        if (check_unlink_entry(cache, entry)) {
-                /* if expired, try again. but if this entry is
-                 * created by me but too quickly turn to expired
-                 * without any error, should at least give a
-                 * chance to use it once.
-                 */
+       }
+
+       /* invalid means error, don't need to try again */
+       if (UC_CACHE_IS_INVALID(entry)) {
+               put_entry(cache, entry);
+               GOTO(out, entry = ERR_PTR(-EIDRM));
+       }
+
+       /* check expired
+        * We can't refresh the existing one because some
+        * memory might be shared by multiple processes.
+        */
+       if (check_unlink_entry(cache, entry)) {
+               /* if expired, try again. but if this entry is
+                * created by me but too quickly turn to expired
+                * without any error, should at least give a
+                * chance to use it once.
+                */
                if (entry != new) {
                        put_entry(cache, entry);
                        spin_unlock(&cache->uc_lock);
@@ -264,7 +265,7 @@ find_again:
                }
        }
 
-        /* Now we know it's good */
+       /* Now we know it's good */
 out:
        spin_unlock(&cache->uc_lock);
        RETURN(entry);
@@ -272,7 +273,7 @@ out:
 EXPORT_SYMBOL(upcall_cache_get_entry);
 
 void upcall_cache_put_entry(struct upcall_cache *cache,
-                            struct upcall_cache_entry *entry)
+                           struct upcall_cache_entry *entry)
 {
        ENTRY;
 
@@ -290,7 +291,7 @@ void upcall_cache_put_entry(struct upcall_cache *cache,
 EXPORT_SYMBOL(upcall_cache_put_entry);
 
 int upcall_cache_downcall(struct upcall_cache *cache, __u32 err, __u64 key,
-                          void *args)
+                         void *args)
 {
        struct upcall_cache_entry *entry = NULL;
        struct list_head *head;
@@ -310,43 +311,43 @@ int upcall_cache_downcall(struct upcall_cache *cache, __u32 err, __u64 key,
                }
        }
 
-        if (!found) {
-                CDEBUG(D_OTHER, "%s: upcall for key "LPU64" not expected\n",
-                       cache->uc_name, key);
-                /* haven't found, it's possible */
+       if (!found) {
+               CDEBUG(D_OTHER, "%s: upcall for key "LPU64" not expected\n",
+                      cache->uc_name, key);
+               /* haven't found, it's possible */
                spin_unlock(&cache->uc_lock);
-                RETURN(-EINVAL);
-        }
-
-        if (err) {
-                CDEBUG(D_OTHER, "%s: upcall for key "LPU64" returned %d\n",
-                       cache->uc_name, entry->ue_key, err);
-                GOTO(out, rc = -EINVAL);
-        }
-
-        if (!UC_CACHE_IS_ACQUIRING(entry)) {
-                CDEBUG(D_RPCTRACE,"%s: found uptodate entry %p (key "LPU64")\n",
-                       cache->uc_name, entry, entry->ue_key);
-                GOTO(out, rc = 0);
-        }
-
-        if (UC_CACHE_IS_INVALID(entry) || UC_CACHE_IS_EXPIRED(entry)) {
-                CERROR("%s: found a stale entry %p (key "LPU64") in ioctl\n",
-                       cache->uc_name, entry, entry->ue_key);
-                GOTO(out, rc = -EINVAL);
-        }
+               RETURN(-EINVAL);
+       }
+
+       if (err) {
+               CDEBUG(D_OTHER, "%s: upcall for key "LPU64" returned %d\n",
+                      cache->uc_name, entry->ue_key, err);
+               GOTO(out, rc = -EINVAL);
+       }
+
+       if (!UC_CACHE_IS_ACQUIRING(entry)) {
+               CDEBUG(D_RPCTRACE, "%s: found uptodate entry %p (key "LPU64")"
+                      "\n", cache->uc_name, entry, entry->ue_key);
+               GOTO(out, rc = 0);
+       }
+
+       if (UC_CACHE_IS_INVALID(entry) || UC_CACHE_IS_EXPIRED(entry)) {
+               CERROR("%s: found a stale entry %p (key "LPU64") in ioctl\n",
+                      cache->uc_name, entry, entry->ue_key);
+               GOTO(out, rc = -EINVAL);
+       }
 
        spin_unlock(&cache->uc_lock);
        if (cache->uc_ops->parse_downcall)
                rc = cache->uc_ops->parse_downcall(cache, entry, args);
        spin_lock(&cache->uc_lock);
-        if (rc)
-                GOTO(out, rc);
+       if (rc)
+               GOTO(out, rc);
 
-        entry->ue_expire = cfs_time_shift(cache->uc_entry_expire);
-        UC_CACHE_SET_VALID(entry);
-        CDEBUG(D_OTHER, "%s: created upcall cache entry %p for key "LPU64"\n",
-               cache->uc_name, entry, entry->ue_key);
+       entry->ue_expire = cfs_time_shift(cache->uc_entry_expire);
+       UC_CACHE_SET_VALID(entry);
+       CDEBUG(D_OTHER, "%s: created upcall cache entry %p for key "LPU64"\n",
+              cache->uc_name, entry, entry->ue_key);
 out:
        if (rc) {
                UC_CACHE_SET_INVALID(entry);
@@ -361,7 +362,7 @@ out:
 }
 EXPORT_SYMBOL(upcall_cache_downcall);
 
-static void cache_flush(struct upcall_cache *cache, int force)
+void upcall_cache_flush(struct upcall_cache *cache, int force)
 {
        struct upcall_cache_entry *entry, *next;
        int i;
@@ -382,18 +383,7 @@ static void cache_flush(struct upcall_cache *cache, int force)
        spin_unlock(&cache->uc_lock);
        EXIT;
 }
-
-void upcall_cache_flush_idle(struct upcall_cache *cache)
-{
-       cache_flush(cache, 0);
-}
-EXPORT_SYMBOL(upcall_cache_flush_idle);
-
-void upcall_cache_flush_all(struct upcall_cache *cache)
-{
-       cache_flush(cache, 1);
-}
-EXPORT_SYMBOL(upcall_cache_flush_all);
+EXPORT_SYMBOL(upcall_cache_flush);
 
 void upcall_cache_flush_one(struct upcall_cache *cache, __u64 key, void *args)
 {
@@ -428,7 +418,7 @@ void upcall_cache_flush_one(struct upcall_cache *cache, __u64 key, void *args)
 EXPORT_SYMBOL(upcall_cache_flush_one);
 
 struct upcall_cache *upcall_cache_init(const char *name, const char *upcall,
-                                       struct upcall_cache_ops *ops)
+                                      struct upcall_cache_ops *ops)
 {
        struct upcall_cache *cache;
        int i;
@@ -440,7 +430,7 @@ struct upcall_cache *upcall_cache_init(const char *name, const char *upcall,
 
        spin_lock_init(&cache->uc_lock);
        rwlock_init(&cache->uc_upcall_rwlock);
-        for (i = 0; i < UC_CACHE_HASH_SIZE; i++)
+       for (i = 0; i < UC_CACHE_HASH_SIZE; i++)
                INIT_LIST_HEAD(&cache->uc_hashtable[i]);
        strlcpy(cache->uc_name, name, sizeof(cache->uc_name));
        /* upcall pathname proc tunable */
@@ -455,9 +445,9 @@ EXPORT_SYMBOL(upcall_cache_init);
 
 void upcall_cache_cleanup(struct upcall_cache *cache)
 {
-        if (!cache)
-                return;
-        upcall_cache_flush_all(cache);
-        LIBCFS_FREE(cache, sizeof(*cache));
+       if (!cache)
+               return;
+       upcall_cache_flush_all(cache);
+       LIBCFS_FREE(cache, sizeof(*cache));
 }
 EXPORT_SYMBOL(upcall_cache_cleanup);