[Groonga-commit] groonga/groonga [master] Output log event as GRN_LOG_WARNING when seginfo is not cleared after grn_ja_defrag_seg().

Back to archive index

null+****@clear***** null+****@clear*****
2010年 7月 27日 (火) 22:34:14 JST


Daijiro MORI	2010-07-27 13:34:14 +0000 (Tue, 27 Jul 2010)

  New Revision: 082123e0a5348f44f9960b73c55c9c03b3b33050

  Log:
    Output log event as GRN_LOG_WARNING when seginfo is not cleared after grn_ja_defrag_seg().

  Modified files:
    lib/store.c

  Modified: lib/store.c (+4 -3)
===================================================================
--- lib/store.c    2010-07-27 13:27:31 +0000 (2e54fc1)
+++ lib/store.c    2010-07-27 13:34:14 +0000 (93f64e7)
@@ -1014,7 +1014,8 @@ static grn_rc
 grn_ja_defrag_seg(grn_ctx *ctx, grn_ja *ja, uint32_t seg)
 {
   byte *v = NULL, *ve;
-  uint32_t element_size, cum = 0, sum = (SEGMENTS_AT(ja,seg) & ~SEG_MASK);
+  uint32_t element_size, cum = 0, *seginfo = &SEGMENTS_AT(ja,seg), sum;
+  sum = (*seginfo & ~SEG_MASK);
   GRN_IO_SEG_REF(ja->io, seg, v);
   if (!v) { return GRN_NO_MEMORY_AVAILABLE; }
   ve = v + JA_SEGMENT_SIZE;
@@ -1032,8 +1033,8 @@ grn_ja_defrag_seg(grn_ctx *ctx, grn_ja *ja, uint32_t seg)
     }
     v += sizeof(uint32_t) + element_size;
   }
-  GRN_LOG(ctx, GRN_LOG_NOTICE, "dseges[%d] = %d after defrag",
-          seg, (SEGMENTS_AT(ja,seg) & ~SEG_MASK));
+  GRN_LOG(ctx, *seginfo ? GRN_LOG_WARNING : GRN_LOG_NOTICE,
+          "dseges[%d] = %d after defrag", seg, *seginfo);
   GRN_IO_SEG_UNREF(ja->io, seg);
   return GRN_SUCCESS;
 }




Groonga-commit メーリングリストの案内
Back to archive index