projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move tracing out of yportenv.h
[yaffs2.git]
/
yaffs_guts.c
diff --git
a/yaffs_guts.c
b/yaffs_guts.c
index 5ea11500ffd506fa3f3a083dea48a62ca27c574f..6658918cc8906dd08bcd432efcfcd41a2bd155a0 100644
(file)
--- a/
yaffs_guts.c
+++ b/
yaffs_guts.c
@@
-12,9
+12,10
@@
*/
const char *yaffs_guts_c_version =
*/
const char *yaffs_guts_c_version =
- "$Id: yaffs_guts.c,v 1.10
3 2010-01-01 23:54:03
charles Exp $";
+ "$Id: yaffs_guts.c,v 1.10
6 2010-01-11 04:06:46
charles Exp $";
#include "yportenv.h"
#include "yportenv.h"
+#include "yaffs_trace.h"
#include "yaffsinterface.h"
#include "yaffs_guts.h"
#include "yaffsinterface.h"
#include "yaffs_guts.h"
@@
-2050,9
+2051,7
@@
static void yaffs_FreeObject(yaffs_Object *tn)
{
yaffs_Device *dev = tn->myDev;
{
yaffs_Device *dev = tn->myDev;
-#ifdef __KERNEL__
T(YAFFS_TRACE_OS, (TSTR("FreeObject %p inode %p"TENDSTR), tn, tn->myInode));
T(YAFFS_TRACE_OS, (TSTR("FreeObject %p inode %p"TENDSTR), tn, tn->myInode));
-#endif
if (tn->parent)
YBUG();
if (tn->parent)
YBUG();
@@
-2060,7
+2059,6
@@
static void yaffs_FreeObject(yaffs_Object *tn)
YBUG();
YBUG();
-#ifdef __KERNEL__
if (tn->myInode) {
/* We're still hooked up to a cached inode.
* Don't delete now, but mark for later deletion
if (tn->myInode) {
/* We're still hooked up to a cached inode.
* Don't delete now, but mark for later deletion
@@
-2068,7
+2066,6
@@
static void yaffs_FreeObject(yaffs_Object *tn)
tn->deferedFree = 1;
return;
}
tn->deferedFree = 1;
return;
}
-#endif
yaffs_UnhashObject(tn);
yaffs_UnhashObject(tn);
@@
-5254,13
+5251,8
@@
static int yaffs_UnlinkFileIfNeeded(yaffs_Object *in)
int retVal;
int immediateDeletion = 0;
int retVal;
int immediateDeletion = 0;
-#ifdef __KERNEL__
if (!in->myInode)
immediateDeletion = 1;
if (!in->myInode)
immediateDeletion = 1;
-#else
- if (in->inUse <= 0)
- immediateDeletion = 1;
-#endif
if (immediateDeletion) {
retVal =
if (immediateDeletion) {
retVal =
@@
-5380,13
+5372,8
@@
static int yaffs_UnlinkWorker(yaffs_Object *obj)
int immediateDeletion = 0;
int immediateDeletion = 0;
-#ifdef __KERNEL__
if (!obj->myInode)
immediateDeletion = 1;
if (!obj->myInode)
immediateDeletion = 1;
-#else
- if (obj->inUse <= 0)
- immediateDeletion = 1;
-#endif
if(obj)
yaffs_UpdateParent(obj->parent);
if(obj)
yaffs_UpdateParent(obj->parent);
@@
-5403,23
+5390,26
@@
static int yaffs_UnlinkWorker(yaffs_Object *obj)
* Instead, we do the following:
* - Select a hardlink.
* - Unhook it from the hard links
* Instead, we do the following:
* - Select a hardlink.
* - Unhook it from the hard links
- * -
Unhook
it from its parent directory (so that the rename can work)
+ * -
Move
it from its parent directory (so that the rename can work)
* - Rename the object to the hardlink's name.
* - Delete the hardlink
*/
yaffs_Object *hl;
* - Rename the object to the hardlink's name.
* - Delete the hardlink
*/
yaffs_Object *hl;
+ yaffs_Object *parent;
int retVal;
YCHAR name[YAFFS_MAX_NAME_LENGTH + 1];
hl = ylist_entry(obj->hardLinks.next, yaffs_Object, hardLinks);
int retVal;
YCHAR name[YAFFS_MAX_NAME_LENGTH + 1];
hl = ylist_entry(obj->hardLinks.next, yaffs_Object, hardLinks);
+ yaffs_GetObjectName(hl, name, YAFFS_MAX_NAME_LENGTH + 1);
+ parent = hl->parent;
+
ylist_del_init(&hl->hardLinks);
ylist_del_init(&hl->hardLinks);
- ylist_del_init(&hl->siblings);
- yaffs_
GetObjectName(hl, name, YAFFS_MAX_NAME_LENGTH + 1
);
+ yaffs_
AddObjectToDirectory(obj->myDev->unlinkedDir, hl
);
- retVal = yaffs_ChangeObjectName(obj,
hl->
parent, name, 0, 0);
+ retVal = yaffs_ChangeObjectName(obj,parent, name, 0, 0);
if (retVal == YAFFS_OK)
retVal = yaffs_DoGenericObjectDeletion(hl);
if (retVal == YAFFS_OK)
retVal = yaffs_DoGenericObjectDeletion(hl);