Blob Blame History Raw
From b96b05bc40757b26f177e4093d7f4f5b96a0f7d0 Mon Sep 17 00:00:00 2001
From: Alexey Tikhonov <atikhono@redhat.com>
Date: Fri, 3 Jul 2020 18:45:11 +0200
Subject: [PATCH 34/35] mem-cache: comment added

Added comment explaining usage of `mcc->next_slot`

Reviewed-by: Sumit Bose <sbose@redhat.com>
---
 src/responder/nss/nsssrv_mmap_cache.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/responder/nss/nsssrv_mmap_cache.c b/src/responder/nss/nsssrv_mmap_cache.c
index 23df164da..71919e4ac 100644
--- a/src/responder/nss/nsssrv_mmap_cache.c
+++ b/src/responder/nss/nsssrv_mmap_cache.c
@@ -65,7 +65,7 @@ struct sss_mc_ctx {
 
     uint8_t *free_table;    /* free list bitmaps */
     uint32_t ft_size;       /* size of free table */
-    uint32_t next_slot;     /* the next slot after last allocation */
+    uint32_t next_slot;     /* the next slot after last allocation done via erasure */
 
     uint8_t *data_table;    /* data table address (in mmap) */
     uint32_t dt_size;       /* size of data table */
@@ -442,6 +442,9 @@ static errno_t sss_mc_find_free_slots(struct sss_mc_ctx *mcc,
         if (cur == t) {
             /* ok found num_slots consecutive free bits */
             *free_slot = cur - num_slots;
+            /* `mcc->next_slot` is not updated here intentionally.
+             * For details see discussion in https://github.com/SSSD/sssd/pull/999
+             */
             return EOK;
         }
     }
-- 
2.21.3