summaryrefslogtreecommitdiff
path: root/source3/locking/share_mode_lock.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-09-02 11:37:57 +0000
committerMichael Adam <obnox@samba.org>2013-10-15 23:46:11 +0200
commitc938a1065fed2a001da69b6a6d826ef31be75003 (patch)
tree2c4d7ee16998fa96b61630b7731cdd3ad41dacc1 /source3/locking/share_mode_lock.c
parent4d85f91a5b309fac76ed8b0ed2a18132c18b2659 (diff)
downloadsamba-c938a1065fed2a001da69b6a6d826ef31be75003.tar.gz
samba-c938a1065fed2a001da69b6a6d826ef31be75003.tar.bz2
samba-c938a1065fed2a001da69b6a6d826ef31be75003.zip
smbd: Factor out remove_stale_share_mode_entries
Will be used in the next commit Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/locking/share_mode_lock.c')
-rw-r--r--source3/locking/share_mode_lock.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c
index 342f9108d6..5d7a08ca4b 100644
--- a/source3/locking/share_mode_lock.c
+++ b/source3/locking/share_mode_lock.c
@@ -171,26 +171,13 @@ static TDB_DATA unparse_share_modes(struct share_mode_data *d)
{
DATA_BLOB blob;
enum ndr_err_code ndr_err;
- uint32_t i;
if (DEBUGLEVEL >= 10) {
DEBUG(10, ("unparse_share_modes:\n"));
NDR_PRINT_DEBUG(share_mode_data, d);
}
- i = 0;
- while (i < d->num_share_modes) {
- if (d->share_modes[i].stale) {
- /*
- * Remove the stale entries before storing
- */
- struct share_mode_entry *m = d->share_modes;
- m[i] = m[d->num_share_modes-1];
- d->num_share_modes -= 1;
- } else {
- i += 1;
- }
- }
+ remove_stale_share_mode_entries(d);
if (d->num_share_modes == 0) {
DEBUG(10, ("No used share mode found\n"));