<commit_before>#include <stdio.h>
#include <unistd.h>

#include "files-reg.h"
#include "crtools.h"
#include "mount.h"
#include "stats.h"
#include "pstree.h"
#include "net.h"
#include "sk-inet.h"
#include "rst-malloc.h"

static int gc_prepare_namespace();
static int gc_prepare_sockets();

int cr_garbage_collect(bool show)
{
	if (check_img_inventory() < 0)
		return -1;

	if (collect_remaps_and_regfiles())
		return -1;

	if (gc_prepare_namespace())
		return -1;

	if (gc_prepare_sockets())
		return -1;

	gc_network(show);

	gc_collected_remaps(show);

	return 0;
}

static int gc_prepare_namespace()
{  
	pr_info("MAX: going to prepare_namespace\n");

	task_entries = rst_mem_alloc(sizeof(*task_entries), RM_SHREMAP);

	if (prepare_pstree())
		return -1;

	if (prepare_mnt_ns())
		return -1;

  return 0;
}

static int gc_prepare_sockets()
{
	if (collect_inet_sockets())
		return -1;

	rst_mem_switch_to_private();

	if (rst_tcp_socks_prep())
		return -1;

	return 0;
}<commit_msg>redundant calls removed<commit_after>#include <stdio.h>
#include <unistd.h>

#include "files-reg.h"
#include "crtools.h"
#include "mount.h"
#include "stats.h"
#include "pstree.h"
#include "net.h"
#include "sk-inet.h"
#include "rst-malloc.h"

static int gc_prepare_namespace();
static int gc_prepare_sockets();

int cr_garbage_collect(bool show)
{
	if (check_img_inventory() < 0)
		return -1;

	if (collect_remaps_and_regfiles())
		return -1;

	if (gc_prepare_namespace())
		return -1;

	if (gc_prepare_sockets())
		return -1;

	gc_network(show);

	gc_collected_remaps(show);

	return 0;
}

static int gc_prepare_namespace()
{  
	pr_info("MAX: going to prepare_namespace\n");

	task_entries = rst_mem_alloc(sizeof(*task_entries), RM_SHREMAP);

	if (prepare_pstree())
		return -1;

	if (prepare_mnt_ns())
		return -1;

  return 0;
}

static int gc_prepare_sockets()
{
	if (collect_inet_sockets())
		return -1;

	return 0;
}
{'fraction_non_alphanumeric': 0.14233193277310924, 'fraction_numerical': 0.01207983193277311, 'mean_word_length': 4.897832817337461, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5847123', 'n_tokens_mistral': 830, 'n_tokens_neox': 772, 'n_words': 165}