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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? yaffs_super.c

?? yaffs sorce code ,it s very usefuy for which one want to design nand flash file system
?? 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. * */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美卡一卡二| 色婷婷亚洲一区二区三区| 日韩欧美中文字幕精品| 日本亚洲视频在线| 精品少妇一区二区三区日产乱码 | 国产欧美一区二区三区鸳鸯浴| 久久黄色级2电影| 精品国产凹凸成av人导航| 国产成人av网站| 亚洲色图在线播放| 欧美日韩大陆一区二区| 美国三级日本三级久久99| 亚洲精品在线免费观看视频| 成人永久免费视频| 一区二区日韩电影| 日韩欧美综合在线| 成人黄色网址在线观看| 亚洲一区二区五区| 欧美变态凌虐bdsm| 91美女片黄在线观看91美女| 亚洲国产成人av好男人在线观看| 日韩欧美自拍偷拍| 93久久精品日日躁夜夜躁欧美| 婷婷综合另类小说色区| 精品sm在线观看| 91亚洲精华国产精华精华液| 亚洲成人午夜电影| 久久久久国产成人精品亚洲午夜| 91精品办公室少妇高潮对白| 日韩电影在线看| 亚洲三级在线播放| 26uuu精品一区二区三区四区在线| 一本一本大道香蕉久在线精品| 乱中年女人伦av一区二区| 亚洲欧美日本在线| 精品国产一区二区三区四区四| 91一区一区三区| 精品系列免费在线观看| 亚洲小说欧美激情另类| 久久精品一区二区三区四区| 欧美日韩黄色一区二区| 成人福利视频网站| 麻豆91在线看| 一区二区三区四区精品在线视频| 精品成人一区二区三区四区| 91国内精品野花午夜精品| 国产激情91久久精品导航 | 成人av影院在线| 日本在线播放一区二区三区| 成人欧美一区二区三区| 久久综合一区二区| 欧美另类高清zo欧美| 91污在线观看| 国产jizzjizz一区二区| 日本女优在线视频一区二区| 一区二区国产盗摄色噜噜| 国产欧美一区二区三区鸳鸯浴| 日韩一区二区麻豆国产| 欧美性猛交xxxxxx富婆| 99久久99久久久精品齐齐| 国产成人三级在线观看| 精品亚洲免费视频| 久久精品国产一区二区三区免费看| 亚洲自拍欧美精品| 亚洲精品欧美综合四区| 国产精品久久久久久久久晋中| 久久蜜桃av一区精品变态类天堂| 日韩精品一区二区三区视频在线观看| 欧美视频一区在线| 欧美日韩一级黄| 欧美三级中文字| 欧美视频中文字幕| 欧美日韩国产a| 正在播放一区二区| 欧美理论在线播放| 91麻豆精品国产91久久久资源速度 | 麻豆成人久久精品二区三区小说| 婷婷中文字幕综合| 午夜天堂影视香蕉久久| 性做久久久久久免费观看| 亚洲狠狠爱一区二区三区| 亚洲一区在线观看网站| 亚洲二区在线观看| 石原莉奈一区二区三区在线观看| 亚洲成人一区二区| 日产国产高清一区二区三区| 日韩成人一级片| 久久99热99| 国产精品综合视频| 成人免费高清视频在线观看| 成人教育av在线| 日本黄色一区二区| 宅男在线国产精品| 精品国产百合女同互慰| 国产亚洲1区2区3区| 国产精品人妖ts系列视频| 综合欧美一区二区三区| 亚洲观看高清完整版在线观看| 日韩精品每日更新| 国产一区二区在线看| 成人精品gif动图一区| 欧美制服丝袜第一页| 日韩一区二区在线观看| 日本一区二区高清| 亚洲国产欧美在线人成| 九九视频精品免费| av在线免费不卡| 欧美日韩精品欧美日韩精品 | 久久久久99精品一区| 中文字幕字幕中文在线中不卡视频| 一区二区三区小说| 久久99精品久久久久| av不卡一区二区三区| 欧美精品丝袜中出| 国产亚洲欧美在线| 亚洲尤物视频在线| 国产美女娇喘av呻吟久久| 97久久超碰国产精品| 正在播放亚洲一区| 综合久久综合久久| 久久99精品久久久久婷婷| 99精品视频在线播放观看| 欧美一区二区视频在线观看2022| 欧美国产日本视频| 日本成人在线网站| 91网站视频在线观看| 亚洲精品一区二区三区99| 亚洲精品乱码久久久久久久久| 精品亚洲成a人在线观看| 在线观看视频一区二区欧美日韩| 欧美mv日韩mv国产网站| 亚洲一区二区三区小说| 国产成人综合视频| 日韩精品一区二区三区老鸭窝| 日韩美女视频一区二区| 国产麻豆91精品| 日韩一区二区三区视频在线观看| 一区二区三区免费网站| 国产成人亚洲综合a∨婷婷| 欧美一级在线观看| 亚洲一区二区影院| 色综合天天狠狠| 国产精品沙发午睡系列990531| 毛片av一区二区三区| 欧美网站大全在线观看| 亚洲欧美国产77777| 国产91丝袜在线播放0| 精品日韩欧美在线| 日韩国产欧美视频| 欧洲国产伦久久久久久久| 国产精品久久久久久久久动漫| 国产精品一区二区不卡| 欧美成人vps| 日本不卡一区二区| 欧美精品123区| 亚洲国产精品久久久男人的天堂| 色菇凉天天综合网| 亚洲精品乱码久久久久久黑人| 99国内精品久久| 中文字幕在线观看一区| 成年人国产精品| 1000部国产精品成人观看| 成人一区在线观看| 国产精品无圣光一区二区| 成人自拍视频在线| 国产精品久久久久久久久久久免费看 | 视频在线观看国产精品| 欧美日产国产精品| 秋霞午夜鲁丝一区二区老狼| 777午夜精品视频在线播放| 偷拍自拍另类欧美| 日韩午夜电影av| 激情综合五月婷婷| 久久九九久精品国产免费直播| 高清shemale亚洲人妖| 国产欧美一区二区精品性| 成人深夜在线观看| 亚洲天堂免费看| 一本色道a无线码一区v| 亚洲国产sm捆绑调教视频| 在线电影院国产精品| 日本亚洲电影天堂| 国产亚洲精品资源在线26u| 国产69精品久久久久毛片| 亚洲欧洲av在线| 欧美午夜精品一区| 免费高清成人在线| 久久九九99视频| 色婷婷综合久久久久中文 | 日本不卡不码高清免费观看| 日韩精品影音先锋| 国产91丝袜在线播放0| 一区二区在线观看免费视频播放| 在线观看91视频| 国产自产视频一区二区三区| 国产精品网站一区| 欧美熟乱第一页| 国产剧情一区在线| 亚洲欧美日韩久久| 欧美大片国产精品|