subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1657684 - /subversion/branches/reuse-ra-session/subversion/libsvn_client/ra_cache.c
Date Thu, 05 Feb 2015 20:33:21 GMT
Author: brane
Date: Thu Feb  5 20:33:21 2015
New Revision: 1657684

URL: http://svn.apache.org/r1657684
Log:
On the reuse-ra-session branch: Rename file-private struct ra_session_t
to cache_entry_t, since that's what it actually represents. The former
name was too confusing (q.v. svn_ra_session_t).

* subversion/libsvn_client/ra_cache.c
  (cache_entry_t): Renamed from ra_session_t. All uses updated.
  (svn_client__ra_cache_t): Updated docstring for the 'active' member.

Modified:
    subversion/branches/reuse-ra-session/subversion/libsvn_client/ra_cache.c

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/ra_cache.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/ra_cache.c?rev=1657684&r1=1657683&r2=1657684&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/ra_cache.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/ra_cache.c Thu Feb  5 20:33:21
2015
@@ -69,10 +69,10 @@
  */
 
 /* Cache entry */
-typedef struct ra_session_t
+typedef struct cache_entry_t
 {
   /* The free-list link for this session. */
-  APR_RING_ENTRY(ra_session_t) freelist;
+  APR_RING_ENTRY(cache_entry_t) freelist;
 
   /* The cache that owns this session. Will be set to NULL in the
      cache cleanup handler to prevent access through dangling pointers
@@ -102,7 +102,7 @@ typedef struct ra_session_t
 
   /* ID of RA session. Used only for diagnostics. */
   int id;
-} ra_session_t;
+} cache_entry_t;
 
 
 /* RA session cache */
@@ -115,11 +115,11 @@ struct svn_client__ra_cache_t
   apr_hash_t *config;
 
   /* Cached active RA sessions.
-     Keys are RA_SESSION_T and values are CLIENT_RA_SESION_T pointers. */
+     Keys are SVN_RA_SESSION_T and values are CACHE_ENTRY_T pointers. */
   apr_hash_t *active;
 
   /* List of inactive sessions available for reuse. */
-  APR_RING_HEAD(, ra_session_t) freelist;
+  APR_RING_HEAD(, cache_entry_t) freelist;
 
   /* Next ID for RA sessions. Used only for diagnostics purpose. */
   int next_id;
@@ -142,7 +142,7 @@ struct svn_client__ra_cache_t
 static svn_error_t *
 open_tmp_file(apr_file_t **fp, void *baton, apr_pool_t *pool)
 {
-  ra_session_t *const b = baton;
+  cache_entry_t *const b = baton;
   return svn_error_trace(b->cb_table->open_tmp_file(fp, b->cb_baton, pool));
 }
 
