]> arthur.barton.de Git - netatalk.git/commitdiff
Move logging of dircache stats to dsi_close and reload request
authorFrank Lahm <franklahm@googlemail.com>
Tue, 2 Nov 2010 09:10:45 +0000 (10:10 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Tue, 2 Nov 2010 09:10:45 +0000 (10:10 +0100)
etc/afpd/afp_dsi.c
etc/afpd/dircache.c

index 277e412bc1bc94101ef45f0745bfe83e40e85d89..c2823ef1263df1d87e460a2058ae09ce2c60634a 100644 (file)
@@ -84,8 +84,9 @@ static void afp_dsi_close(AFPObj *obj)
     if (obj->logout)
         (*obj->logout)();
 
-    LOG(log_info, logtype_afpd, "%.2fKB read, %.2fKB written",
+    LOG(log_info, logtype_afpd, "AFP statistics: %.2f KB read, %.2f KB written",
         dsi->read_count/1024.0, dsi->write_count/1024.0);
+    log_dircache_stat();
 
     dsi_close(dsi);
 }
@@ -174,8 +175,7 @@ static void afp_dsi_timedown(int sig _U_)
 
 /* ---------------------------------
  * SIGHUP reload configuration file
- * FIXME here or we wait ?
-*/
+ */
 volatile int reload_request = 0;
 
 static void afp_dsi_reload(int sig _U_)
@@ -214,8 +214,6 @@ static void alarm_handler(int sig _U_)
      * may use alarm() */
     setitimer(ITIMER_REAL, &dsi->timer, NULL);
 
-    log_dircache_stat();
-
     /* we got some traffic from the client since the previous timer 
      * tick. */
     if ((child.flags & CHILD_DATA)) {
@@ -390,6 +388,7 @@ void afp_over_dsi(AFPObj *obj)
             reload_request = 0;
             load_volumes(child.obj);
             dircache_dump();
+            log_dircache_stat();
         }
 
         /* The first SIGINT enables debugging, the next restores the config */
index 41635beb4082894e570a752e5bc0393816f2511c..44378c641107cafa3d9b7dcb30e082e0d37cb48a 100644 (file)
@@ -567,7 +567,7 @@ int dircache_init(int reqsize)
  */
 void log_dircache_stat(void)
 {
-    LOG(log_debug, logtype_afpd, "dircache_stat: "
+    LOG(log_info, logtype_afpd, "dircache statistics: "
         "entries: %lu, lookups: %llu, hits: %llu, misses: %llu, added: %llu, removed: %llu, expunged: %llu, evicted: %llu",
         queue_count,
         dircache_stat.lookups,