8000 Re-added the indentations to signify the code blocks under mutex lock. · pycom/pycom-micropython-sigfox@25183fb · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 25183fb

Browse files
committed
Re-added the indentations to signify the code blocks under mutex lock.
1 parent 6cb700a commit 25183fb

File tree

2 files changed

+39
-39
lines changed

2 files changed

+39
-39
lines changed

esp32/littlefs/vfs_littlefs.c

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,12 @@ STATIC mp_obj_t littlefs_vfs_ilistdir_func(size_t n_args, const mp_obj_t *args)
477477
iter->is_str = is_str_type;
478478

479479
xSemaphoreTake(self->fs.littlefs.mutex, portMAX_DELAY);
480-
const char *path = concat_with_cwd(&self->fs.littlefs, path_in);
481-
if (path == NULL) {
482-
res = LFS_ERR_NOMEM;
483-
} else {
484-
res = lfs_dir_open(&self->fs.littlefs.lfs, &iter->dir, path);
485-
}
480+
const char *path = concat_with_cwd(&self->fs.littlefs, path_in);
481+
if (path == NULL) {
482+
res = LFS_ERR_NOMEM;
483+
} else {
484+
res = lfs_dir_open(&self->fs.littlefs.lfs, &iter->dir, path);
485+
}
486486
xSemaphoreGive(self->fs.littlefs.mutex);
487487

488488
free((void*)path);
@@ -502,15 +502,15 @@ STATIC mp_obj_t littlefs_vfs_mkdir(mp_obj_t vfs_in, mp_obj_t path_param) {
502502
const char *path_in = mp_obj_str_get_str(path_param);
503503

504504
xSemaphoreTake(self->fs.littlefs.mutex, portMAX_DELAY);
505-
const char *path = concat_with_cwd(&self->fs.littlefs, path_in);
506-
if (path == NULL) {
507-
res = LFS_ERR_NOMEM;
508-
} else {
509-
res = lfs_mkdir(&self->fs.littlefs.lfs, path);
510-
if (res == LFS_ERR_OK) {
511-
littlefs_update_timestamp(&self->fs.littlefs.lfs, path);
505+
const char *path = concat_with_cwd(&self->fs.littlefs, path_in);
506+
if (path == NULL) {
507+
res = LFS_ERR_NOMEM;
508+
} else {
509+
res = lfs_mkdir(&self->fs.littlefs.lfs, path);
510+
if (res == LFS_ERR_OK) {
511+
littlefs_update_timestamp(&self->fs.littlefs.lfs, path);
512+
}
512513
}
513-
}
514514
xSemaphoreGive(self->fs.littlefs.mutex);
515515

516516
free((void*)path);
@@ -531,12 +531,12 @@ STATIC mp_obj_t littlefs_vfs_remove(mp_obj_t vfs_in, mp_obj_t path_param) {
531531
const char *path_in = mp_obj_str_get_str(path_param);
532532

533533
xSemaphoreTake(self->fs.littlefs.mutex, portMAX_DELAY);
534-
const char *path = concat_with_cwd(&self->fs.littlefs, path_in);
535-
if (path == NULL) {
536-
res = LFS_ERR_NOMEM;
537-
} else {
538-
res = lfs_remove(&self->fs.littlefs.lfs, path);
539-
}
534+
const char *path = concat_with_cwd(&self->fs.littlefs, path_in);
535+
if (path == NULL) {
536+
res = LFS_ERR_NOMEM;
537+
} else {
538+
res = lfs_remove(&self->fs.littlefs.lfs, path);
539+
}
540540
xSemaphoreGive(self->fs.littlefs.mutex);
541541

542542
free((void*)path);
@@ -558,14 +558,14 @@ STATIC mp_obj_t littlefs_vfs_rename(mp_obj_t vfs_in, mp_obj_t path_param_in, mp_
558558
const char *path_out = mp_obj_str_get_str(path_param_out);
559559

560560
xSemaphoreTake(self->fs.littlefs.mutex, portMAX_DELAY);
561-
const char *old_path = concat_with_cwd(&self->fs.littlefs, path_in);
562-
const char *new_path = concat_with_cwd(&self->fs.littlefs, path_out);
561+
const char *old_path = concat_with_cwd(&self->fs.littlefs, path_in);
562+
const char *new_path = concat_with_cwd(&self->fs.littlefs, path_out);
563563

564-
if (old_path == NULL || new_path == NULL) {
565-
res = LFS_ERR_NOMEM;
566-
} else {
567-
res = lfs_rename(&self->fs.littlefs.lfs, old_path, new_path);
568-
}
564+
if (old_path == NULL || new_path == NULL) {
565+
res = LFS_ERR_NOMEM;
566+
} else {
567+
res = lfs_rename(&self->fs.littlefs.lfs, old_path, new_path);
568+
}
569569
xSemaphoreGive(self->fs.littlefs.mutex);
570570

571571
free((void*)old_path);
@@ -620,16 +620,16 @@ STATIC mp_obj_t littlefs_vfs_stat(mp_obj_t vfs_in, mp_obj_t path_param) {
620620

621621

622622
xSemaphoreTake(self->fs.littlefs.mutex, portMAX_DELAY);
623-
const char *path = concat_with_cwd(&self->fs.littlefs, path_in);
624-
if (path == NULL) {
625-
res = LFS_ERR_NOMEM;
626-
} else if (path[0] == 0 || (path[0] == '/' && path[1] == 0)) {
627-
// stat root directory
628-
fno.size = 0;
629-
fno.type = LFS_TYPE_DIR;
630-
} else {
631-
res = littlefs_stat_common_helper(&self->fs.littlefs.lfs, path, &fno, &ts);
632-
}
623+
const char *path = concat_with_cwd(&self->fs.littlefs, path_in);
624+
if (path == NULL) {
625+
res = LFS_ERR_NOMEM;
626+
} else if (path[0] == 0 || (path[0] == '/' && path[1] == 0)) {
627+
// stat root directory
628+
fno.size = 0;
629+
fno.type = LFS_TYPE_DIR;
630+
} else {
631+
res = littlefs_stat_common_helper(&self->fs.littlefs.lfs, path, &fno, &ts);
632+
}
633633

634634
xSemaphoreGive(self->fs.littlefs.mutex);
635635

esp32/littlefs/vfs_littlefs_file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ STATIC mp_obj_t file_open(fs_user_mount_t *vfs, const mp_obj_type_t *type, mp_ar
167167
o->timestamp_update = false;
168168

169169
xSemaphoreTake(vfs->fs.littlefs.mutex, portMAX_DELAY);
170-
const char *fname = concat_with_cwd(&vfs->fs.littlefs, mp_obj_str_get_str(args[0].u_obj));
171-
int res = littlefs_open_common_helper(&vfs->fs.littlefs.lfs, fname, &o->fp, mode, &o->cfg, &o->timestamp_update);
170+
const char *fname = concat_with_cwd(&vfs->fs.littlefs, mp_obj_str_get_str(args[0].u_obj));
171+
int res = littlefs_open_common_helper(&vfs->fs.littlefs.lfs, fname, &o->fp, mode, &o->cfg, &o->timestamp_update);
172172
xSemaphoreGive(vfs->fs.littlefs.mutex);
173173

174174
free((void*)fname);

0 commit comments

Comments
 (0)
0