@@ -151,7 +151,7 @@ static svn_error_t *
 get_wc_prop(void *baton, const char *relpath, const char *name,
             const svn_string_t **value, apr_pool_t *pool)
 {
-  ra_session_t *const b = baton;
+  cache_entry_t *const b = baton;
   if (b->cb_table->get_wc_prop)
     return svn_error_trace(
         b->cb_table->get_wc_prop(b->cb_baton, relpath, name, value, pool));
@@ -165,7 +165,7 @@ static svn_error_t *
 set_wc_prop(void *baton, const char *path, const char *name,
             const svn_string_t *value, apr_pool_t *pool)
 {
-  ra_session_t *const b = baton;
+  cache_entry_t *const b = baton;
   if (b->cb_table->set_wc_prop)
     return svn_error_trace(
         b->cb_table->set_wc_prop(b->cb_baton, path, name, value, pool));
@@ -178,7 +178,7 @@ static svn_error_t *
 push_wc_prop(void *baton, const char *relpath, const char *name,
              const svn_string_t *value, apr_pool_t *pool)
 {
-  ra_session_t *const b = baton;
+  cache_entry_t *const b = baton;
   if (b->cb_table->push_wc_prop)
     return svn_error_trace(
         b->cb_table->push_wc_prop(b->cb_baton, relpath, name, value, pool));
@@ -191,7 +191,7 @@ static svn_error_t *
 invalidate_wc_props(void *baton, const char *path, const char *prop_name,
                     apr_pool_t *pool)
 {
-  ra_session_t *const b = baton;
+  cache_entry_t *const b = baton;
   if (b->cb_table->invalidate_wc_props)
       return svn_error_trace(
           b->cb_table->invalidate_wc_props(b->cb_baton, path,
@@ -205,7 +205,7 @@ static void
 progress_func(apr_off_t progress, apr_off_t total, void *baton,
               apr_pool_t *pool)
 {
-  ra_session_t *const b = baton;
+  cache_entry_t *const b = baton;
 
   b->progress += (progress - b->last_progress);
   b->last_progress = progress;
@@ -220,7 +220,7 @@ progress_func(apr_off_t progress, apr_of
 static svn_error_t *
 cancel_func(void *baton)
 {
-  ra_session_t *const b = baton;
+  cache_entry_t *const b = baton;
   if (b->cb_table->cancel_func)
     return svn_error_trace(b->cb_table->cancel_func(b->cb_baton));
 
@@ -231,7 +231,7 @@ cancel_func(void *baton)
 static svn_error_t *
 get_client_string(void *baton, const char **name, apr_pool_t *pool)
 {
-  ra_session_t *const b = baton;
+  cache_entry_t *const b = baton;
   if (b->cb_table->get_client_string)
     return svn_error_trace(
         b->cb_table->get_client_string(b->cb_baton, name, pool));
@@ -245,7 +245,7 @@ static svn_error_t *
 get_wc_contents(void *baton, svn_stream_t **contents,
                 const svn_checksum_t *checksum, apr_pool_t *pool)
 {
-  ra_session_t *const b = baton;
+  cache_entry_t *const b = baton;
   if (b->cb_table->get_wc_contents)
     return svn_error_trace(
         b->cb_table->get_wc_contents(b->cb_baton, contents, checksum, pool));
@@ -258,7 +258,7 @@ get_wc_contents(void *baton, svn_stream_
 static svn_boolean_t
 check_tunnel_func(void *tunnel_baton, const char *tunnel_name)
 {
-  ra_session_t *const b = tunnel_baton;
+  cache_entry_t *const b = tunnel_baton;
   if (b->cb_table->check_tunnel_func)
     return b->cb_table->check_tunnel_func(b->cb_table->tunnel_baton,
                                           tunnel_name);
@@ -275,7 +275,7 @@ open_tunnel_func(svn_stream_t **request,
                  svn_cancel_func_t cancel_func, void *cancel_baton,
                  apr_pool_t *pool)
 {
-  ra_session_t *const b = tunnel_baton;
+  cache_entry_t *const b = tunnel_baton;
   if (b->cb_table->open_tunnel_func)
     return svn_error_trace(
         b->cb_table->open_tunnel_func(
@@ -298,7 +298,7 @@ static apr_status_t
 cleanup_ra_cache(void *data)
 {
   svn_client__ra_cache_t *ra_cache = data;
-  ra_session_t *cache_entry;
+  cache_entry_t *cache_entry;
   apr_hash_index_t *hi;
 
   /* Reset the cache owner pointers on all the cached sessions. */
@@ -310,7 +310,7 @@ cleanup_ra_cache(void *data)
     }
 
   APR_RING_FOREACH(cache_entry, &ra_cache->freelist,
-                   ra_session_t, freelist)
+                   cache_entry_t, freelist)
       cache_entry->ra_cache = NULL;
 
   RA_CACHE_LOG(("RA_CACHE: Cleanup\n"));
@@ -342,7 +342,7 @@ svn_client__ra_cache_init(svn_client__pr
   private_ctx->ra_cache->config = config;
   private_ctx->ra_cache->active = apr_hash_make(pool);
   APR_RING_INIT(&private_ctx->ra_cache->freelist,
-                ra_session_t, freelist);
+                cache_entry_t, freelist);
 
   /* This cleanup must be registered to run before the subpools (which
      include pools of cached sessions) are destroyed, so that the
@@ -358,7 +358,7 @@ svn_client__ra_cache_init(svn_client__pr
 static apr_status_t
 close_ra_session(void *data)
 {
-  ra_session_t *cache_entry = data;
+  cache_entry_t *cache_entry = data;
   svn_client__ra_cache_t *ra_cache = cache_entry->ra_cache;
 
   if (ra_cache)
@@ -394,15 +394,15 @@ close_ra_session(void *data)
 }
 
 static svn_error_t *
-find_session_by_url(ra_session_t **cache_entry_p,
+find_session_by_url(cache_entry_t **cache_entry_p,
                     svn_client__ra_cache_t *ra_cache,
                     const char *url,
                     apr_pool_t *scratch_pool)
 {
-  ra_session_t *cache_entry;
+  cache_entry_t *cache_entry;
 
   APR_RING_FOREACH(cache_entry, &ra_cache->freelist,
-                   ra_session_t, freelist)
+                   cache_entry_t, freelist)
     {
       SVN_ERR_ASSERT(cache_entry->owner_pool == NULL);
 
@@ -439,7 +439,7 @@ svn_client__ra_cache_open_session(svn_ra
                                   apr_pool_t *scratch_pool)
 {
   svn_client__ra_cache_t *const ra_cache = get_private_ra_cache(ctx);
-  ra_session_t *cache_entry;
+  cache_entry_t *cache_entry;
 
   if (corrected_p)
       *corrected_p = NULL;
@@ -565,7 +565,7 @@ svn_client__ra_cache_release_session(svn
                                      svn_ra_session_t *session)
 {
   svn_client__ra_cache_t *const ra_cache = get_private_ra_cache(ctx);
-  ra_session_t *cache_entry =
+  cache_entry_t *cache_entry =
     apr_hash_get(ra_cache->active, &session, sizeof(session));
 
   RA_CACHE_DBG(("ra_cache_release_session: search active:       %"
@@ -596,7 +596,7 @@ svn_client__ra_cache_release_session(svn
 #endif /* SVN_DEBUG */
 
   APR_RING_INSERT_HEAD(&ra_cache->freelist, cache_entry,
-                       ra_session_t, freelist);
+                       cache_entry_t, freelist);
 
   cache_entry->owner_pool = NULL;
   cache_entry->cb_table = NULL;



Mime
View raw message