|
|
1bb595 |
From b96b05bc40757b26f177e4093d7f4f5b96a0f7d0 Mon Sep 17 00:00:00 2001
|
|
|
1bb595 |
From: Alexey Tikhonov <atikhono@redhat.com>
|
|
|
1bb595 |
Date: Fri, 3 Jul 2020 18:45:11 +0200
|
|
|
1bb595 |
Subject: [PATCH 34/35] mem-cache: comment added
|
|
|
1bb595 |
|
|
|
1bb595 |
Added comment explaining usage of `mcc->next_slot`
|
|
|
1bb595 |
|
|
|
1bb595 |
Reviewed-by: Sumit Bose <sbose@redhat.com>
|
|
|
1bb595 |
---
|
|
|
1bb595 |
src/responder/nss/nsssrv_mmap_cache.c | 5 ++++-
|
|
|
1bb595 |
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
1bb595 |
|
|
|
1bb595 |
diff --git a/src/responder/nss/nsssrv_mmap_cache.c b/src/responder/nss/nsssrv_mmap_cache.c
|
|
|
1bb595 |
index 23df164da..71919e4ac 100644
|
|
|
1bb595 |
--- a/src/responder/nss/nsssrv_mmap_cache.c
|
|
|
1bb595 |
+++ b/src/responder/nss/nsssrv_mmap_cache.c
|
|
|
1bb595 |
@@ -65,7 +65,7 @@ struct sss_mc_ctx {
|
|
|
1bb595 |
|
|
|
1bb595 |
uint8_t *free_table; /* free list bitmaps */
|
|
|
1bb595 |
uint32_t ft_size; /* size of free table */
|
|
|
1bb595 |
- uint32_t next_slot; /* the next slot after last allocation */
|
|
|
1bb595 |
+ uint32_t next_slot; /* the next slot after last allocation done via erasure */
|
|
|
1bb595 |
|
|
|
1bb595 |
uint8_t *data_table; /* data table address (in mmap) */
|
|
|
1bb595 |
uint32_t dt_size; /* size of data table */
|
|
|
1bb595 |
@@ -442,6 +442,9 @@ static errno_t sss_mc_find_free_slots(struct sss_mc_ctx *mcc,
|
|
|
1bb595 |
if (cur == t) {
|
|
|
1bb595 |
/* ok found num_slots consecutive free bits */
|
|
|
1bb595 |
*free_slot = cur - num_slots;
|
|
|
1bb595 |
+ /* `mcc->next_slot` is not updated here intentionally.
|
|
|
1bb595 |
+ * For details see discussion in https://github.com/SSSD/sssd/pull/999
|
|
|
1bb595 |
+ */
|
|
|
1bb595 |
return EOK;
|
|
|
1bb595 |
}
|
|
|
1bb595 |
}
|
|
|
1bb595 |
--
|
|
|
1bb595 |
2.21.3
|
|
|
1bb595 |
|