projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
yaffs trying to recreate timothy_tests after I deleated them.
[yaffs2.git]
/
direct
/
yaffsfs.c
diff --git
a/direct/yaffsfs.c
b/direct/yaffsfs.c
index 30b148655e704a167cd00d5cb00f02b986ffad22..b1871423e96de733ee74123f4f7f060389203bb4 100644
(file)
--- a/
direct/yaffsfs.c
+++ b/
direct/yaffsfs.c
@@
-67,6
+67,18
@@
static yaffsfs_Inode yaffsfs_inode[YAFFSFS_N_HANDLES];
static yaffsfs_Handle yaffsfs_handle[YAFFSFS_N_HANDLES];
static int yaffsfs_handlesInitialised;
static yaffsfs_Handle yaffsfs_handle[YAFFSFS_N_HANDLES];
static int yaffsfs_handlesInitialised;
+unsigned int yaffs_trace_mask;
+
+int yaffs_set_trace(unsigned int tm)
+{
+ return yaffs_trace_mask=tm;
+}
+
+unsigned int yaffs_get_trace(void)
+{
+ return yaffs_trace_mask;
+}
+
/*
* yaffsfs_InitHandle
* Inilitalise handle management on start-up.
/*
* yaffsfs_InitHandle
* Inilitalise handle management on start-up.
@@
-290,7
+302,7
@@
int yaffsfs_IsPathDivider(YCHAR ch)
-
Y
LIST_HEAD(yaffsfs_deviceList);
+LIST_HEAD(yaffsfs_deviceList);
/*
* yaffsfs_FindDevice
/*
* yaffsfs_FindDevice
@@
-301,7
+313,7
@@
YLIST_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
y
list_head *cfg;
+ struct list_head *cfg;
const YCHAR *leftOver;
const YCHAR *p;
struct yaffs_dev *retval = NULL;
const YCHAR *leftOver;
const YCHAR *p;
struct yaffs_dev *retval = NULL;
@@
-315,8
+327,8
@@
static struct yaffs_dev *yaffsfs_FindDevice(const YCHAR *path, YCHAR **restOfPat
* 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.
*/
-
y
list_for_each(cfg, &yaffsfs_deviceList){
- dev =
y
list_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;
@@
-2025,14
+2037,14
@@
void yaffs_add_device(struct yaffs_dev *dev)
dev->param.remove_obj_fn = yaffsfs_RemoveObjectCallback;
if(!dev->dev_list.next)
dev->param.remove_obj_fn = yaffsfs_RemoveObjectCallback;
if(!dev->dev_list.next)
-
Y
INIT_LIST_HEAD(&dev->dev_list);
+ INIT_LIST_HEAD(&dev->dev_list);
-
y
list_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)
{
-
y
list_del_init(&dev->dev_list);
+ list_del_init(&dev->dev_list);
}
}
@@
-2055,12
+2067,12
@@
typedef struct
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
y
list_head others;
+ struct list_head others;
} yaffsfs_DirectorySearchContext;
} yaffsfs_DirectorySearchContext;
-static struct
y
list_head search_contexts;
+static struct list_head search_contexts;
static void yaffsfs_SetDirRewound(yaffsfs_DirectorySearchContext *dsc)
static void yaffsfs_SetDirRewound(yaffsfs_DirectorySearchContext *dsc)
@@
-2071,10
+2083,10
@@
static void yaffsfs_SetDirRewound(yaffsfs_DirectorySearchContext *dsc)
dsc->offset = 0;
dsc->offset = 0;
- if(
y
list_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 =
y
list_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! */
@@
-2088,15
+2100,15
@@
static void yaffsfs_DirAdvance(yaffsfs_DirectorySearchContext *dsc)
dsc->dirObj->variant_type == YAFFS_OBJECT_TYPE_DIRECTORY){
if( dsc->nextReturn == NULL ||
dsc->dirObj->variant_type == YAFFS_OBJECT_TYPE_DIRECTORY){
if( dsc->nextReturn == NULL ||
-
y
list_empty(&dsc->dirObj->variant.dir_variant.children))
+ list_empty(&dsc->dirObj->variant.dir_variant.children))
dsc->nextReturn = NULL;
else {
dsc->nextReturn = NULL;
else {
- struct
y
list_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 =
y
list_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! */
@@
-2106,7
+2118,7
@@
static void yaffsfs_DirAdvance(yaffsfs_DirectorySearchContext *dsc)
static void yaffsfs_RemoveObjectCallback(struct yaffs_obj *obj)
{
static void yaffsfs_RemoveObjectCallback(struct yaffs_obj *obj)
{
- struct
y
list_head *i;
+ struct list_head *i;
yaffsfs_DirectorySearchContext *dsc;
/* if search contexts not initilised then skip */
yaffsfs_DirectorySearchContext *dsc;
/* if search contexts not initilised then skip */
@@
-2117,9
+2129,9
@@
static void yaffsfs_RemoveObjectCallback(struct yaffs_obj *obj)
* 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.
*/
-
y
list_for_each(i, &search_contexts) {
+ list_for_each(i, &search_contexts) {
if (i) {
if (i) {
- dsc =
y
list_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);
}
@@
-2147,12
+2159,12
@@
yaffs_DIR *yaffs_opendir(const YCHAR *dirname)
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);
-
Y
INIT_LIST_HEAD(&dsc->others);
+ INIT_LIST_HEAD(&dsc->others);
if(!search_contexts.next)
if(!search_contexts.next)
-
Y
INIT_LIST_HEAD(&search_contexts);
+ INIT_LIST_HEAD(&search_contexts);
-
y
list_add(&dsc->others,&search_contexts);
+ list_add(&dsc->others,&search_contexts);
yaffsfs_SetDirRewound(dsc);
}
yaffsfs_SetDirRewound(dsc);
}
@@
-2215,7
+2227,7
@@
int yaffs_closedir(yaffs_DIR *dirp)
yaffsfs_Lock();
dsc->magic = 0;
yaffsfs_Lock();
dsc->magic = 0;
-
y
list_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;