summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9131fec)
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
29 files changed:
YAFFSSYMLINKS = devextras.h yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yportenv.h yaffs_tagscompat.c yaffs_tagscompat.h \
yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h \
YAFFSSYMLINKS = devextras.h yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yportenv.h yaffs_tagscompat.c yaffs_tagscompat.h \
yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h \
- yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h yaffs_list.h \
+ yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h \
yaffs_tagsvalidity.c yaffs_tagsvalidity.h yaffs_checkptrw.h yaffs_checkptrw.c \
yaffs_nameval.c yaffs_nameval.h \
yaffs_qsort.h yaffs_trace.h \
yaffs_tagsvalidity.c yaffs_tagsvalidity.h yaffs_checkptrw.h yaffs_checkptrw.c \
yaffs_nameval.c yaffs_nameval.h \
yaffs_qsort.h yaffs_trace.h \
YAFFSDIRECTSYMLINKS = yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
yaffsfs.h yaffs_malloc.h ydirectenv.h \
YAFFSDIRECTSYMLINKS = yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
yaffsfs.h yaffs_malloc.h ydirectenv.h \
- yaffs_flashif.c yaffscfg.h \
+ yaffs_flashif.c yaffscfg.h yaffs_list.h \
yaffs_qsort.c \
yaffs_nandif.c yaffs_nandif.h yaffs_nandemul2k.h
yaffs_qsort.c \
yaffs_nandif.c yaffs_nandif.h yaffs_nandemul2k.h
if(dev->param.inband_tags){
if(dev->param.inband_tags){
- yaffs_packed_tags2_tags_only * pt2tp;
- pt2tp = (yaffs_packed_tags2_tags_only *)&data[dev->data_bytes_per_chunk];
+ struct yaffs_packed_tags2_tags_only * pt2tp;
+ pt2tp = (struct yaffs_packed_tags2_tags_only *)&data[dev->data_bytes_per_chunk];
yaffs_pack_tags2_tags_only(pt2tp,tags);
pos = (nand_chunk % (PAGES_PER_BLOCK * BLOCKS_PER_HANDLE)) * PAGE_SIZE;
yaffs_pack_tags2_tags_only(pt2tp,tags);
pos = (nand_chunk % (PAGES_PER_BLOCK * BLOCKS_PER_HANDLE)) * PAGE_SIZE;
+ struct yaffs_packed_tags2 pt;
yaffs_pack_tags2(&pt,tags, !dev->param.no_tags_ecc);
u8 * ptab = (u8 *)&pt;
yaffs_pack_tags2(&pt,tags, !dev->param.no_tags_ecc);
u8 * ptab = (u8 *)&pt;
+ struct yaffs_packed_tags2 pt;
yaffs_pack_tags2(&pt,tags,!dev->param.no_tags_ecc);
u8 * ptab = (u8 *)&pt;
yaffs_pack_tags2(&pt,tags,!dev->param.no_tags_ecc);
u8 * ptab = (u8 *)&pt;
- yaffs_packed_tags2_tags_only * pt2tp;
- pt2tp = (yaffs_packed_tags2_tags_only *)&data[dev->data_bytes_per_chunk];
+ struct yaffs_packed_tags2_tags_only * pt2tp;
+ pt2tp = (struct yaffs_packed_tags2_tags_only *)&data[dev->data_bytes_per_chunk];
pos = (nand_chunk % (PAGES_PER_BLOCK * BLOCKS_PER_HANDLE)) * PAGE_SIZE;
pos = (nand_chunk % (PAGES_PER_BLOCK * BLOCKS_PER_HANDLE)) * PAGE_SIZE;
+ struct yaffs_packed_tags2 pt;
nread= read(h,&pt,sizeof(pt));
yaffs_unpack_tags2(tags,&pt, !dev->param.no_tags_ecc);
#ifdef SIMULATE_FAILURES
nread= read(h,&pt,sizeof(pt));
yaffs_unpack_tags2(tags,&pt, !dev->param.no_tags_ecc);
#ifdef SIMULATE_FAILURES
+ struct yaffs_packed_tags2 pt;
+ struct yaffs_packed_tags1 pt;
yaffs_pack_tags1(&pt,tags);
memcpy(&ramdisk.block[blk]->page[pg].data[512],&pt,sizeof(pt));
yaffs_pack_tags1(&pt,tags);
memcpy(&ramdisk.block[blk]->page[pg].data[512],&pt,sizeof(pt));
+ struct yaffs_packed_tags1 pt;
memcpy(&pt,&ramdisk.block[blk]->page[pg].data[512],sizeof(pt));
yaffs_unpack_tags1(tags,&pt);
memcpy(&pt,&ramdisk.block[blk]->page[pg].data[512],sizeof(pt));
yaffs_unpack_tags1(tags,&pt);
{
x = &ned.block[blk]->page[pg]->data[PAGE_DATA_SIZE];
{
x = &ned.block[blk]->page[pg]->data[PAGE_DATA_SIZE];
- yaffs_pack_tags2((yaffs_packed_tags2 *)x,tags, !dev->param.no_tags_ecc);
+ yaffs_pack_tags2((struct yaffs_packed_tags2 *)x,tags, !dev->param.no_tags_ecc);
{
x = &ned.block[blk]->page[pg]->data[PAGE_DATA_SIZE];
{
x = &ned.block[blk]->page[pg]->data[PAGE_DATA_SIZE];
- yaffs_unpack_tags2(tags,(yaffs_packed_tags2 *)x, !dev->param.no_tags_ecc);
+ yaffs_unpack_tags2(tags,(struct yaffs_packed_tags2 *)x, !dev->param.no_tags_ecc);
x = &ned.block[block_no]->page[0]->data[PAGE_DATA_SIZE];
x = &ned.block[block_no]->page[0]->data[PAGE_DATA_SIZE];
- memset(x,0,sizeof(yaffs_packed_tags2));
+ memset(x,0,sizeof(struct yaffs_packed_tags2));
YAFFSSYMLINKS = devextras.h yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yportenv.h yaffs_tagscompat.c yaffs_tagscompat.h \
yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h \
YAFFSSYMLINKS = devextras.h yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yportenv.h yaffs_tagscompat.c yaffs_tagscompat.h \
yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h \
- yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h yaffs_list.h \
+ yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h \
yaffs_tagsvalidity.c yaffs_tagsvalidity.h yaffs_checkptrw.h yaffs_checkptrw.c \
yaffs_nameval.c yaffs_nameval.h \
yaffs_qsort.h yaffs_trace.h \
yaffs_tagsvalidity.c yaffs_tagsvalidity.h yaffs_checkptrw.h yaffs_checkptrw.c \
yaffs_nameval.c yaffs_nameval.h \
yaffs_qsort.h yaffs_trace.h \
YAFFSDIRECTSYMLINKS = yaffsfs.c yaffsfs.h yaffscfg.h yaffs_malloc.h ydirectenv.h \
YAFFSDIRECTSYMLINKS = yaffsfs.c yaffsfs.h yaffscfg.h yaffs_malloc.h ydirectenv.h \
- yaffs_flashif.c yaffs_flashif.h yaffs_flashif2.h\
+ yaffs_flashif.c yaffs_flashif.h yaffs_flashif2.h yaffs_list.h \
yaffs_nandif.c yaffs_nandif.h yaffs_qsort.c yaffs_nandemul2k.h
DIRECTEXTRASYMLINKS = yaffscfg2k.c yaffs_fileem2k.c yaffs_fileem2k.h\
yaffs_nandif.c yaffs_nandif.h yaffs_qsort.c yaffs_nandemul2k.h
DIRECTEXTRASYMLINKS = yaffscfg2k.c yaffs_fileem2k.c yaffs_fileem2k.h\
YAFFSSYMLINKS = devextras.h yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yportenv.h yaffs_tagscompat.c yaffs_tagscompat.h \
yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h yaffs_nandemul2k.h \
YAFFSSYMLINKS = devextras.h yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yportenv.h yaffs_tagscompat.c yaffs_tagscompat.h \
yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h yaffs_nandemul2k.h \
- yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h yaffs_list.h \
+ yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h \
yaffs_tagsvalidity.c yaffs_tagsvalidity.h yaffs_checkptrw.h yaffs_checkptrw.c \
yaffs_nameval.c yaffs_nameval.h \
yaffs_qsort.h yaffs_trace.h \
yaffs_tagsvalidity.c yaffs_tagsvalidity.h yaffs_checkptrw.h yaffs_checkptrw.c \
yaffs_nameval.c yaffs_nameval.h \
yaffs_qsort.h yaffs_trace.h \
YAFFSDIRECTSYMLINKS = yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
yaffsfs.h yaffs_malloc.h ydirectenv.h \
yaffs_flashif.c yaffscfg.h yaffs_qsort.c \
YAFFSDIRECTSYMLINKS = yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
yaffsfs.h yaffs_malloc.h ydirectenv.h \
yaffs_flashif.c yaffscfg.h yaffs_qsort.c \
+ yaffs_nandemul2k.h yaffs_list.h \
yaffs_nandif.c yaffs_nandif.h
yaffs_nandif.c yaffs_nandif.h
* way the Linux kernel doubly linked list implementation works.
*/
* way the Linux kernel doubly linked list implementation works.
*/
-struct ylist_head {
- struct ylist_head *next; /* next in chain */
- struct ylist_head *prev; /* previous in chain */
+struct list_head {
+ struct list_head *next; /* next in chain */
+ struct list_head *prev; /* previous in chain */
};
/* Initialise a static list */
};
/* Initialise a static list */
-#define YLIST_HEAD(name) \
-struct ylist_head name = { &(name), &(name)}
+#define LIST_HEAD(name) \
+struct list_head name = { &(name), &(name)}
/* Initialise a list head to an empty list */
/* Initialise a list head to an empty list */
-#define YINIT_LIST_HEAD(p) \
+#define INIT_LIST_HEAD(p) \
do { \
(p)->next = (p);\
(p)->prev = (p); \
do { \
(p)->next = (p);\
(p)->prev = (p); \
/* Add an element to a list */
/* Add an element to a list */
-static Y_INLINE void ylist_add(struct ylist_head *new_entry,
- struct ylist_head *list)
+static Y_INLINE void list_add(struct list_head *new_entry,
+ struct list_head *list)
- struct ylist_head *list_next = list->next;
+ struct list_head *list_next = list->next;
list->next = new_entry;
new_entry->prev = list;
list->next = new_entry;
new_entry->prev = list;
-static Y_INLINE void ylist_add_tail(struct ylist_head *new_entry,
- struct ylist_head *list)
+static Y_INLINE void list_add_tail(struct list_head *new_entry,
+ struct list_head *list)
- struct ylist_head *list_prev = list->prev;
+ struct list_head *list_prev = list->prev;
list->prev = new_entry;
new_entry->next = list;
list->prev = new_entry;
new_entry->next = list;
/* Take an element out of its current list, with or without
* reinitialising the links.of the entry*/
/* Take an element out of its current list, with or without
* reinitialising the links.of the entry*/
-static Y_INLINE void ylist_del(struct ylist_head *entry)
+static Y_INLINE void list_del(struct list_head *entry)
- struct ylist_head *list_next = entry->next;
- struct ylist_head *list_prev = entry->prev;
+ struct list_head *list_next = entry->next;
+ struct list_head *list_prev = entry->prev;
list_next->prev = list_prev;
list_prev->next = list_next;
}
list_next->prev = list_prev;
list_prev->next = list_next;
}
-static Y_INLINE void ylist_del_init(struct ylist_head *entry)
+static Y_INLINE void list_del_init(struct list_head *entry)
entry->next = entry->prev = entry;
}
/* Test if the list is empty */
entry->next = entry->prev = entry;
}
/* Test if the list is empty */
-static Y_INLINE int ylist_empty(struct ylist_head *entry)
+static Y_INLINE int list_empty(struct list_head *entry)
{
return (entry->next == entry);
}
{
return (entry->next == entry);
}
-/* ylist_entry takes a pointer to a list entry and offsets it to that
+/* list_entry takes a pointer to a list entry and offsets it to that
* we can find a pointer to the object it is embedded in.
*/
* we can find a pointer to the object it is embedded in.
*/
-#define ylist_entry(entry, type, member) \
+#define list_entry(entry, type, member) \
((type *)((char *)(entry)-(unsigned long)(&((type *)NULL)->member)))
((type *)((char *)(entry)-(unsigned long)(&((type *)NULL)->member)))
-/* ylist_for_each and list_for_each_safe iterate over lists.
- * ylist_for_each_safe uses temporary storage to make the list delete safe
+/* list_for_each and list_for_each_safe iterate over lists.
+ * list_for_each_safe uses temporary storage to make the list delete safe
-#define ylist_for_each(itervar, list) \
+#define list_for_each(itervar, list) \
for (itervar = (list)->next; itervar != (list); itervar = itervar->next)
for (itervar = (list)->next; itervar != (list); itervar = itervar->next)
-#define ylist_for_each_safe(itervar, save_var, list) \
+#define list_for_each_safe(itervar, save_var, list) \
for (itervar = (list)->next, save_var = (list)->next->next; \
itervar != (list); itervar = save_var, save_var = save_var->next)
for (itervar = (list)->next, save_var = (list)->next->next; \
itervar != (list); itervar = save_var, save_var = save_var->next)
+ struct yaffs_packed_tags2 pt;
void *spare;
unsigned spareSize = 0;
ynandif_Geometry *geometry = (ynandif_Geometry *)(dev->driver_context);
void *spare;
unsigned spareSize = 0;
ynandif_Geometry *geometry = (ynandif_Geometry *)(dev->driver_context);
*/
if(dev->param.inband_tags){
*/
if(dev->param.inband_tags){
- yaffs_packed_tags2_tags_only *pt2tp;
- pt2tp = (yaffs_packed_tags2_tags_only *)(data + dev->data_bytes_per_chunk);
+ struct yaffs_packed_tags2_tags_only *pt2tp;
+ pt2tp = (struct yaffs_packed_tags2_tags_only *)(data + dev->data_bytes_per_chunk);
yaffs_pack_tags2_tags_only(pt2tp,tags);
spare = NULL;
spareSize = 0;
yaffs_pack_tags2_tags_only(pt2tp,tags);
spare = NULL;
spareSize = 0;
else{
yaffs_pack_tags2(&pt, tags,!dev->param.no_tags_ecc);
spare = &pt;
else{
yaffs_pack_tags2(&pt, tags,!dev->param.no_tags_ecc);
spare = &pt;
- spareSize = sizeof(yaffs_packed_tags2);
+ spareSize = sizeof(struct yaffs_packed_tags2);
}
retval = geometry->writeChunk(dev,nand_chunk,
}
retval = geometry->writeChunk(dev,nand_chunk,
int ynandif_ReadChunkWithTagsFromNAND(struct yaffs_dev * dev, int nand_chunk,
u8 * data, struct yaffs_ext_tags * tags)
{
int ynandif_ReadChunkWithTagsFromNAND(struct yaffs_dev * dev, int nand_chunk,
u8 * data, struct yaffs_ext_tags * tags)
{
+ struct yaffs_packed_tags2 pt;
int localData = 0;
void *spare = NULL;
unsigned spareSize;
int localData = 0;
void *spare = NULL;
unsigned spareSize;
- spareSize = sizeof(yaffs_packed_tags2);
+ spareSize = sizeof(struct yaffs_packed_tags2);
}
retval = geometry->readChunk(dev,nand_chunk,
}
retval = geometry->readChunk(dev,nand_chunk,
if(dev->param.inband_tags){
if(tags){
if(dev->param.inband_tags){
if(tags){
- yaffs_packed_tags2_tags_only * pt2tp;
- pt2tp = (yaffs_packed_tags2_tags_only *)&data[dev->data_bytes_per_chunk];
+ struct yaffs_packed_tags2_tags_only * pt2tp;
+ pt2tp = (struct yaffs_packed_tags2_tags_only *)&data[dev->data_bytes_per_chunk];
yaffs_unpack_tags2_tags_only(tags,pt2tp);
}
}
yaffs_unpack_tags2_tags_only(tags,pt2tp);
}
}
-YLIST_HEAD(yaffsfs_deviceList);
+LIST_HEAD(yaffsfs_deviceList);
*/
static struct yaffs_dev *yaffsfs_FindDevice(const YCHAR *path, YCHAR **restOfPath)
{
*/
static struct yaffs_dev *yaffsfs_FindDevice(const YCHAR *path, YCHAR **restOfPath)
{
- struct ylist_head *cfg;
const YCHAR *leftOver;
const YCHAR *p;
struct yaffs_dev *retval = NULL;
const YCHAR *leftOver;
const YCHAR *p;
struct yaffs_dev *retval = NULL;
* 1) Actually matches a prefix (ie /a amd /abc will not match
* 2) Matches the longest.
*/
* 1) Actually matches a prefix (ie /a amd /abc will not match
* 2) Matches the longest.
*/
- ylist_for_each(cfg, &yaffsfs_deviceList){
- dev = ylist_entry(cfg, struct yaffs_dev, dev_list);
+ list_for_each(cfg, &yaffsfs_deviceList){
+ dev = list_entry(cfg, struct yaffs_dev, dev_list);
leftOver = path;
p = dev->param.name;
thisMatchLength = 0;
leftOver = path;
p = dev->param.name;
thisMatchLength = 0;
dev->param.remove_obj_fn = yaffsfs_RemoveObjectCallback;
if(!dev->dev_list.next)
dev->param.remove_obj_fn = yaffsfs_RemoveObjectCallback;
if(!dev->dev_list.next)
- YINIT_LIST_HEAD(&dev->dev_list);
+ INIT_LIST_HEAD(&dev->dev_list);
- ylist_add(&dev->dev_list,&yaffsfs_deviceList);
+ list_add(&dev->dev_list,&yaffsfs_deviceList);
}
void yaffs_remove_device(struct yaffs_dev *dev)
{
}
void yaffs_remove_device(struct yaffs_dev *dev)
{
- ylist_del_init(&dev->dev_list);
+ list_del_init(&dev->dev_list);
struct yaffs_obj *dirObj; /* ptr to directory being searched */
struct yaffs_obj *nextReturn; /* obj to be returned by next readddir */
int offset;
struct yaffs_obj *dirObj; /* ptr to directory being searched */
struct yaffs_obj *nextReturn; /* obj to be returned by next readddir */
int offset;
- struct ylist_head others;
+ struct list_head others;
} yaffsfs_DirectorySearchContext;
} yaffsfs_DirectorySearchContext;
-static struct ylist_head search_contexts;
+static struct list_head search_contexts;
static void yaffsfs_SetDirRewound(yaffsfs_DirectorySearchContext *dsc)
static void yaffsfs_SetDirRewound(yaffsfs_DirectorySearchContext *dsc)
- if( ylist_empty(&dsc->dirObj->variant.dir_variant.children))
+ if( list_empty(&dsc->dirObj->variant.dir_variant.children))
dsc->nextReturn = NULL;
else
dsc->nextReturn = NULL;
else
- dsc->nextReturn = ylist_entry(dsc->dirObj->variant.dir_variant.children.next,
+ dsc->nextReturn = list_entry(dsc->dirObj->variant.dir_variant.children.next,
struct yaffs_obj,siblings);
} else {
/* Hey someone isn't playing nice! */
struct yaffs_obj,siblings);
} else {
/* Hey someone isn't playing nice! */
dsc->dirObj->variant_type == YAFFS_OBJECT_TYPE_DIRECTORY){
if( dsc->nextReturn == NULL ||
dsc->dirObj->variant_type == YAFFS_OBJECT_TYPE_DIRECTORY){
if( dsc->nextReturn == NULL ||
- ylist_empty(&dsc->dirObj->variant.dir_variant.children))
+ list_empty(&dsc->dirObj->variant.dir_variant.children))
dsc->nextReturn = NULL;
else {
dsc->nextReturn = NULL;
else {
- struct ylist_head *next = dsc->nextReturn->siblings.next;
+ struct list_head *next = dsc->nextReturn->siblings.next;
if( next == &dsc->dirObj->variant.dir_variant.children)
dsc->nextReturn = NULL; /* end of list */
else
if( next == &dsc->dirObj->variant.dir_variant.children)
dsc->nextReturn = NULL; /* end of list */
else
- dsc->nextReturn = ylist_entry(next,struct yaffs_obj,siblings);
+ dsc->nextReturn = list_entry(next,struct yaffs_obj,siblings);
}
} else {
/* Hey someone isn't playing nice! */
}
} else {
/* Hey someone isn't playing nice! */
static void yaffsfs_RemoveObjectCallback(struct yaffs_obj *obj)
{
static void yaffsfs_RemoveObjectCallback(struct yaffs_obj *obj)
{
yaffsfs_DirectorySearchContext *dsc;
/* if search contexts not initilised then skip */
yaffsfs_DirectorySearchContext *dsc;
/* if search contexts not initilised then skip */
* If any are the one being removed, then advance the dsc to
* the next one to prevent a hanging ptr.
*/
* If any are the one being removed, then advance the dsc to
* the next one to prevent a hanging ptr.
*/
- ylist_for_each(i, &search_contexts) {
+ list_for_each(i, &search_contexts) {
- dsc = ylist_entry(i, yaffsfs_DirectorySearchContext,others);
+ dsc = list_entry(i, yaffsfs_DirectorySearchContext,others);
if(dsc->nextReturn == obj)
yaffsfs_DirAdvance(dsc);
}
if(dsc->nextReturn == obj)
yaffsfs_DirAdvance(dsc);
}
dsc->magic = YAFFS_MAGIC;
dsc->dirObj = obj;
yaffs_strncpy(dsc->name,dirname,NAME_MAX);
dsc->magic = YAFFS_MAGIC;
dsc->dirObj = obj;
yaffs_strncpy(dsc->name,dirname,NAME_MAX);
- YINIT_LIST_HEAD(&dsc->others);
+ INIT_LIST_HEAD(&dsc->others);
if(!search_contexts.next)
if(!search_contexts.next)
- YINIT_LIST_HEAD(&search_contexts);
+ INIT_LIST_HEAD(&search_contexts);
- ylist_add(&dsc->others,&search_contexts);
+ list_add(&dsc->others,&search_contexts);
yaffsfs_SetDirRewound(dsc);
}
yaffsfs_SetDirRewound(dsc);
}
yaffsfs_Lock();
dsc->magic = 0;
yaffsfs_Lock();
dsc->magic = 0;
- ylist_del(&dsc->others); /* unhook from list */
+ list_del(&dsc->others); /* unhook from list */
YFREE(dsc);
yaffsfs_Unlock();
return 0;
YFREE(dsc);
yaffsfs_Unlock();
return 0;
#define yaffs_sum_cmp(x,y) ((x) == (y))
#define yaffs_strcmp(a,b) strcmp(a,b)
#define yaffs_sum_cmp(x,y) ((x) == (y))
#define yaffs_strcmp(a,b) strcmp(a,b)
+#include "yaffs_list.h"
+
+
#include "yaffsfs.h"
#endif
#include "yaffsfs.h"
#endif
-static void shuffle_oob(char *spareData, yaffs_packed_tags2 *pt)
+static void shuffle_oob(char *spareData, struct yaffs_packed_tags2 *pt)
{
assert(sizeof(*pt) <= spareSize);
// NAND LAYOUT: For non-trivial OOB orderings, here would be a good place to shuffle.
{
assert(sizeof(*pt) <= spareSize);
// NAND LAYOUT: For non-trivial OOB orderings, here would be a good place to shuffle.
static int write_chunk(u8 *data, u32 id, u32 chunk_id, u32 n_bytes)
{
struct yaffs_ext_tags t;
static int write_chunk(u8 *data, u32 id, u32 chunk_id, u32 n_bytes)
{
struct yaffs_ext_tags t;
+ struct yaffs_packed_tags2 pt;
char spareData[spareSize];
if (write(outFile,data,chunkSize) != chunkSize)
char spareData[spareSize];
if (write(outFile,data,chunkSize) != chunkSize)
/* Hook them into the free list */
for (i = 0; i < n_obj - 1; i++) {
new_objs[i].siblings.next =
/* Hook them into the free list */
for (i = 0; i < n_obj - 1; i++) {
new_objs[i].siblings.next =
- (struct ylist_head *)(&new_objs[i + 1]);
+ (struct list_head *)(&new_objs[i + 1]);
}
new_objs[n_obj - 1].siblings.next = (void *)allocator->free_objs;
}
new_objs[n_obj - 1].siblings.next = (void *)allocator->free_objs;
YBUG();
else {
/* Link into the free list. */
YBUG();
else {
/* Link into the free list. */
- obj->siblings.next = (struct ylist_head *)(allocator->free_objs);
+ obj->siblings.next = (struct list_head *)(allocator->free_objs);
allocator->free_objs = obj;
allocator->n_free_objects++;
}
allocator->free_objs = obj;
allocator->n_free_objects++;
}
* ECCxxxOther does ECC calcs on arbitrary n bytes of data
*/
void yaffs_ecc_calc_other(const unsigned char *data, unsigned n_bytes,
* ECCxxxOther does ECC calcs on arbitrary n bytes of data
*/
void yaffs_ecc_calc_other(const unsigned char *data, unsigned n_bytes,
- yaffs_ecc_other *ecc_other)
+ struct yaffs_ecc_other *ecc_other)
}
int yaffs_ecc_correct_other(unsigned char *data, unsigned n_bytes,
}
int yaffs_ecc_correct_other(unsigned char *data, unsigned n_bytes,
- yaffs_ecc_other *read_ecc,
- const yaffs_ecc_other *test_ecc)
+ struct yaffs_ecc_other *read_ecc,
+ const struct yaffs_ecc_other *test_ecc)
{
unsigned char delta_col; /* column parity delta */
unsigned delta_line; /* line parity delta */
{
unsigned char delta_col; /* column parity delta */
unsigned delta_line; /* line parity delta */
#ifndef __YAFFS_ECC_H__
#define __YAFFS_ECC_H__
#ifndef __YAFFS_ECC_H__
#define __YAFFS_ECC_H__
+struct yaffs_ecc_other {
unsigned char col_parity;
unsigned line_parity;
unsigned line_parity_prime;
unsigned char col_parity;
unsigned line_parity;
unsigned line_parity_prime;
void yaffs_ecc_cacl(const unsigned char *data, unsigned char *ecc);
int yaffs_ecc_correct(unsigned char *data, unsigned char *read_ecc,
const unsigned char *test_ecc);
void yaffs_ecc_calc_other(const unsigned char *data, unsigned n_bytes,
void yaffs_ecc_cacl(const unsigned char *data, unsigned char *ecc);
int yaffs_ecc_correct(unsigned char *data, unsigned char *read_ecc,
const unsigned char *test_ecc);
void yaffs_ecc_calc_other(const unsigned char *data, unsigned n_bytes,
+ struct yaffs_ecc_other *ecc);
int yaffs_ecc_correct_other(unsigned char *data, unsigned n_bytes,
int yaffs_ecc_correct_other(unsigned char *data, unsigned n_bytes,
- yaffs_ecc_other *read_ecc,
- const yaffs_ecc_other *test_ecc);
+ struct yaffs_ecc_other *read_ecc,
+ const struct yaffs_ecc_other *test_ecc);
obj->my_dev = dev;
obj->hdr_chunk = 0;
obj->variant_type = YAFFS_OBJECT_TYPE_UNKNOWN;
obj->my_dev = dev;
obj->hdr_chunk = 0;
obj->variant_type = YAFFS_OBJECT_TYPE_UNKNOWN;
- YINIT_LIST_HEAD(&(obj->hard_links));
- YINIT_LIST_HEAD(&(obj->hash_link));
- YINIT_LIST_HEAD(&obj->siblings);
+ INIT_LIST_HEAD(&(obj->hard_links));
+ INIT_LIST_HEAD(&(obj->hash_link));
+ INIT_LIST_HEAD(&obj->siblings);
/* Now make the directory sane */
if (dev->root_dir) {
obj->parent = dev->root_dir;
/* Now make the directory sane */
if (dev->root_dir) {
obj->parent = dev->root_dir;
- ylist_add(&(obj->siblings), &dev->root_dir->variant.dir_variant.children);
+ list_add(&(obj->siblings), &dev->root_dir->variant.dir_variant.children);
}
/* Add it to the lost and found directory.
}
/* Add it to the lost and found directory.
struct yaffs_dev *dev = obj->my_dev;
/* If it is still linked into the bucket list, free from the list */
struct yaffs_dev *dev = obj->my_dev;
/* If it is still linked into the bucket list, free from the list */
- if (!ylist_empty(&obj->hash_link)) {
- ylist_del_init(&obj->hash_link);
+ if (!list_empty(&obj->hash_link)) {
+ list_del_init(&obj->hash_link);
bucket = yaffs_hash_fn(obj->obj_id);
dev->obj_bucket[bucket].count--;
}
bucket = yaffs_hash_fn(obj->obj_id);
dev->obj_bucket[bucket].count--;
}
YBUG();
if (obj->parent)
YBUG();
YBUG();
if (obj->parent)
YBUG();
- if (!ylist_empty(&obj->siblings))
+ if (!list_empty(&obj->siblings))
yaffs_init_raw_tnodes_and_objs(dev);
for (i = 0; i < YAFFS_NOBJECT_BUCKETS; i++) {
yaffs_init_raw_tnodes_and_objs(dev);
for (i = 0; i < YAFFS_NOBJECT_BUCKETS; i++) {
- YINIT_LIST_HEAD(&dev->obj_bucket[i].list);
+ INIT_LIST_HEAD(&dev->obj_bucket[i].list);
dev->obj_bucket[i].count = 0;
}
}
dev->obj_bucket[i].count = 0;
}
}
found = 1;
n += YAFFS_NOBJECT_BUCKETS;
if (1 || dev->obj_bucket[bucket].count > 0) {
found = 1;
n += YAFFS_NOBJECT_BUCKETS;
if (1 || dev->obj_bucket[bucket].count > 0) {
- ylist_for_each(i, &dev->obj_bucket[bucket].list) {
+ list_for_each(i, &dev->obj_bucket[bucket].list) {
/* If there is already one in the list */
/* If there is already one in the list */
- if (i && ylist_entry(i, struct yaffs_obj,
+ if (i && list_entry(i, struct yaffs_obj,
hash_link)->obj_id == n) {
found = 0;
}
hash_link)->obj_id == n) {
found = 0;
}
int bucket = yaffs_hash_fn(in->obj_id);
struct yaffs_dev *dev = in->my_dev;
int bucket = yaffs_hash_fn(in->obj_id);
struct yaffs_dev *dev = in->my_dev;
- ylist_add(&in->hash_link, &dev->obj_bucket[bucket].list);
+ list_add(&in->hash_link, &dev->obj_bucket[bucket].list);
dev->obj_bucket[bucket].count++;
}
struct yaffs_obj *yaffs_find_by_number(struct yaffs_dev *dev, u32 number)
{
int bucket = yaffs_hash_fn(number);
dev->obj_bucket[bucket].count++;
}
struct yaffs_obj *yaffs_find_by_number(struct yaffs_dev *dev, u32 number)
{
int bucket = yaffs_hash_fn(number);
- ylist_for_each(i, &dev->obj_bucket[bucket].list) {
+ list_for_each(i, &dev->obj_bucket[bucket].list) {
/* Look if it is in the list */
if (i) {
/* Look if it is in the list */
if (i) {
- in = ylist_entry(i, struct yaffs_obj, hash_link);
+ in = list_entry(i, struct yaffs_obj, hash_link);
if (in->obj_id == number) {
/* Don't tell the VFS about this one if it is defered free */
if (in->obj_id == number) {
/* Don't tell the VFS about this one if it is defered free */
the_obj->variant.file_variant.top = tn;
break;
case YAFFS_OBJECT_TYPE_DIRECTORY:
the_obj->variant.file_variant.top = tn;
break;
case YAFFS_OBJECT_TYPE_DIRECTORY:
- YINIT_LIST_HEAD(&the_obj->variant.dir_variant.
+ INIT_LIST_HEAD(&the_obj->variant.dir_variant.
- YINIT_LIST_HEAD(&the_obj->variant.dir_variant.
+ INIT_LIST_HEAD(&the_obj->variant.dir_variant.
dirty);
break;
case YAFFS_OBJECT_TYPE_SYMLINK:
dirty);
break;
case YAFFS_OBJECT_TYPE_SYMLINK:
equiv_obj;
in->variant.hardlink_variant.equiv_id =
equiv_obj->obj_id;
equiv_obj;
in->variant.hardlink_variant.equiv_id =
equiv_obj->obj_id;
- ylist_add(&in->hard_links, &equiv_obj->hard_links);
+ list_add(&in->hard_links, &equiv_obj->hard_links);
break;
case YAFFS_OBJECT_TYPE_FILE:
case YAFFS_OBJECT_TYPE_DIRECTORY:
break;
case YAFFS_OBJECT_TYPE_FILE:
case YAFFS_OBJECT_TYPE_DIRECTORY:
existing_target = yaffs_find_by_name(new_dir, new_name);
if (existing_target &&
existing_target->variant_type == YAFFS_OBJECT_TYPE_DIRECTORY &&
existing_target = yaffs_find_by_name(new_dir, new_name);
if (existing_target &&
existing_target->variant_type == YAFFS_OBJECT_TYPE_DIRECTORY &&
- !ylist_empty(&existing_target->variant.dir_variant.children)) {
+ !list_empty(&existing_target->variant.dir_variant.children)) {
/* There is a target that is a non-empty directory, so we fail */
return YAFFS_FAIL; /* EEXIST or ENOTEMPTY */
} else if (existing_target && existing_target != obj) {
/* There is a target that is a non-empty directory, so we fail */
return YAFFS_FAIL; /* EEXIST or ENOTEMPTY */
} else if (existing_target && existing_target != obj) {
static int yaffs_is_non_empty_dir(struct yaffs_obj *obj)
{
return (obj->variant_type == YAFFS_OBJECT_TYPE_DIRECTORY) &&
static int yaffs_is_non_empty_dir(struct yaffs_obj *obj)
{
return (obj->variant_type == YAFFS_OBJECT_TYPE_DIRECTORY) &&
- !(ylist_empty(&obj->variant.dir_variant.children));
+ !(list_empty(&obj->variant.dir_variant.children));
}
static int yaffs_del_dir(struct yaffs_obj *obj)
}
static int yaffs_del_dir(struct yaffs_obj *obj)
/* remove this hardlink from the list assocaited with the equivalent
* object
*/
/* remove this hardlink from the list assocaited with the equivalent
* object
*/
- ylist_del_init(&in->hard_links);
+ list_del_init(&in->hard_links);
return yaffs_generic_obj_del(in);
}
return yaffs_generic_obj_del(in);
}
ret_val = yaffs_del_file(obj);
break;
case YAFFS_OBJECT_TYPE_DIRECTORY:
ret_val = yaffs_del_file(obj);
break;
case YAFFS_OBJECT_TYPE_DIRECTORY:
- if(!ylist_empty(&obj->variant.dir_variant.dirty)){
+ if(!list_empty(&obj->variant.dir_variant.dirty)){
T(YAFFS_TRACE_BACKGROUND, (TSTR("Remove object %d from dirty directories" TENDSTR),obj->obj_id));
T(YAFFS_TRACE_BACKGROUND, (TSTR("Remove object %d from dirty directories" TENDSTR),obj->obj_id));
- ylist_del_init(&obj->variant.dir_variant.dirty);
+ list_del_init(&obj->variant.dir_variant.dirty);
}
return yaffs_del_dir(obj);
break;
}
return yaffs_del_dir(obj);
break;
if (obj->variant_type == YAFFS_OBJECT_TYPE_HARDLINK) {
return yaffs_del_link(obj);
if (obj->variant_type == YAFFS_OBJECT_TYPE_HARDLINK) {
return yaffs_del_link(obj);
- } else if (!ylist_empty(&obj->hard_links)) {
+ } else if (!list_empty(&obj->hard_links)) {
/* Curve ball: We're unlinking an object that has a hardlink.
*
* This problem arises because we are not strictly following
/* Curve ball: We're unlinking an object that has a hardlink.
*
* This problem arises because we are not strictly following
int ret_val;
YCHAR name[YAFFS_MAX_NAME_LENGTH + 1];
int ret_val;
YCHAR name[YAFFS_MAX_NAME_LENGTH + 1];
- hl = ylist_entry(obj->hard_links.next, struct yaffs_obj, hard_links);
+ hl = list_entry(obj->hard_links.next, struct yaffs_obj, hard_links);
yaffs_get_obj_name(hl, name, YAFFS_MAX_NAME_LENGTH + 1);
parent = hl->parent;
yaffs_get_obj_name(hl, name, YAFFS_MAX_NAME_LENGTH + 1);
parent = hl->parent;
- ylist_del_init(&hl->hard_links);
+ list_del_init(&hl->hard_links);
yaffs_add_obj_to_dir(obj->my_dev->unlinked_dir, hl);
yaffs_add_obj_to_dir(obj->my_dev->unlinked_dir, hl);
return yaffs_del_file(obj);
break;
case YAFFS_OBJECT_TYPE_DIRECTORY:
return yaffs_del_file(obj);
break;
case YAFFS_OBJECT_TYPE_DIRECTORY:
- ylist_del_init(&obj->variant.dir_variant.dirty);
+ list_del_init(&obj->variant.dir_variant.dirty);
return yaffs_del_dir(obj);
break;
case YAFFS_OBJECT_TYPE_SYMLINK:
return yaffs_del_dir(obj);
break;
case YAFFS_OBJECT_TYPE_SYMLINK:
if (in) {
/* Add the hardlink pointers */
hl->variant.hardlink_variant.equiv_obj = in;
if (in) {
/* Add the hardlink pointers */
hl->variant.hardlink_variant.equiv_obj = in;
- ylist_add(&hl->hard_links, &in->hard_links);
+ list_add(&hl->hard_links, &in->hard_links);
} else {
/* Todo Need to report/handle this better.
* Got a problem... hardlink to a non-existant object
*/
hl->variant.hardlink_variant.equiv_obj = NULL;
} else {
/* Todo Need to report/handle this better.
* Got a problem... hardlink to a non-existant object
*/
hl->variant.hardlink_variant.equiv_obj = NULL;
- YINIT_LIST_HEAD(&hl->hard_links);
+ INIT_LIST_HEAD(&hl->hard_links);
/*
* Sort out state of unlinked and deleted objects after scanning.
*/
/*
* Sort out state of unlinked and deleted objects after scanning.
*/
- struct ylist_head *i;
- struct ylist_head *n;
+ struct list_head *i;
+ struct list_head *n;
struct yaffs_obj *l;
if (dev->read_only)
return;
/* Soft delete all the unlinked files */
struct yaffs_obj *l;
if (dev->read_only)
return;
/* Soft delete all the unlinked files */
- ylist_for_each_safe(i, n,
+ list_for_each_safe(i, n,
&dev->unlinked_dir->variant.dir_variant.children) {
if (i) {
&dev->unlinked_dir->variant.dir_variant.children) {
if (i) {
- l = ylist_entry(i, struct yaffs_obj, siblings);
+ l = list_entry(i, struct yaffs_obj, siblings);
- ylist_for_each_safe(i, n,
+ list_for_each_safe(i, n,
&dev->del_dir->variant.dir_variant.children) {
if (i) {
&dev->del_dir->variant.dir_variant.children) {
if (i) {
- l = ylist_entry(i, struct yaffs_obj, siblings);
+ l = list_entry(i, struct yaffs_obj, siblings);
struct yaffs_obj *obj;
struct yaffs_obj *parent;
int i;
struct yaffs_obj *obj;
struct yaffs_obj *parent;
int i;
- struct ylist_head *lh;
- struct ylist_head *n;
+ struct list_head *lh;
+ struct list_head *n;
int depth_limit;
int hanging;
int depth_limit;
int hanging;
*/
for (i = 0; i < YAFFS_NOBJECT_BUCKETS; i++) {
*/
for (i = 0; i < YAFFS_NOBJECT_BUCKETS; i++) {
- ylist_for_each_safe(lh, n, &dev->obj_bucket[i].list) {
+ list_for_each_safe(lh, n, &dev->obj_bucket[i].list) {
- obj = ylist_entry(lh, struct yaffs_obj, hash_link);
+ obj = list_entry(lh, struct yaffs_obj, hash_link);
parent= obj->parent;
if(yaffs_has_null_parent(dev,obj)){
parent= obj->parent;
if(yaffs_has_null_parent(dev,obj)){
static void yaffs_del_dir_contents(struct yaffs_obj *dir)
{
struct yaffs_obj *obj;
static void yaffs_del_dir_contents(struct yaffs_obj *dir)
{
struct yaffs_obj *obj;
- struct ylist_head *lh;
- struct ylist_head *n;
+ struct list_head *lh;
+ struct list_head *n;
if(dir->variant_type != YAFFS_OBJECT_TYPE_DIRECTORY)
YBUG();
if(dir->variant_type != YAFFS_OBJECT_TYPE_DIRECTORY)
YBUG();
- ylist_for_each_safe(lh, n, &dir->variant.dir_variant.children) {
+ list_for_each_safe(lh, n, &dir->variant.dir_variant.children) {
- obj = ylist_entry(lh, struct yaffs_obj, siblings);
+ obj = list_entry(lh, struct yaffs_obj, siblings);
if(obj->variant_type == YAFFS_OBJECT_TYPE_DIRECTORY)
yaffs_del_dir_contents(obj);
if(obj->variant_type == YAFFS_OBJECT_TYPE_DIRECTORY)
yaffs_del_dir_contents(obj);
obj->dirty = 1;
obj->yst_mtime = obj->yst_ctime = Y_CURRENT_TIME;
if(dev->param.defered_dir_update){
obj->dirty = 1;
obj->yst_mtime = obj->yst_ctime = Y_CURRENT_TIME;
if(dev->param.defered_dir_update){
- struct ylist_head *link = &obj->variant.dir_variant.dirty;
+ struct list_head *link = &obj->variant.dir_variant.dirty;
- if(ylist_empty(link)){
- ylist_add(link,&dev->dirty_dirs);
+ if(list_empty(link)){
+ list_add(link,&dev->dirty_dirs);
T(YAFFS_TRACE_BACKGROUND, (TSTR("Added object %d to dirty directories" TENDSTR),obj->obj_id));
}
T(YAFFS_TRACE_BACKGROUND, (TSTR("Added object %d to dirty directories" TENDSTR),obj->obj_id));
}
void yaffs_update_dirty_dirs(struct yaffs_dev *dev)
{
void yaffs_update_dirty_dirs(struct yaffs_dev *dev)
{
- struct ylist_head *link;
+ struct list_head *link;
struct yaffs_obj *obj;
struct yaffs_dir_var *d_s;
union yaffs_obj_var *o_v;
T(YAFFS_TRACE_BACKGROUND, (TSTR("Update dirty directories" TENDSTR)));
struct yaffs_obj *obj;
struct yaffs_dir_var *d_s;
union yaffs_obj_var *o_v;
T(YAFFS_TRACE_BACKGROUND, (TSTR("Update dirty directories" TENDSTR)));
- while(!ylist_empty(&dev->dirty_dirs)){
+ while(!list_empty(&dev->dirty_dirs)){
link = dev->dirty_dirs.next;
link = dev->dirty_dirs.next;
- d_s=ylist_entry(link,struct yaffs_dir_var,dirty);
- o_v = ylist_entry(d_s,union yaffs_obj_var,dir_variant);
- obj = ylist_entry(o_v,struct yaffs_obj,variant);
+ d_s=list_entry(link,struct yaffs_dir_var,dirty);
+ o_v = list_entry(d_s,union yaffs_obj_var,dir_variant);
+ obj = list_entry(o_v,struct yaffs_obj,variant);
T(YAFFS_TRACE_BACKGROUND, (TSTR("Update directory %d" TENDSTR), obj->obj_id));
T(YAFFS_TRACE_BACKGROUND, (TSTR("Update directory %d" TENDSTR), obj->obj_id));
dev->param.remove_obj_fn(obj);
dev->param.remove_obj_fn(obj);
- ylist_del_init(&obj->siblings);
+ list_del_init(&obj->siblings);
obj->parent = NULL;
yaffs_verify_dir(parent);
obj->parent = NULL;
yaffs_verify_dir(parent);
- ylist_add(&obj->siblings, &directory->variant.dir_variant.children);
+ list_add(&obj->siblings, &directory->variant.dir_variant.children);
obj->parent = directory;
if (directory == obj->my_dev->unlinked_dir
obj->parent = directory;
if (directory == obj->my_dev->unlinked_dir
YCHAR buffer[YAFFS_MAX_NAME_LENGTH + 1];
struct yaffs_obj *l;
YCHAR buffer[YAFFS_MAX_NAME_LENGTH + 1];
struct yaffs_obj *l;
sum = yaffs_calc_name_sum(name);
sum = yaffs_calc_name_sum(name);
- ylist_for_each(i, &directory->variant.dir_variant.children) {
+ list_for_each(i, &directory->variant.dir_variant.children) {
- l = ylist_entry(i, struct yaffs_obj, siblings);
+ l = list_entry(i, struct yaffs_obj, siblings);
if (l->parent != directory)
YBUG();
if (l->parent != directory)
YBUG();
int yaffs_get_obj_link_count(struct yaffs_obj *obj)
{
int count = 0;
int yaffs_get_obj_link_count(struct yaffs_obj *obj)
{
int count = 0;
if (!obj->unlinked)
count++; /* the object itself */
if (!obj->unlinked)
count++; /* the object itself */
- ylist_for_each(i, &obj->hard_links)
+ list_for_each(i, &obj->hard_links)
count++; /* add the hard links; */
return count;
count++; /* add the hard links; */
return count;
/* Sort out space for inband tags, if required */
if (dev->param.inband_tags)
/* Sort out space for inband tags, if required */
if (dev->param.inband_tags)
- dev->data_bytes_per_chunk = dev->param.total_bytes_per_chunk - sizeof(yaffs_packed_tags2_tags_only);
+ dev->data_bytes_per_chunk = dev->param.total_bytes_per_chunk - sizeof(struct yaffs_packed_tags2_tags_only);
else
dev->data_bytes_per_chunk = dev->param.total_bytes_per_chunk;
else
dev->data_bytes_per_chunk = dev->param.total_bytes_per_chunk;
dev->n_erased_blocks = 0;
dev->gc_disable= 0;
dev->has_pending_prioritised_gc = 1; /* Assume the worst for now, will get fixed on first GC */
dev->n_erased_blocks = 0;
dev->gc_disable= 0;
dev->has_pending_prioritised_gc = 1; /* Assume the worst for now, will get fixed on first GC */
- YINIT_LIST_HEAD(&dev->dirty_dirs);
+ INIT_LIST_HEAD(&dev->dirty_dirs);
dev->oldest_dirty_seq = 0;
dev->oldest_dirty_block = 0;
dev->oldest_dirty_seq = 0;
dev->oldest_dirty_block = 0;
#include "yportenv.h"
#include "devextras.h"
#include "yportenv.h"
#include "devextras.h"
#define YAFFS_OK 1
#define YAFFS_FAIL 0
#define YAFFS_OK 1
#define YAFFS_FAIL 0
} ;
struct yaffs_dir_var{
} ;
struct yaffs_dir_var{
- struct ylist_head children; /* list of child links */
- struct ylist_head dirty; /* Entry for list of dirty directories */
+ struct list_head children; /* list of child links */
+ struct list_head dirty; /* Entry for list of dirty directories */
};
struct yaffs_symlink_var{
};
struct yaffs_symlink_var{
struct yaffs_dev *my_dev; /* The device I'm on */
struct yaffs_dev *my_dev; /* The device I'm on */
- struct ylist_head hash_link; /* list of objects in this hash bucket */
+ struct list_head hash_link; /* list of objects in this hash bucket */
- struct ylist_head hard_links; /* all the equivalent hard linked objects */
+ struct list_head hard_links; /* all the equivalent hard linked objects */
/* directory structure stuff */
/* also used for linking up the free list */
struct yaffs_obj *parent;
/* directory structure stuff */
/* also used for linking up the free list */
struct yaffs_obj *parent;
- struct ylist_head siblings;
+ struct list_head siblings;
/* Where's my object header in NAND? */
int hdr_chunk;
/* Where's my object header in NAND? */
int hdr_chunk;
};
struct yaffs_obj_bucket {
};
struct yaffs_obj_bucket {
- struct ylist_head list;
void *os_context;
void *driver_context;
void *os_context;
void *driver_context;
- struct ylist_head dev_list;
+ struct list_head dev_list;
/* Runtime parameters. Set up by YAFFS. */
int data_bytes_per_chunk;
/* Runtime parameters. Set up by YAFFS. */
int data_bytes_per_chunk;
int refresh_skip; /* A skip down counter. Refresh happens when this gets to zero. */
/* Dirty directory handling */
int refresh_skip; /* A skip down counter. Refresh happens when this gets to zero. */
/* Dirty directory handling */
- struct ylist_head dirty_dirs; /* List of dirty directories */
+ struct list_head dirty_dirs; /* List of dirty directories */
#include "yportenv.h"
struct yaffs_linux_context {
#include "yportenv.h"
struct yaffs_linux_context {
- struct ylist_head context_list; /* List of these we have mounted */
+ struct list_head context_list; /* List of these we have mounted */
struct yaffs_dev *dev;
struct super_block * super;
struct task_struct *bg_thread; /* Background thread for this device */
struct yaffs_dev *dev;
struct super_block * super;
struct task_struct *bg_thread; /* Background thread for this device */
u8 *spare_buffer; /* For mtdif2 use. Don't know the size of the buffer
* at compile time so we have to allocate it.
*/
u8 *spare_buffer; /* For mtdif2 use. Don't know the size of the buffer
* at compile time so we have to allocate it.
*/
- struct ylist_head search_contexts;
+ struct list_head search_contexts;
void (*put_super_fn)(struct super_block *sb);
struct task_struct *readdir_process;
void (*put_super_fn)(struct super_block *sb);
struct task_struct *readdir_process;
int chunk_bytes = dev->data_bytes_per_chunk;
loff_t addr = ((loff_t)nand_chunk) * chunk_bytes;
struct mtd_oob_ops ops;
int chunk_bytes = dev->data_bytes_per_chunk;
loff_t addr = ((loff_t)nand_chunk) * chunk_bytes;
struct mtd_oob_ops ops;
- yaffs_packed_tags1 pt1;
+ struct yaffs_packed_tags1 pt1;
int retval;
/* we assume that packed_tags1 and struct yaffs_tags are compatible */
int retval;
/* we assume that packed_tags1 and struct yaffs_tags are compatible */
- compile_time_assertion(sizeof(yaffs_packed_tags1) == 12);
+ compile_time_assertion(sizeof(struct yaffs_packed_tags1) == 12);
compile_time_assertion(sizeof(struct yaffs_tags) == 8);
yaffs_pack_tags1(&pt1, etags);
compile_time_assertion(sizeof(struct yaffs_tags) == 8);
yaffs_pack_tags1(&pt1, etags);
loff_t addr = ((loff_t)nand_chunk) * chunk_bytes;
int eccres = YAFFS_ECC_RESULT_NO_ERROR;
struct mtd_oob_ops ops;
loff_t addr = ((loff_t)nand_chunk) * chunk_bytes;
int eccres = YAFFS_ECC_RESULT_NO_ERROR;
struct mtd_oob_ops ops;
- yaffs_packed_tags1 pt1;
+ struct yaffs_packed_tags1 pt1;
+ struct yaffs_packed_tags2 pt;
int packed_tags_size = dev->param.no_tags_ecc ? sizeof(pt.t) : sizeof(pt);
void * packed_tags_ptr = dev->param.no_tags_ecc ? (void *) &pt.t : (void *)&pt;
int packed_tags_size = dev->param.no_tags_ecc ? sizeof(pt.t) : sizeof(pt);
void * packed_tags_ptr = dev->param.no_tags_ecc ? (void *) &pt.t : (void *)&pt;
if (!data || !tags)
BUG();
else if (dev->param.inband_tags) {
if (!data || !tags)
BUG();
else if (dev->param.inband_tags) {
- yaffs_packed_tags2_tags_only *pt2tp;
- pt2tp = (yaffs_packed_tags2_tags_only *)(data + dev->data_bytes_per_chunk);
+ struct yaffs_packed_tags2_tags_only *pt2tp;
+ pt2tp = (struct yaffs_packed_tags2_tags_only *)(data + dev->data_bytes_per_chunk);
yaffs_pack_tags2_tags_only(pt2tp, tags);
} else
yaffs_pack_tags2(&pt, tags, !dev->param.no_tags_ecc);
yaffs_pack_tags2_tags_only(pt2tp, tags);
} else
yaffs_pack_tags2(&pt, tags, !dev->param.no_tags_ecc);
loff_t addr = ((loff_t) nand_chunk) * dev->param.total_bytes_per_chunk;
loff_t addr = ((loff_t) nand_chunk) * dev->param.total_bytes_per_chunk;
+ struct yaffs_packed_tags2 pt;
int packed_tags_size = dev->param.no_tags_ecc ? sizeof(pt.t) : sizeof(pt);
void * packed_tags_ptr = dev->param.no_tags_ecc ? (void *) &pt.t: (void *)&pt;
int packed_tags_size = dev->param.no_tags_ecc ? sizeof(pt.t) : sizeof(pt);
void * packed_tags_ptr = dev->param.no_tags_ecc ? (void *) &pt.t: (void *)&pt;
if (dev->param.inband_tags) {
if (tags) {
if (dev->param.inband_tags) {
if (tags) {
- yaffs_packed_tags2_tags_only *pt2tp;
- pt2tp = (yaffs_packed_tags2_tags_only *)&data[dev->data_bytes_per_chunk];
+ struct yaffs_packed_tags2_tags_only *pt2tp;
+ pt2tp = (struct yaffs_packed_tags2_tags_only *)&data[dev->data_bytes_per_chunk];
yaffs_unpack_tags2_tags_only(tags, pt2tp);
}
} else {
yaffs_unpack_tags2_tags_only(tags, pt2tp);
}
} else {
#include "yaffs_packedtags1.h"
#include "yportenv.h"
#include "yaffs_packedtags1.h"
#include "yportenv.h"
-void yaffs_pack_tags1(yaffs_packed_tags1 *pt, const struct yaffs_ext_tags *t)
+void yaffs_pack_tags1(struct yaffs_packed_tags1 *pt, const struct yaffs_ext_tags *t)
{
pt->chunk_id = t->chunk_id;
pt->serial_number = t->serial_number;
{
pt->chunk_id = t->chunk_id;
pt->serial_number = t->serial_number;
-void yaffs_unpack_tags1(struct yaffs_ext_tags *t, const yaffs_packed_tags1 *pt)
+void yaffs_unpack_tags1(struct yaffs_ext_tags *t, const struct yaffs_packed_tags1 *pt)
{
static const u8 all_ff[] =
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff };
{
static const u8 all_ff[] =
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff };
- if (memcmp(all_ff, pt, sizeof(yaffs_packed_tags1))) {
+ if (memcmp(all_ff, pt, sizeof(struct yaffs_packed_tags1))) {
t->block_bad = 0;
if (pt->should_be_ff != 0xFFFFFFFF)
t->block_bad = 1;
t->block_bad = 0;
if (pt->should_be_ff != 0xFFFFFFFF)
t->block_bad = 1;
+struct yaffs_packed_tags1 {
unsigned chunk_id:20;
unsigned serial_number:2;
unsigned n_bytes:10;
unsigned chunk_id:20;
unsigned serial_number:2;
unsigned n_bytes:10;
unsigned unused_stuff:1;
unsigned should_be_ff;
unsigned unused_stuff:1;
unsigned should_be_ff;
-void yaffs_pack_tags1(yaffs_packed_tags1 *pt, const struct yaffs_ext_tags *t);
-void yaffs_unpack_tags1(struct yaffs_ext_tags *t, const yaffs_packed_tags1 *pt);
+void yaffs_pack_tags1(struct yaffs_packed_tags1 *pt, const struct yaffs_ext_tags *t);
+void yaffs_unpack_tags1(struct yaffs_ext_tags *t, const struct yaffs_packed_tags1 *pt);
#define EXTRA_OBJECT_TYPE_MASK ((0x0F) << EXTRA_OBJECT_TYPE_SHIFT)
#define EXTRA_OBJECT_TYPE_MASK ((0x0F) << EXTRA_OBJECT_TYPE_SHIFT)
-static void yaffs_dump_packed_tags2_tags_only(const yaffs_packed_tags2_tags_only *ptt)
+static void yaffs_dump_packed_tags2_tags_only(const struct yaffs_packed_tags2_tags_only *ptt)
{
T(YAFFS_TRACE_MTD,
(TSTR("packed tags obj %d chunk %d byte %d seq %d" TENDSTR),
ptt->obj_id, ptt->chunk_id, ptt->n_bytes,
ptt->seq_number));
}
{
T(YAFFS_TRACE_MTD,
(TSTR("packed tags obj %d chunk %d byte %d seq %d" TENDSTR),
ptt->obj_id, ptt->chunk_id, ptt->n_bytes,
ptt->seq_number));
}
-static void yaffs_dump_packed_tags2(const yaffs_packed_tags2 *pt)
+static void yaffs_dump_packed_tags2(const struct yaffs_packed_tags2 *pt)
{
yaffs_dump_packed_tags2_tags_only(&pt->t);
}
{
yaffs_dump_packed_tags2_tags_only(&pt->t);
}
-void yaffs_pack_tags2_tags_only(yaffs_packed_tags2_tags_only *ptt,
+void yaffs_pack_tags2_tags_only(struct yaffs_packed_tags2_tags_only *ptt,
const struct yaffs_ext_tags *t)
{
ptt->chunk_id = t->chunk_id;
const struct yaffs_ext_tags *t)
{
ptt->chunk_id = t->chunk_id;
-void yaffs_pack_tags2(yaffs_packed_tags2 *pt, const struct yaffs_ext_tags *t, int tags_ecc)
+void yaffs_pack_tags2(struct yaffs_packed_tags2 *pt, const struct yaffs_ext_tags *t, int tags_ecc)
{
yaffs_pack_tags2_tags_only(&pt->t, t);
if(tags_ecc)
yaffs_ecc_calc_other((unsigned char *)&pt->t,
{
yaffs_pack_tags2_tags_only(&pt->t, t);
if(tags_ecc)
yaffs_ecc_calc_other((unsigned char *)&pt->t,
- sizeof(yaffs_packed_tags2_tags_only),
+ sizeof(struct yaffs_packed_tags2_tags_only),
&pt->ecc);
}
void yaffs_unpack_tags2_tags_only(struct yaffs_ext_tags *t,
&pt->ecc);
}
void yaffs_unpack_tags2_tags_only(struct yaffs_ext_tags *t,
- yaffs_packed_tags2_tags_only *ptt)
+ struct yaffs_packed_tags2_tags_only *ptt)
{
memset(t, 0, sizeof(struct yaffs_ext_tags));
{
memset(t, 0, sizeof(struct yaffs_ext_tags));
-void yaffs_unpack_tags2(struct yaffs_ext_tags *t, yaffs_packed_tags2 *pt, int tags_ecc)
+void yaffs_unpack_tags2(struct yaffs_ext_tags *t, struct yaffs_packed_tags2 *pt, int tags_ecc)
{
enum yaffs_ecc_result ecc_result = YAFFS_ECC_RESULT_NO_ERROR;
{
enum yaffs_ecc_result ecc_result = YAFFS_ECC_RESULT_NO_ERROR;
tags_ecc){
/* Chunk is in use and we need to do ECC */
tags_ecc){
/* Chunk is in use and we need to do ECC */
+ struct yaffs_ecc_other ecc;
int result;
yaffs_ecc_calc_other((unsigned char *)&pt->t,
int result;
yaffs_ecc_calc_other((unsigned char *)&pt->t,
- sizeof(yaffs_packed_tags2_tags_only),
+ sizeof(struct yaffs_packed_tags2_tags_only),
&ecc);
result = yaffs_ecc_correct_other((unsigned char *)&pt->t,
&ecc);
result = yaffs_ecc_correct_other((unsigned char *)&pt->t,
- sizeof(yaffs_packed_tags2_tags_only),
+ sizeof(struct yaffs_packed_tags2_tags_only),
&pt->ecc, &ecc);
switch (result) {
case 0:
&pt->ecc, &ecc);
switch (result) {
case 0:
#include "yaffs_guts.h"
#include "yaffs_ecc.h"
#include "yaffs_guts.h"
#include "yaffs_ecc.h"
+struct yaffs_packed_tags2_tags_only {
unsigned seq_number;
unsigned obj_id;
unsigned chunk_id;
unsigned n_bytes;
unsigned seq_number;
unsigned obj_id;
unsigned chunk_id;
unsigned n_bytes;
-} yaffs_packed_tags2_tags_only;
-typedef struct {
- yaffs_packed_tags2_tags_only t;
- yaffs_ecc_other ecc;
-} yaffs_packed_tags2;
+struct yaffs_packed_tags2 {
+ struct yaffs_packed_tags2_tags_only t;
+ struct yaffs_ecc_other ecc;
+} ;
/* Full packed tags with ECC, used for oob tags */
/* Full packed tags with ECC, used for oob tags */
-void yaffs_pack_tags2(yaffs_packed_tags2 *pt, const struct yaffs_ext_tags *t, int tags_ecc);
-void yaffs_unpack_tags2(struct yaffs_ext_tags *t, yaffs_packed_tags2 *pt, int tags_ecc);
+void yaffs_pack_tags2(struct yaffs_packed_tags2 *pt, const struct yaffs_ext_tags *t, int tags_ecc);
+void yaffs_unpack_tags2(struct yaffs_ext_tags *t, struct yaffs_packed_tags2 *pt, int tags_ecc);
/* Only the tags part (no ECC for use with inband tags */
/* Only the tags part (no ECC for use with inband tags */
-void yaffs_pack_tags2_tags_only(yaffs_packed_tags2_tags_only *pt, const struct yaffs_ext_tags *t);
-void yaffs_unpack_tags2_tags_only(struct yaffs_ext_tags *t, yaffs_packed_tags2_tags_only *pt);
+void yaffs_pack_tags2_tags_only(struct yaffs_packed_tags2_tags_only *pt, const struct yaffs_ext_tags *t);
+void yaffs_unpack_tags2_tags_only(struct yaffs_ext_tags *t, struct yaffs_packed_tags2_tags_only *pt);
{
struct yaffs_obj *obj;
int i;
{
struct yaffs_obj *obj;
int i;
if (yaffs_skip_verification(dev))
return;
if (yaffs_skip_verification(dev))
return;
/* Iterate through the objects in each hash entry */
for (i = 0; i < YAFFS_NOBJECT_BUCKETS; i++) {
/* Iterate through the objects in each hash entry */
for (i = 0; i < YAFFS_NOBJECT_BUCKETS; i++) {
- ylist_for_each(lh, &dev->obj_bucket[i].list) {
+ list_for_each(lh, &dev->obj_bucket[i].list) {
- obj = ylist_entry(lh, struct yaffs_obj, hash_link);
+ obj = list_entry(lh, struct yaffs_obj, hash_link);
yaffs_verify_obj(obj);
}
}
yaffs_verify_obj(obj);
}
}
void yaffs_verify_obj_in_dir(struct yaffs_obj *obj)
{
void yaffs_verify_obj_in_dir(struct yaffs_obj *obj)
{
struct yaffs_obj *list_obj;
int count = 0;
struct yaffs_obj *list_obj;
int count = 0;
/* Iterate through the objects in each hash entry */
/* Iterate through the objects in each hash entry */
- ylist_for_each(lh, &obj->parent->variant.dir_variant.children) {
+ list_for_each(lh, &obj->parent->variant.dir_variant.children) {
- list_obj = ylist_entry(lh, struct yaffs_obj, siblings);
+ list_obj = list_entry(lh, struct yaffs_obj, siblings);
yaffs_verify_obj(list_obj);
if (obj == list_obj)
count++;
yaffs_verify_obj(list_obj);
if (obj == list_obj)
count++;
void yaffs_verify_dir(struct yaffs_obj *directory)
{
void yaffs_verify_dir(struct yaffs_obj *directory)
{
struct yaffs_obj *list_obj;
if (!directory) {
struct yaffs_obj *list_obj;
if (!directory) {
/* Iterate through the objects in each hash entry */
/* Iterate through the objects in each hash entry */
- ylist_for_each(lh, &directory->variant.dir_variant.children) {
+ list_for_each(lh, &directory->variant.dir_variant.children) {
- list_obj = ylist_entry(lh, struct yaffs_obj, siblings);
+ list_obj = list_entry(lh, struct yaffs_obj, siblings);
if (list_obj->parent != directory) {
T(YAFFS_TRACE_ALWAYS, (
TSTR("Object in directory list has wrong parent %p" TENDSTR),
if (list_obj->parent != directory) {
T(YAFFS_TRACE_ALWAYS, (
TSTR("Object in directory list has wrong parent %p" TENDSTR),
struct yaffs_dev *dev;
struct yaffs_obj *dir_obj;
struct yaffs_obj *next_return;
struct yaffs_dev *dev;
struct yaffs_obj *dir_obj;
struct yaffs_obj *next_return;
- struct ylist_head others;
+ struct list_head others;
if(sc){
sc->dir_obj = dir;
sc->dev = dev;
if(sc){
sc->dir_obj = dir;
sc->dev = dev;
- if( ylist_empty(&sc->dir_obj->variant.dir_variant.children))
+ if( list_empty(&sc->dir_obj->variant.dir_variant.children))
sc->next_return = NULL;
else
sc->next_return = NULL;
else
- sc->next_return = ylist_entry(
+ sc->next_return = list_entry(
dir->variant.dir_variant.children.next,
struct yaffs_obj,siblings);
dir->variant.dir_variant.children.next,
struct yaffs_obj,siblings);
- YINIT_LIST_HEAD(&sc->others);
- ylist_add(&sc->others,&(yaffs_dev_to_lc(dev)->search_contexts));
+ INIT_LIST_HEAD(&sc->others);
+ list_add(&sc->others,&(yaffs_dev_to_lc(dev)->search_contexts));
static void yaffs_search_end(struct yaffs_search_context * sc)
{
if(sc){
static void yaffs_search_end(struct yaffs_search_context * sc)
{
if(sc){
- ylist_del(&sc->others);
return;
if( sc->next_return == NULL ||
return;
if( sc->next_return == NULL ||
- ylist_empty(&sc->dir_obj->variant.dir_variant.children))
+ list_empty(&sc->dir_obj->variant.dir_variant.children))
sc->next_return = NULL;
else {
sc->next_return = NULL;
else {
- struct ylist_head *next = sc->next_return->siblings.next;
+ struct list_head *next = sc->next_return->siblings.next;
if( next == &sc->dir_obj->variant.dir_variant.children)
sc->next_return = NULL; /* end of list */
else
if( next == &sc->dir_obj->variant.dir_variant.children)
sc->next_return = NULL; /* end of list */
else
- sc->next_return = ylist_entry(next,struct yaffs_obj,siblings);
+ sc->next_return = list_entry(next,struct yaffs_obj,siblings);
static void yaffs_remove_obj_callback(struct yaffs_obj *obj)
{
static void yaffs_remove_obj_callback(struct yaffs_obj *obj)
{
struct yaffs_search_context *sc;
struct yaffs_search_context *sc;
- struct ylist_head *search_contexts = &(yaffs_dev_to_lc(obj->my_dev)->search_contexts);
+ struct list_head *search_contexts = &(yaffs_dev_to_lc(obj->my_dev)->search_contexts);
/* Iterate through the directory search contexts.
* If any are currently on the object being removed, then advance
* the search context to the next object to prevent a hanging pointer.
*/
/* Iterate through the directory search contexts.
* If any are currently on the object being removed, then advance
* the search context to the next object to prevent a hanging pointer.
*/
- ylist_for_each(i, search_contexts) {
+ list_for_each(i, search_contexts) {
- sc = ylist_entry(i, struct yaffs_search_context,others);
+ sc = list_entry(i, struct yaffs_search_context,others);
if(sc->next_return == obj)
yaffs_search_advance(sc);
}
if(sc->next_return == obj)
yaffs_search_advance(sc);
}
if (target && target->variant_type == YAFFS_OBJECT_TYPE_DIRECTORY &&
if (target && target->variant_type == YAFFS_OBJECT_TYPE_DIRECTORY &&
- !ylist_empty(&target->variant.dir_variant.children)) {
+ !list_empty(&target->variant.dir_variant.children)) {
T(YAFFS_TRACE_OS, (TSTR("target is non-empty dir\n")));
T(YAFFS_TRACE_OS, (TSTR("target is non-empty dir\n")));
-static YLIST_HEAD(yaffs_context_list);
+static LIST_HEAD(yaffs_context_list);
struct semaphore yaffs_context_lock;
static void yaffs_put_super(struct super_block *sb)
struct semaphore yaffs_context_lock;
static void yaffs_put_super(struct super_block *sb)
yaffs_gross_unlock(dev);
down(&yaffs_context_lock);
yaffs_gross_unlock(dev);
down(&yaffs_context_lock);
- ylist_del_init(&(yaffs_dev_to_lc(dev)->context_list));
+ list_del_init(&(yaffs_dev_to_lc(dev)->context_list));
up(&yaffs_context_lock);
if (yaffs_dev_to_lc(dev)->spare_buffer) {
up(&yaffs_context_lock);
if (yaffs_dev_to_lc(dev)->spare_buffer) {
int inband_tags;
int skip_checkpoint_read;
int skip_checkpoint_write;
int inband_tags;
int skip_checkpoint_read;
int skip_checkpoint_write;
int lazy_loading_overridden;
int empty_lost_and_found;
int empty_lost_and_found_overridden;
int lazy_loading_overridden;
int empty_lost_and_found;
int empty_lost_and_found_overridden;
-static int yaffs_parse_options(yaffs_options *options, const char *options_str)
+static int yaffs_parse_options(struct yaffs_options *options, const char *options_str)
{
char cur_opt[MAX_OPT_LEN + 1];
int p;
{
char cur_opt[MAX_OPT_LEN + 1];
int p;
+ struct yaffs_options options;
unsigned mount_id;
int found;
struct yaffs_linux_context *context_iterator;
unsigned mount_id;
int found;
struct yaffs_linux_context *context_iterator;
sb->s_magic = YAFFS_MAGIC;
sb->s_op = &yaffs_super_ops;
sb->s_magic = YAFFS_MAGIC;
sb->s_op = &yaffs_super_ops;
memset(context,0,sizeof(struct yaffs_linux_context));
dev->os_context = context;
memset(context,0,sizeof(struct yaffs_linux_context));
dev->os_context = context;
- YINIT_LIST_HEAD(&(context->context_list));
+ INIT_LIST_HEAD(&(context->context_list));
context->dev = dev;
context->super = sb;
context->dev = dev;
context->super = sb;
found = 0;
for(mount_id=0; ! found; mount_id++){
found = 1;
found = 0;
for(mount_id=0; ! found; mount_id++){
found = 1;
- ylist_for_each(l,&yaffs_context_list){
- context_iterator = ylist_entry(l,struct yaffs_linux_context,context_list);
+ list_for_each(l,&yaffs_context_list){
+ context_iterator = list_entry(l,struct yaffs_linux_context,context_list);
if(context_iterator->mount_id == mount_id)
found = 0;
}
}
context->mount_id = mount_id;
if(context_iterator->mount_id == mount_id)
found = 0;
}
}
context->mount_id = mount_id;
- ylist_add_tail(&(yaffs_dev_to_lc(dev)->context_list), &yaffs_context_list);
+ list_add_tail(&(yaffs_dev_to_lc(dev)->context_list), &yaffs_context_list);
up(&yaffs_context_lock);
/* Directory search handling...*/
up(&yaffs_context_lock);
/* Directory search handling...*/
- YINIT_LIST_HEAD(&(yaffs_dev_to_lc(dev)->search_contexts));
+ INIT_LIST_HEAD(&(yaffs_dev_to_lc(dev)->search_contexts));
param->remove_obj_fn = yaffs_remove_obj_callback;
init_MUTEX(&(yaffs_dev_to_lc(dev)->gross_lock));
param->remove_obj_fn = yaffs_remove_obj_callback;
init_MUTEX(&(yaffs_dev_to_lc(dev)->gross_lock));
char **start,
off_t offset, int count, int *eof, void *data)
{
char **start,
off_t offset, int count, int *eof, void *data)
{
- struct ylist_head *item;
+ struct list_head *item;
char *buf = page;
int step = offset;
int n = 0;
char *buf = page;
int step = offset;
int n = 0;
down(&yaffs_context_lock);
/* Locate and print the Nth entry. Order N-squared but N is small. */
down(&yaffs_context_lock);
/* Locate and print the Nth entry. Order N-squared but N is small. */
- ylist_for_each(item, &yaffs_context_list) {
- struct yaffs_linux_context *dc = ylist_entry(item, struct yaffs_linux_context, context_list);
+ list_for_each(item, &yaffs_context_list) {
+ struct yaffs_linux_context *dc = list_entry(item, struct yaffs_linux_context, context_list);
struct yaffs_dev *dev = dc->dev;
if (n < (step & ~1)) {
struct yaffs_dev *dev = dc->dev;
if (n < (step & ~1)) {
char **start,
off_t offset, int count, int *eof, void *data)
{
char **start,
off_t offset, int count, int *eof, void *data)
{
- struct ylist_head *item;
+ struct list_head *item;
char *buf = page;
int n = 0;
down(&yaffs_context_lock);
/* Locate and print the Nth entry. Order N-squared but N is small. */
char *buf = page;
int n = 0;
down(&yaffs_context_lock);
/* Locate and print the Nth entry. Order N-squared but N is small. */
- ylist_for_each(item, &yaffs_context_list) {
- struct yaffs_linux_context *dc = ylist_entry(item, struct yaffs_linux_context, context_list);
+ list_for_each(item, &yaffs_context_list) {
+ struct yaffs_linux_context *dc = list_entry(item, struct yaffs_linux_context, context_list);
struct yaffs_dev *dev = dc->dev;
int erased_chunks;
struct yaffs_dev *dev = dc->dev;
int erased_chunks;
struct yaffs_dev *dev;
struct yaffs_obj *dir_obj;
struct yaffs_obj *next_return;
struct yaffs_dev *dev;
struct yaffs_obj *dir_obj;
struct yaffs_obj *next_return;
- struct ylist_head others;
+ struct list_head others;
if(sc){
sc->dir_obj = dir;
sc->dev = dev;
if(sc){
sc->dir_obj = dir;
sc->dev = dev;
- if( ylist_empty(&sc->dir_obj->variant.dir_variant.children))
+ if( list_empty(&sc->dir_obj->variant.dir_variant.children))
sc->next_return = NULL;
else
sc->next_return = NULL;
else
- sc->next_return = ylist_entry(
+ sc->next_return = list_entry(
dir->variant.dir_variant.children.next,
struct yaffs_obj,siblings);
dir->variant.dir_variant.children.next,
struct yaffs_obj,siblings);
- YINIT_LIST_HEAD(&sc->others);
- ylist_add(&sc->others,&(yaffs_dev_to_lc(dev)->search_contexts));
+ INIT_LIST_HEAD(&sc->others);
+ list_add(&sc->others,&(yaffs_dev_to_lc(dev)->search_contexts));
static void yaffs_search_end(struct yaffs_search_context * sc)
{
if(sc){
static void yaffs_search_end(struct yaffs_search_context * sc)
{
if(sc){
- ylist_del(&sc->others);
return;
if( sc->next_return == NULL ||
return;
if( sc->next_return == NULL ||
- ylist_empty(&sc->dir_obj->variant.dir_variant.children))
+ list_empty(&sc->dir_obj->variant.dir_variant.children))
sc->next_return = NULL;
else {
sc->next_return = NULL;
else {
- struct ylist_head *next = sc->next_return->siblings.next;
+ struct list_head *next = sc->next_return->siblings.next;
if( next == &sc->dir_obj->variant.dir_variant.children)
sc->next_return = NULL; /* end of list */
else
if( next == &sc->dir_obj->variant.dir_variant.children)
sc->next_return = NULL; /* end of list */
else
- sc->next_return = ylist_entry(next,struct yaffs_obj,siblings);
+ sc->next_return = list_entry(next,struct yaffs_obj,siblings);
static void yaffs_remove_obj_callback(struct yaffs_obj *obj)
{
static void yaffs_remove_obj_callback(struct yaffs_obj *obj)
{
struct yaffs_search_context *sc;
struct yaffs_search_context *sc;
- struct ylist_head *search_contexts = &(yaffs_dev_to_lc(obj->my_dev)->search_contexts);
+ struct list_head *search_contexts = &(yaffs_dev_to_lc(obj->my_dev)->search_contexts);
/* Iterate through the directory search contexts.
* If any are currently on the object being removed, then advance
* the search context to the next object to prevent a hanging pointer.
*/
/* Iterate through the directory search contexts.
* If any are currently on the object being removed, then advance
* the search context to the next object to prevent a hanging pointer.
*/
- ylist_for_each(i, search_contexts) {
+ list_for_each(i, search_contexts) {
- sc = ylist_entry(i, struct yaffs_search_context,others);
+ sc = list_entry(i, struct yaffs_search_context,others);
if(sc->next_return == obj)
yaffs_search_advance(sc);
}
if(sc->next_return == obj)
yaffs_search_advance(sc);
}
if (target && target->variant_type == YAFFS_OBJECT_TYPE_DIRECTORY &&
if (target && target->variant_type == YAFFS_OBJECT_TYPE_DIRECTORY &&
- !ylist_empty(&target->variant.dir_variant.children)) {
+ !list_empty(&target->variant.dir_variant.children)) {
T(YAFFS_TRACE_OS, (TSTR("target is non-empty dir\n")));
T(YAFFS_TRACE_OS, (TSTR("target is non-empty dir\n")));
-static YLIST_HEAD(yaffs_context_list);
+static LIST_HEAD(yaffs_context_list);
struct semaphore yaffs_context_lock;
static void yaffs_put_super(struct super_block *sb)
struct semaphore yaffs_context_lock;
static void yaffs_put_super(struct super_block *sb)
yaffs_gross_unlock(dev);
down(&yaffs_context_lock);
yaffs_gross_unlock(dev);
down(&yaffs_context_lock);
- ylist_del_init(&(yaffs_dev_to_lc(dev)->context_list));
+ list_del_init(&(yaffs_dev_to_lc(dev)->context_list));
up(&yaffs_context_lock);
if (yaffs_dev_to_lc(dev)->spare_buffer) {
up(&yaffs_context_lock);
if (yaffs_dev_to_lc(dev)->spare_buffer) {
int inband_tags;
int skip_checkpoint_read;
int skip_checkpoint_write;
int inband_tags;
int skip_checkpoint_read;
int skip_checkpoint_write;
int lazy_loading_overridden;
int empty_lost_and_found;
int empty_lost_and_found_overridden;
int lazy_loading_overridden;
int empty_lost_and_found;
int empty_lost_and_found_overridden;
-static int yaffs_parse_options(yaffs_options *options, const char *options_str)
+static int yaffs_parse_options(struct yaffs_options *options, const char *options_str)
{
char cur_opt[MAX_OPT_LEN + 1];
int p;
{
char cur_opt[MAX_OPT_LEN + 1];
int p;
+ struct yaffs_options options;
unsigned mount_id;
int found;
struct yaffs_linux_context *context_iterator;
unsigned mount_id;
int found;
struct yaffs_linux_context *context_iterator;
sb->s_magic = YAFFS_MAGIC;
sb->s_op = &yaffs_super_ops;
sb->s_magic = YAFFS_MAGIC;
sb->s_op = &yaffs_super_ops;
memset(context,0,sizeof(struct yaffs_linux_context));
dev->os_context = context;
memset(context,0,sizeof(struct yaffs_linux_context));
dev->os_context = context;
- YINIT_LIST_HEAD(&(context->context_list));
+ INIT_LIST_HEAD(&(context->context_list));
context->dev = dev;
context->super = sb;
context->dev = dev;
context->super = sb;
found = 0;
for(mount_id=0; ! found; mount_id++){
found = 1;
found = 0;
for(mount_id=0; ! found; mount_id++){
found = 1;
- ylist_for_each(l,&yaffs_context_list){
- context_iterator = ylist_entry(l,struct yaffs_linux_context,context_list);
+ list_for_each(l,&yaffs_context_list){
+ context_iterator = list_entry(l,struct yaffs_linux_context,context_list);
if(context_iterator->mount_id == mount_id)
found = 0;
}
}
context->mount_id = mount_id;
if(context_iterator->mount_id == mount_id)
found = 0;
}
}
context->mount_id = mount_id;
- ylist_add_tail(&(yaffs_dev_to_lc(dev)->context_list), &yaffs_context_list);
+ list_add_tail(&(yaffs_dev_to_lc(dev)->context_list), &yaffs_context_list);
up(&yaffs_context_lock);
/* Directory search handling...*/
up(&yaffs_context_lock);
/* Directory search handling...*/
- YINIT_LIST_HEAD(&(yaffs_dev_to_lc(dev)->search_contexts));
+ INIT_LIST_HEAD(&(yaffs_dev_to_lc(dev)->search_contexts));
param->remove_obj_fn = yaffs_remove_obj_callback;
init_MUTEX(&(yaffs_dev_to_lc(dev)->gross_lock));
param->remove_obj_fn = yaffs_remove_obj_callback;
init_MUTEX(&(yaffs_dev_to_lc(dev)->gross_lock));
char **start,
off_t offset, int count, int *eof, void *data)
{
char **start,
off_t offset, int count, int *eof, void *data)
{
- struct ylist_head *item;
+ struct list_head *item;
char *buf = page;
int step = offset;
int n = 0;
char *buf = page;
int step = offset;
int n = 0;
down(&yaffs_context_lock);
/* Locate and print the Nth entry. Order N-squared but N is small. */
down(&yaffs_context_lock);
/* Locate and print the Nth entry. Order N-squared but N is small. */
- ylist_for_each(item, &yaffs_context_list) {
- struct yaffs_linux_context *dc = ylist_entry(item, struct yaffs_linux_context, context_list);
+ list_for_each(item, &yaffs_context_list) {
+ struct yaffs_linux_context *dc = list_entry(item, struct yaffs_linux_context, context_list);
struct yaffs_dev *dev = dc->dev;
if (n < (step & ~1)) {
struct yaffs_dev *dev = dc->dev;
if (n < (step & ~1)) {
char **start,
off_t offset, int count, int *eof, void *data)
{
char **start,
off_t offset, int count, int *eof, void *data)
{
- struct ylist_head *item;
+ struct list_head *item;
char *buf = page;
int n = 0;
down(&yaffs_context_lock);
/* Locate and print the Nth entry. Order N-squared but N is small. */
char *buf = page;
int n = 0;
down(&yaffs_context_lock);
/* Locate and print the Nth entry. Order N-squared but N is small. */
- ylist_for_each(item, &yaffs_context_list) {
- struct yaffs_linux_context *dc = ylist_entry(item, struct yaffs_linux_context, context_list);
+ list_for_each(item, &yaffs_context_list) {
+ struct yaffs_linux_context *dc = list_entry(item, struct yaffs_linux_context, context_list);
struct yaffs_dev *dev = dc->dev;
int erased_chunks;
struct yaffs_dev *dev = dc->dev;
int erased_chunks;
/* Set up as a directory */
parent->variant_type =
YAFFS_OBJECT_TYPE_DIRECTORY;
/* Set up as a directory */
parent->variant_type =
YAFFS_OBJECT_TYPE_DIRECTORY;
- YINIT_LIST_HEAD(&parent->variant.
+ INIT_LIST_HEAD(&parent->variant.
dir_variant.
children);
} else if (!parent || parent->variant_type !=
dir_variant.
children);
} else if (!parent || parent->variant_type !=
equiv_id =
oh->equiv_id;
in->hard_links.next =
equiv_id =
oh->equiv_id;
in->hard_links.next =
hard_list;
hard_list = in;
break;
hard_list;
hard_list = in;
break;
struct yaffs_checkpt_obj cp;
int i;
int ok = 1;
struct yaffs_checkpt_obj cp;
int i;
int ok = 1;
/* Iterate through the objects in each hash entry,
/* Iterate through the objects in each hash entry,
*/
for (i = 0; ok && i < YAFFS_NOBJECT_BUCKETS; i++) {
*/
for (i = 0; ok && i < YAFFS_NOBJECT_BUCKETS; i++) {
- ylist_for_each(lh, &dev->obj_bucket[i].list) {
+ list_for_each(lh, &dev->obj_bucket[i].list) {
- obj = ylist_entry(lh, struct yaffs_obj, hash_link);
+ obj = list_entry(lh, struct yaffs_obj, hash_link);
if (!obj->defered_free) {
yaffs2_obj_checkpt_obj(&cp, obj);
cp.struct_type = sizeof(cp);
if (!obj->defered_free) {
yaffs2_obj_checkpt_obj(&cp, obj);
cp.struct_type = sizeof(cp);
ok = yaffs2_rd_checkpt_tnodes(obj);
} else if (obj->variant_type == YAFFS_OBJECT_TYPE_HARDLINK) {
obj->hard_links.next =
ok = yaffs2_rd_checkpt_tnodes(obj);
} else if (obj->variant_type == YAFFS_OBJECT_TYPE_HARDLINK) {
obj->hard_links.next =
- (struct ylist_head *) hard_list;
+ (struct list_head *) hard_list;
hard_list = obj;
}
} else
hard_list = obj;
}
} else
/* Set up as a directory */
parent->variant_type =
YAFFS_OBJECT_TYPE_DIRECTORY;
/* Set up as a directory */
parent->variant_type =
YAFFS_OBJECT_TYPE_DIRECTORY;
- YINIT_LIST_HEAD(&parent->variant.
+ INIT_LIST_HEAD(&parent->variant.
dir_variant.
children);
} else if (!parent || parent->variant_type !=
dir_variant.
children);
} else if (!parent || parent->variant_type !=
in->variant.hardlink_variant.equiv_id =
equiv_id;
in->hard_links.next =
in->variant.hardlink_variant.equiv_id =
equiv_id;
in->hard_links.next =
- (struct ylist_head *) hard_list;
+ (struct list_head *) hard_list;
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/xattr.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/xattr.h>
#define YCHAR char
#define YUCHAR unsigned char
#define YCHAR char
#define YUCHAR unsigned char