projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
yaffs Added more tests to direct/timothy_tests/quick_tests
[yaffs2.git]
/
yaffs_guts.c
diff --git
a/yaffs_guts.c
b/yaffs_guts.c
index 110a3c2f778b18ed81c28630453505e1c311a467..1bc6d51be66714e253e572ffac34ffc7bf3aebd1 100644
(file)
--- a/
yaffs_guts.c
+++ b/
yaffs_guts.c
@@
-1620,6
+1620,10
@@
static int yaffs_change_obj_name(struct yaffs_obj *obj,
return YAFFS_FAIL;
}
return YAFFS_FAIL;
}
+
+/* Note:
+ * If old_name is NULL then we take old_dir as the object to be renamed.
+ */
int yaffs_rename_obj(struct yaffs_obj *old_dir, const YCHAR * old_name,
struct yaffs_obj *new_dir, const YCHAR * new_name)
{
int yaffs_rename_obj(struct yaffs_obj *old_dir, const YCHAR * old_name,
struct yaffs_obj *new_dir, const YCHAR * new_name)
{
@@
-1641,7
+1645,9
@@
int yaffs_rename_obj(struct yaffs_obj *old_dir, const YCHAR * old_name,
* While look-up is case insensitive, the name isn't.
* Therefore we might want to change x.txt to X.txt
*/
* While look-up is case insensitive, the name isn't.
* Therefore we might want to change x.txt to X.txt
*/
- if (old_dir == new_dir && yaffs_strcmp(old_name, new_name) == 0)
+ if (old_dir == new_dir &&
+ old_name && new_name &&
+ yaffs_strcmp(old_name, new_name) == 0)
force = 1;
#endif
force = 1;
#endif
@@
-1650,7
+1656,13
@@
int yaffs_rename_obj(struct yaffs_obj *old_dir, const YCHAR * old_name,
/* ENAMETOOLONG */
return YAFFS_FAIL;
/* ENAMETOOLONG */
return YAFFS_FAIL;
- obj = yaffs_find_by_name(old_dir, old_name);
+ if(old_name)
+ obj = yaffs_find_by_name(old_dir, old_name);
+ else{
+ obj = old_dir;
+ old_dir = obj->parent;
+ }
+
if (obj && obj->rename_allowed) {
if (obj && obj->rename_allowed) {
@@
-5058,7
+5070,7
@@
int yaffs_guts_initialise(struct yaffs_dev *dev)
if (dev->param.is_yaffs2) {
if (yaffs2_checkpt_restore(dev)) {
yaffs_check_obj_details_loaded(dev->root_dir);
if (dev->param.is_yaffs2) {
if (yaffs2_checkpt_restore(dev)) {
yaffs_check_obj_details_loaded(dev->root_dir);
- T(YAFFS_TRACE_
ALWAYS
,
+ T(YAFFS_TRACE_
CHECKPOINT | YAFFS_TRACE_MOUNT
,
(TSTR
("yaffs: restored from checkpoint"
TENDSTR)));
(TSTR
("yaffs: restored from checkpoint"
TENDSTR)));