Lines Matching refs:rc

42 	int rc = 0;  in check_log_volume_available()  local
44 while (rc == 0) { in check_log_volume_available()
45 rc = fs_readmount(&index, &name); in check_log_volume_available()
46 if (rc == 0) { in check_log_volume_available()
64 int rc, len; in create_log_dir() local
92 rc = fs_opendir(&dir, w_path); in create_log_dir()
93 if (rc) { in create_log_dir()
95 rc = fs_mkdir(w_path); in create_log_dir()
96 if (rc) { in create_log_dir()
100 rc = fs_closedir(&dir); in create_log_dir()
101 if (rc) { in create_log_dir()
106 return rc; in create_log_dir()
114 int rc; in check_log_file_exist() local
118 rc = fs_opendir(&dir, CONFIG_LOG_BACKEND_FS_DIR); in check_log_file_exist()
119 if (rc) { in check_log_file_exist()
124 rc = fs_readdir(&dir, &ent); in check_log_file_exist()
125 if (rc < 0) { in check_log_file_exist()
126 rc = -EIO; in check_log_file_exist()
133 rc = get_log_file_id(&ent); in check_log_file_exist()
135 if (rc == num) { in check_log_file_exist()
136 rc = 1; in check_log_file_exist()
141 rc = 0; in check_log_file_exist()
146 return rc; in check_log_file_exist()
151 int rc; in write_log_to_file() local
158 rc = create_log_dir(CONFIG_LOG_BACKEND_FS_DIR); in write_log_to_file()
159 if (!rc) { in write_log_to_file()
160 rc = allocate_new_file(&fs_file); in write_log_to_file()
162 backend_state = (rc ? BACKEND_FS_CORRUPTED : BACKEND_FS_OK); in write_log_to_file()
177 rc = allocate_new_file(f); in write_log_to_file()
179 if (rc < 0) { in write_log_to_file()
184 rc = fs_write(f, data, length); in write_log_to_file()
185 if (rc >= 0) { in write_log_to_file()
187 (rc != length)) { in write_log_to_file()
195 length = rc; in write_log_to_file()
197 rc = check_log_file_exist(newest); in write_log_to_file()
198 if (rc == 0) { in write_log_to_file()
203 rc = allocate_new_file(f); in write_log_to_file()
204 if (rc < 0) { in write_log_to_file()
207 } else if (rc < 0) { in write_log_to_file()
214 rc = fs_sync(f); in write_log_to_file()
215 if (rc < 0) { in write_log_to_file()
261 int rc; in allocate_new_file() local
279 rc = fs_opendir(&dir, CONFIG_LOG_BACKEND_FS_DIR); in allocate_new_file()
281 while (rc >= 0) { in allocate_new_file()
282 rc = fs_readdir(&dir, &ent); in allocate_new_file()
283 if ((rc < 0) || (ent.name[0] == 0)) { in allocate_new_file()
310 rc = fs_opendir(&dir, CONFIG_LOG_BACKEND_FS_DIR); in allocate_new_file()
312 while (rc == 0) { in allocate_new_file()
313 rc = fs_readdir(&dir, &ent); in allocate_new_file()
314 if ((rc < 0) || (ent.name[0] == 0)) { in allocate_new_file()
337 if (rc < 0) { in allocate_new_file()
346 rc = fs_open(file, fname, FS_O_CREATE | FS_O_WRITE | FS_O_APPEND); in allocate_new_file()
347 if (rc < 0) { in allocate_new_file()
381 rc = fs_statvfs(CONFIG_LOG_BACKEND_FS_DIR, &stat); in allocate_new_file()
391 rc = del_oldest_log(); in allocate_new_file()
392 if (rc < 0) { in allocate_new_file()
396 rc = fs_statvfs(CONFIG_LOG_BACKEND_FS_DIR, in allocate_new_file()
398 if (rc < 0) { in allocate_new_file()
410 rc = fs_open(file, fname, FS_O_CREATE | FS_O_WRITE); in allocate_new_file()
411 if (rc < 0) { in allocate_new_file()
418 return rc; in allocate_new_file()
423 int rc; in del_oldest_log() local
430 rc = fs_unlink(dellname); in del_oldest_log()
432 if ((rc == 0) || (rc == -ENOENT)) { in del_oldest_log()
438 if (rc == 0) { in del_oldest_log()
447 return rc; in del_oldest_log()