亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? yaffs_super.c

?? armer9 s3c2410開發(fā)平臺的文件系統(tǒng)。linux2.4.18 源代碼。可以直接使用
?? C
字號:
/* * JFFS2 -- Journalling Flash File System, Version 2. * * Copyright (C) 2001 Red Hat, Inc. * * Created by David Woodhouse <dwmw2@cambridge.redhat.com> * * The original JFFS, from which the design for JFFS2 was derived, * was designed and implemented by Axis Communications AB. * * The contents of this file are subject to the Red Hat eCos Public * License Version 1.1 (the "Licence"); you may not use this file * except in compliance with the Licence.  You may obtain a copy of * the Licence at http://www.redhat.com/ * * Software distributed under the Licence is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. * See the Licence for the specific language governing rights and * limitations under the Licence. * * The Original Code is JFFS2 - Journalling Flash File System, version 2 * * Alternatively, the contents of this file may be used under the * terms of the GNU General Public License version 2 (the "GPL"), in * which case the provisions of the GPL are applicable instead of the * above.  If you wish to allow the use of your version of this file * only under the terms of the GPL and not to allow others to use your * version of this file under the RHEPL, indicate your decision by * deleting the provisions above and replace them with the notice and * other provisions required by the GPL.  If you do not delete the * provisions above, a recipient may use your version of this file * under either the RHEPL or the GPL. * * $Id: yaffs_super.c,v 1.2 2002/05/27 18:57:25 charles dead $ * */#include <linux/config.h>#include <linux/kernel.h>#include <linux/module.h>#include <linux/version.h>#include <linux/slab.h>#include <linux/init.h>#include <linux/list.h>#include <linux/fs.h>#include <linux/jffs2.h>#include <linux/pagemap.h>#include <linux/mtd/mtd.h>#include <linux/interrupt.h>#include "nodelist.h"#ifndef MTD_BLOCK_MAJOR#define MTD_BLOCK_MAJOR 31#endifextern void jffs2_read_inode (struct inode *);void jffs2_put_super (struct super_block *);void jffs2_write_super (struct super_block *);static int jffs2_statfs (struct super_block *, struct statfs *);int jffs2_remount_fs (struct super_block *, int *, char *);extern void jffs2_clear_inode (struct inode *);static struct super_operations jffs2_super_operations ={	read_inode:	jffs2_read_inode,//	delete_inode:	jffs2_delete_inode,	put_super:	jffs2_put_super,	write_super:	jffs2_write_super,	statfs:		jffs2_statfs,	remount_fs:	jffs2_remount_fs,	clear_inode:	jffs2_clear_inode};static int jffs2_statfs(struct super_block *sb, struct statfs *buf){	struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);	unsigned long avail;	buf->f_type = JFFS2_SUPER_MAGIC;	buf->f_bsize = 1 << PAGE_SHIFT;	buf->f_blocks = c->flash_size >> PAGE_SHIFT;	buf->f_files = 0;	buf->f_ffree = 0;	buf->f_namelen = JFFS2_MAX_NAME_LEN;	spin_lock_bh(&c->erase_completion_lock);	avail = c->dirty_size + c->free_size;	if (avail > c->sector_size * JFFS2_RESERVED_BLOCKS_WRITE)		avail -= c->sector_size * JFFS2_RESERVED_BLOCKS_WRITE;	else		avail = 0;	buf->f_bavail = buf->f_bfree = avail >> PAGE_SHIFT;#if CONFIG_JFFS2_FS_DEBUG > 0	printk(KERN_DEBUG "STATFS:\n");	printk(KERN_DEBUG "flash_size: %08x\n", c->flash_size);	printk(KERN_DEBUG "used_size: %08x\n", c->used_size);	printk(KERN_DEBUG "dirty_size: %08x\n", c->dirty_size);	printk(KERN_DEBUG "free_size: %08x\n", c->free_size);	printk(KERN_DEBUG "erasing_size: %08x\n", c->erasing_size);	printk(KERN_DEBUG "bad_size: %08x\n", c->bad_size);	printk(KERN_DEBUG "sector_size: %08x\n", c->sector_size);	if (c->nextblock) {		printk(KERN_DEBUG "nextblock: 0x%08x\n", c->nextblock->offset);	} else {		printk(KERN_DEBUG "nextblock: NULL\n");	}	if (c->gcblock) {		printk(KERN_DEBUG "gcblock: 0x%08x\n", c->gcblock->offset);	} else {		printk(KERN_DEBUG "gcblock: NULL\n");	}	if (list_empty(&c->clean_list)) {		printk(KERN_DEBUG "clean_list: empty\n");	} else {		struct list_head *this;		list_for_each(this, &c->clean_list) {			struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list);			printk(KERN_DEBUG "clean_list: %08x\n", jeb->offset);		}	}	if (list_empty(&c->dirty_list)) {		printk(KERN_DEBUG "dirty_list: empty\n");	} else {		struct list_head *this;		list_for_each(this, &c->dirty_list) {			struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list);			printk(KERN_DEBUG "dirty_list: %08x\n", jeb->offset);		}	}	if (list_empty(&c->erasing_list)) {		printk(KERN_DEBUG "erasing_list: empty\n");	} else {		struct list_head *this;		list_for_each(this, &c->erasing_list) {			struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list);			printk(KERN_DEBUG "erasing_list: %08x\n", jeb->offset);		}	}	if (list_empty(&c->erase_pending_list)) {		printk(KERN_DEBUG "erase_pending_list: empty\n");	} else {		struct list_head *this;		list_for_each(this, &c->erase_pending_list) {			struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list);			printk(KERN_DEBUG "erase_pending_list: %08x\n", jeb->offset);		}	}	if (list_empty(&c->free_list)) {		printk(KERN_DEBUG "free_list: empty\n");	} else {		struct list_head *this;		list_for_each(this, &c->free_list) {			struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list);			printk(KERN_DEBUG "free_list: %08x\n", jeb->offset);		}	}	if (list_empty(&c->bad_list)) {		printk(KERN_DEBUG "bad_list: empty\n");	} else {		struct list_head *this;		list_for_each(this, &c->bad_list) {			struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list);			printk(KERN_DEBUG "bad_list: %08x\n", jeb->offset);		}	}	if (list_empty(&c->bad_used_list)) {		printk(KERN_DEBUG "bad_used_list: empty\n");	} else {		struct list_head *this;		list_for_each(this, &c->bad_used_list) {			struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list);			printk(KERN_DEBUG "bad_used_list: %08x\n", jeb->offset);		}	}#endif /* CONFIG_JFFS2_FS_DEBUG */	spin_unlock_bh(&c->erase_completion_lock);	return 0;}static struct super_block *jffs2_read_super(struct super_block *sb, void *data, int silent){	struct jffs2_sb_info *c;	struct inode *root_i;	int i;	D1(printk(KERN_DEBUG "jffs2: read_super for device %s\n", kdevname(sb->s_dev)));	if (MAJOR(sb->s_dev) != MTD_BLOCK_MAJOR) {		if (!silent)			printk(KERN_DEBUG "jffs2: attempt to mount non-MTD device %s\n", kdevname(sb->s_dev));		return NULL;	}	c = JFFS2_SB_INFO(sb);	memset(c, 0, sizeof(*c));		c->mtd = get_mtd_device(NULL, MINOR(sb->s_dev));	if (!c->mtd) {		D1(printk(KERN_DEBUG "jffs2: MTD device #%u doesn't appear to exist\n", MINOR(sb->s_dev)));		return NULL;	}	c->sector_size = c->mtd->erasesize;	c->free_size = c->flash_size = c->mtd->size;	c->nr_blocks = c->mtd->size / c->mtd->erasesize;	c->blocks = kmalloc(sizeof(struct jffs2_eraseblock) * c->nr_blocks, GFP_KERNEL);	if (!c->blocks)		goto out_mtd;	for (i=0; i<c->nr_blocks; i++) {		INIT_LIST_HEAD(&c->blocks[i].list);		c->blocks[i].offset = i * c->sector_size;		c->blocks[i].free_size = c->sector_size;		c->blocks[i].dirty_size = 0;		c->blocks[i].used_size = 0;		c->blocks[i].first_node = NULL;		c->blocks[i].last_node = NULL;	}			spin_lock_init(&c->nodelist_lock);	init_MUTEX(&c->alloc_sem);	init_waitqueue_head(&c->erase_wait);	spin_lock_init(&c->erase_completion_lock);	spin_lock_init(&c->inocache_lock);	INIT_LIST_HEAD(&c->clean_list);	INIT_LIST_HEAD(&c->dirty_list);	INIT_LIST_HEAD(&c->erasing_list);	INIT_LIST_HEAD(&c->erase_pending_list);	INIT_LIST_HEAD(&c->erase_complete_list);	INIT_LIST_HEAD(&c->free_list);	INIT_LIST_HEAD(&c->bad_list);	INIT_LIST_HEAD(&c->bad_used_list);	c->highest_ino = 1;	if (jffs2_build_filesystem(c)) {		D1(printk(KERN_DEBUG "build_fs failed\n"));		goto out_nodes;	}	sb->s_op = &jffs2_super_operations;	D1(printk(KERN_DEBUG "jffs2_read_super(): Getting root inode\n"));	root_i = iget(sb, 1);	if (is_bad_inode(root_i)) {		D1(printk(KERN_WARNING "get root inode failed\n"));		goto out_nodes;	}	D1(printk(KERN_DEBUG "jffs2_read_super(): d_alloc_root()\n"));	sb->s_root = d_alloc_root(root_i);	if (!sb->s_root)		goto out_root_i;#if LINUX_VERSION_CODE >= 0x20403	sb->s_maxbytes = 0xFFFFFFFF;#endif	sb->s_blocksize = PAGE_CACHE_SIZE;	sb->s_blocksize_bits = PAGE_CACHE_SHIFT;	sb->s_magic = JFFS2_SUPER_MAGIC;	if (!(sb->s_flags & MS_RDONLY))		jffs2_start_garbage_collect_thread(c);	return sb; out_root_i:	iput(root_i); out_nodes:	jffs2_free_ino_caches(c);	jffs2_free_raw_node_refs(c);	kfree(c->blocks); out_mtd:	put_mtd_device(c->mtd);	return NULL;}void jffs2_put_super (struct super_block *sb){	struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);	D2(printk(KERN_DEBUG "jffs2: jffs2_put_super()\n"));	if (!(sb->s_flags & MS_RDONLY))		jffs2_stop_garbage_collect_thread(c);	jffs2_free_ino_caches(c);	jffs2_free_raw_node_refs(c);	kfree(c->blocks);	if (c->mtd->sync)		c->mtd->sync(c->mtd);	put_mtd_device(c->mtd);		D1(printk(KERN_DEBUG "jffs2_put_super returning\n"));}int jffs2_remount_fs (struct super_block *sb, int *flags, char *data){	struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);	if (c->flags & JFFS2_SB_FLAG_RO && !(sb->s_flags & MS_RDONLY))		return -EROFS;	/* We stop if it was running, then restart if it needs to.	   This also catches the case where it was stopped and this	   is just a remount to restart it */	if (!(sb->s_flags & MS_RDONLY))		jffs2_stop_garbage_collect_thread(c);	if (!(*flags & MS_RDONLY))		jffs2_start_garbage_collect_thread(c);		sb->s_flags = (sb->s_flags & ~MS_RDONLY)|(*flags & MS_RDONLY);	return 0;}void jffs2_write_super (struct super_block *sb){	struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);	sb->s_dirt = 0;	if (sb->s_flags & MS_RDONLY)		return;	jffs2_garbage_collect_trigger(c);	jffs2_erase_pending_blocks(c);	jffs2_mark_erased_blocks(c);}static DECLARE_FSTYPE_DEV(jffs2_fs_type, "jffs2", jffs2_read_super);static int __init init_jffs2_fs(void){	int ret;	printk(KERN_NOTICE "JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.\n");#ifdef JFFS2_OUT_OF_KERNEL	/* sanity checks. Could we do these at compile time? */	if (sizeof(struct jffs2_sb_info) > sizeof (((struct super_block *)NULL)->u)) {		printk(KERN_ERR "JFFS2 error: struct jffs2_sb_info (%d bytes) doesn't fit in the super_block union (%d bytes)\n", 		       sizeof(struct jffs2_sb_info), sizeof (((struct super_block *)NULL)->u));		return -EIO;	}	if (sizeof(struct jffs2_inode_info) > sizeof (((struct inode *)NULL)->u)) {		printk(KERN_ERR "JFFS2 error: struct jffs2_inode_info (%d bytes) doesn't fit in the inode union (%d bytes)\n", 		       sizeof(struct jffs2_inode_info), sizeof (((struct inode *)NULL)->u));		return -EIO;	}#endif	ret = jffs2_create_slab_caches();	if (ret) {		printk(KERN_ERR "JFFS2 error: Failed to initialise slab caches\n");		return ret;	}	ret = register_filesystem(&jffs2_fs_type);	if (ret) {		printk(KERN_ERR "JFFS2 error: Failed to register filesystem\n");		jffs2_destroy_slab_caches();	}	return ret;}static void __exit exit_jffs2_fs(void){	jffs2_destroy_slab_caches();	unregister_filesystem(&jffs2_fs_type);}module_init(init_jffs2_fs);module_exit(exit_jffs2_fs);MODULE_DESCRIPTION("The Journalling Flash File System, v2");MODULE_AUTHOR("Red Hat, Inc.");MODULE_LICENSE("GPL"); // Actually dual-licensed, but it doesn't matter for 		       // the sake of this tag. It's Free Software./* * YAFFS: Yet another FFS. A NAND-flash specific file system.  * * Copyright (C) 2002 Aleph One Ltd. *   for Toby Churchill Ltd and Brightstar Engineering * * Created by Charles Manning <charles@aleph1.co.uk> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品三级日韩久久| 中文字幕一区二区三区蜜月| 国产精品美女久久久久久2018| 亚洲精品国产高清久久伦理二区| 青青草97国产精品免费观看无弹窗版| 成人一级片网址| 欧美一区二区三区四区久久| 国产精品电影一区二区| 狠狠色狠狠色综合日日91app| 欧美自拍丝袜亚洲| 亚洲欧美一区二区三区国产精品 | 这里只有精品视频在线观看| 自拍偷在线精品自拍偷无码专区| 久久激情五月激情| 欧美狂野另类xxxxoooo| 亚洲人成在线播放网站岛国| 国产盗摄视频一区二区三区| 欧美岛国在线观看| 午夜电影网一区| 欧美在线免费播放| 亚洲青青青在线视频| 不卡区在线中文字幕| 国产欧美日韩另类一区| 国产精品一二一区| 久久一区二区三区四区| 久久99久久久久| 日韩欧美成人午夜| 麻豆精品视频在线观看免费| 欧美丰满高潮xxxx喷水动漫| 亚洲不卡一区二区三区| 欧美日韩国产一区二区三区地区| 亚洲精品乱码久久久久久久久| 97久久人人超碰| 亚洲精品写真福利| 一本色道a无线码一区v| 亚洲精品免费在线播放| 欧美日韩视频在线观看一区二区三区| 亚洲免费观看高清在线观看| 91成人免费电影| 亚洲丰满少妇videoshd| 在线播放中文一区| 久久国产婷婷国产香蕉| 26uuu久久综合| 国产一区二区三区精品欧美日韩一区二区三区 | 67194成人在线观看| 日韩av电影天堂| 日韩女优av电影| 国产精品综合网| 亚洲国产高清不卡| 91视频一区二区| 亚洲va韩国va欧美va精品| 9191国产精品| 国产激情精品久久久第一区二区| 欧美国产1区2区| 欧美在线你懂的| 看电视剧不卡顿的网站| 国产目拍亚洲精品99久久精品| www.av精品| 天堂va蜜桃一区二区三区漫画版| 欧美电影免费提供在线观看| av爱爱亚洲一区| 天堂一区二区在线| 国产网红主播福利一区二区| 91福利小视频| 久久99国产精品久久99| 亚洲视频1区2区| 精品精品欲导航| 91免费观看视频在线| 免费在线一区观看| 中文字幕一区二区三区在线观看 | 色综合久久久久综合| 日韩经典中文字幕一区| 久久久久国产精品麻豆| 成人va在线观看| 美女视频黄a大片欧美| 国产精品久久久久久久岛一牛影视 | 一区二区日韩电影| 日韩一级片在线播放| 99国产麻豆精品| 国内外成人在线视频| 亚洲欧美成人一区二区三区| 精品久久国产老人久久综合| 欧美三级蜜桃2在线观看| 国产69精品久久777的优势| 五月天网站亚洲| 亚洲欧美一区二区不卡| 久久久综合激的五月天| 4438x成人网最大色成网站| 99久久精品费精品国产一区二区| 久久不见久久见中文字幕免费| 樱花草国产18久久久久| 中文字幕av一区 二区| 精品伦理精品一区| 欧美日韩三级一区| 91丨九色丨黑人外教| 丁香桃色午夜亚洲一区二区三区 | 亚洲精品视频在线观看免费| 久久久久久免费网| 日韩精品资源二区在线| 制服丝袜亚洲精品中文字幕| 欧美专区日韩专区| 色综合天天综合网国产成人综合天| 99久久国产综合精品麻豆 | 亚洲第一狼人社区| 亚洲精品一二三| 亚洲激情在线激情| 亚洲欧美激情插| 综合久久给合久久狠狠狠97色| 国产日韩欧美不卡| 国产丝袜在线精品| 国产亚洲精品bt天堂精选| 精品国产sm最大网站免费看| 欧美电视剧在线看免费| 日韩欧美高清在线| 亚洲精品一区二区三区香蕉| 久久一区二区三区国产精品| 国产午夜精品一区二区三区视频| 亚洲精品在线免费观看视频| 久久影院午夜片一区| 久久精品人人做人人综合| 精品日韩一区二区三区| 久久久综合激的五月天| 国产精品免费免费| 综合中文字幕亚洲| 一区二区日韩电影| 日韩中文字幕不卡| 麻豆久久一区二区| 国产麻豆精品在线观看| 成人免费视频国产在线观看| 成人黄色软件下载| 91久久线看在观草草青青| 欧美视频一区在线| 精品国产精品网麻豆系列| 国产日韩欧美制服另类| 亚洲人成在线播放网站岛国| 亚洲国产成人tv| 九色综合国产一区二区三区| 成人自拍视频在线观看| 91福利在线导航| 精品久久久久久久久久久久久久久 | 欧美一级专区免费大片| 久久免费电影网| 亚洲女爱视频在线| 天天av天天翘天天综合网 | 美国一区二区三区在线播放| 国产美女久久久久| 色呦呦一区二区三区| 日韩三级高清在线| 中文字幕在线一区二区三区| 亚洲成a人v欧美综合天堂下载| 乱中年女人伦av一区二区| 粉嫩一区二区三区在线看| 欧美性猛交xxxxxxxx| 国产亚洲污的网站| 亚洲成a人在线观看| 成人激情电影免费在线观看| 欧美视频你懂的| 国产亚洲综合av| 天天做天天摸天天爽国产一区| 国产成人精品网址| 4438x成人网最大色成网站| 中文字幕一区二区三区在线播放 | 色菇凉天天综合网| xvideos.蜜桃一区二区| 亚洲国产成人va在线观看天堂| 国产成人午夜高潮毛片| 3d成人h动漫网站入口| 综合网在线视频| 极品销魂美女一区二区三区| 欧美系列一区二区| 亚洲国产精华液网站w| 久久精品国产99久久6| 欧美性生活大片视频| 日本一区二区电影| 精品中文字幕一区二区| 欧美夫妻性生活| 亚洲综合免费观看高清在线观看| 丁香一区二区三区| 精品成人一区二区三区| 亚洲.国产.中文慕字在线| 91同城在线观看| 国产精品网站一区| 国产风韵犹存在线视精品| 欧美成人激情免费网| 日本亚洲视频在线| 欧美挠脚心视频网站| 亚洲一卡二卡三卡四卡无卡久久 | 亚洲蜜臀av乱码久久精品| 国产成人av电影在线| 久久久久久夜精品精品免费| 老色鬼精品视频在线观看播放| 欧美日韩国产一级二级| 午夜精品爽啪视频| 精品视频在线看| 亚洲va欧美va天堂v国产综合| 色婷婷av一区二区| 亚洲一区二区三区精品在线| 欧美色视频一区| 午夜久久电影网| 69成人精品免费视频|