summaryrefslogtreecommitdiff
path: root/firmware/common/file.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2017-01-18 04:39:35 -0500
committerMichael Sevakis <jethead71@rockbox.org>2017-02-10 05:05:23 -0500
commit7373cf518f4d4c47f49693690c2ab8ec29bb8510 (patch)
tree0a3c025749be24561e952078e83c5f2e8b838900 /firmware/common/file.c
parentabd75a17d18c0779b59f64a612f9226b62af5823 (diff)
downloadrockbox-7373cf518f4d4c47f49693690c2ab8ec29bb8510.tar.gz
rockbox-7373cf518f4d4c47f49693690c2ab8ec29bb8510.zip
Restore dircache hookup in the database ramcache.
Do a few other changes to dircache and file code flags to accomodate its demands. Change-Id: I4742a54e8cfbe4d8b9cffb75faaf920dd907cf8a
Diffstat (limited to 'firmware/common/file.c')
-rw-r--r--firmware/common/file.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c
index 1f93824dc8..028bdbe9f0 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -354,6 +354,10 @@ static int open_internal_inner2(const char *path,
354 int rc; 354 int rc;
355 355
356 struct path_component_info compinfo; 356 struct path_component_info compinfo;
357
358 if (callflags & FF_CREAT)
359 callflags |= FF_PARENTINFO;
360
357 rc = open_stream_internal(path, callflags, &file->stream, &compinfo); 361 rc = open_stream_internal(path, callflags, &file->stream, &compinfo);
358 if (rc < 0) 362 if (rc < 0)
359 { 363 {
@@ -989,7 +993,8 @@ int rename(const char *old, const char *new)
989 file_internal_lock_WRITER(); 993 file_internal_lock_WRITER();
990 994
991 /* open 'old'; it must exist */ 995 /* open 'old'; it must exist */
992 open1rc = open_stream_internal(old, FF_ANYTYPE, &oldstr, &oldinfo); 996 open1rc = open_stream_internal(old, FF_ANYTYPE | FF_PARENTINFO, &oldstr,
997 &oldinfo);
993 if (open1rc <= 0) 998 if (open1rc <= 0)
994 { 999 {
995 DEBUGF("Failed opening old: %d\n", open1rc); 1000 DEBUGF("Failed opening old: %d\n", open1rc);
@@ -1014,7 +1019,8 @@ int rename(const char *old, const char *new)
1014 newinfo.prefixp = oldstr.infop; 1019 newinfo.prefixp = oldstr.infop;
1015 } 1020 }
1016 1021
1017 open2rc = open_stream_internal(new, callflags, &newstr, &newinfo); 1022 open2rc = open_stream_internal(new, callflags | FF_PARENTINFO, &newstr,
1023 &newinfo);
1018 if (open2rc < 0) 1024 if (open2rc < 0)
1019 { 1025 {
1020 DEBUGF("Failed opening new file: %d\n", open2rc); 1026 DEBUGF("Failed opening new file: %d\n", open2rc);