⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gcthread.c

📁 eCos/RedBoot for勤研ARM AnywhereII(4510) 含全部源代码
💻 C
字号:
/*
 * JFFS2 -- Journalling Flash File System, Version 2.
 *
 * Copyright (C) 2001-2003 Red Hat, Inc.
 *
 * Created by David Woodhouse <dwmw2@redhat.com>
 *
 * For licensing information, see the file 'LICENCE' in this directory.
 *
 * $Id: gcthread.c,v 1.1 2003/11/26 15:55:35 dwmw2 Exp $
 *
 */

#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/jffs2.h>
#include "nodelist.h"


static void jffs2_garbage_collect_thread(struct jffs2_sb_info *c);

void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c)
{
	/* Wake up the thread */
	(void)&jffs2_garbage_collect_thread;
}

void jffs2_start_garbage_collect_thread(struct jffs2_sb_info *c)
{
	/* Start the thread. Doesn't matter if it fails -- it's only an optimisation anyway */
}

void jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c)
{
	/* Stop the thread and wait for it if necessary */
}


static void jffs2_garbage_collect_thread(struct jffs2_sb_info *c)
{
#define this_thread_should_die() 0
	while(!this_thread_should_die()) {
		while(!jffs2_thread_should_wake(c)) {
			/* Sleep.... */
			continue;
		}
		if (jffs2_garbage_collect_pass(c) == -ENOSPC) {
			printf("No space for garbage collection. Aborting JFFS2 GC thread\n");
			break;
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -