91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 4.01MB
    文件類型: .bz2
    金幣: 1
    下載: 0 次
    發布日期: 2023-10-31
  • 語言: 其他
  • 標簽: yaffs2??

資源簡介

2017年5月更新的yaff2源碼

資源截圖

代碼片段和文件信息

/*
?*?YAFFS:?Yet?Another?Flash?File?System.?A?NAND-flash?specific?file?system.
?*
?*?Copyright?(C)?2002-2011?Aleph?One?Ltd.
?*???for?Toby?Churchill?Ltd?and?Brightstar?Engineering
?*
?*?Created?by?Charles?Manning?
?*
?*?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.
?*/

#include?“yaffs_allocator.h“
#include?“yaffs_guts.h“
#include?“yaffs_trace.h“
#include?“yportenv.h“

/*
?*?Each?entry?in?yaffs_tnode_list?and?yaffs_obj_list?hold?blocks
?*?of?approx?100?objects?that?are?themn?allocated?singly.
?*?This?is?basically?a?simplified?slab?allocator.
?*
?*?We?don‘t?use?the?Linux?slab?allocator?because?slab?does?not?allow
?*?us?to?dump?all?the?objects?in?one?hit?when?we?do?a?umount?and?tear
?*?down??all?the?tnodes?and?objects.?slab?requires?that?we?first?free
?*?the?individual?objects.
?*
?*?Once?yaffs?has?been?mainlined?I?shall?try?to?motivate?for?a?change
?*?to?slab?to?provide?the?extra?features?we?need?here.
?*/

struct?yaffs_tnode_list?{
struct?yaffs_tnode_list?*next;
struct?yaffs_tnode?*tnodes;
};

struct?yaffs_obj_list?{
struct?yaffs_obj_list?*next;
struct?yaffs_obj?*objects;
};

struct?yaffs_allocator?{
int?n_tnodes_created;
struct?yaffs_tnode?*free_tnodes;
int?n_free_tnodes;
struct?yaffs_tnode_list?*alloc_tnode_list;

int?n_obj_created;
struct?list_head?free_objs;
int?n_free_objects;

struct?yaffs_obj_list?*allocated_obj_list;
};

static?void?yaffs_deinit_raw_tnodes(struct?yaffs_dev?*dev)
{
struct?yaffs_allocator?*allocator?=
????(struct?yaffs_allocator?*)dev->allocator;
struct?yaffs_tnode_list?*tmp;

if?(!allocator)?{
BUG();
return;
}

while?(allocator->alloc_tnode_list)?{
tmp?=?allocator->alloc_tnode_list->next;

kfree(allocator->alloc_tnode_list->tnodes);
kfree(allocator->alloc_tnode_list);
allocator->alloc_tnode_list?=?tmp;
}

allocator->free_tnodes?=?NULL;
allocator->n_free_tnodes?=?0;
allocator->n_tnodes_created?=?0;
}

static?void?yaffs_init_raw_tnodes(struct?yaffs_dev?*dev)
{
struct?yaffs_allocator?*allocator?=?dev->allocator;

if?(!allocator)?{
BUG();
return;
}

allocator->alloc_tnode_list?=?NULL;
allocator->free_tnodes?=?NULL;
allocator->n_free_tnodes?=?0;
allocator->n_tnodes_created?=?0;
}

static?int?yaffs_create_tnodes(struct?yaffs_dev?*dev?int?n_tnodes)
{
struct?yaffs_allocator?*allocator?=
????(struct?yaffs_allocator?*)dev->allocator;
int?i;
struct?yaffs_tnode?*new_tnodes;
u8?*mem;
struct?yaffs_tnode?*curr;
struct?yaffs_tnode?*next;
struct?yaffs_tnode_list?*tnl;

if?(!allocator)?{
BUG();
return?YAFFS_FAIL;
}

if?(n_tnodes? return?YAFFS_OK;

/*?make?these?things?*/
new_tnodes?=?kmalloc(n_tnodes?*?dev->tnode_size?GFP_NOFS);
mem?=?(u8?*)?new_tnodes;

if?(!new_tnodes)?{
yaffs_trace(YAFFS_TRACE_ERROR
“yaffs:?Could?not?allocate?Tnodes“);
return?YAFFS_FAIL;
}

/*?New?hookup?for?wide?tnodes?*/
for?(i?=?0

評論

共有 條評論