Skip to content

Commit 40f7df0

Browse files
committed
sys/log, fs/fcb2: Remove fcb2 support
1 parent 940cc46 commit 40f7df0

File tree

5 files changed

+7
-62
lines changed

5 files changed

+7
-62
lines changed

fs/fcb2/include/fcb/fcb2.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -196,19 +196,6 @@ int fcb2_walk(struct fcb2 *fcb, int sector, fcb2_walk_cb cb, void *cb_arg);
196196
*/
197197
int fcb2_getnext(struct fcb2 *fcb, struct fcb2_entry *loc);
198198

199-
/**
200-
* Get first entry in the provided flash area
201-
*
202-
* @param fcb Pointer to FCB
203-
* @param range Optional range in flash sector
204-
* @param loc Pointer to first FCB entry in the provided flash area
205-
*
206-
* @return 0 on success, non-zero on failure
207-
*/
208-
int
209-
fcb2_getnext_in_area(struct fcb2 *fcb, struct flash_sector_range *range,
210-
struct fcb2_entry *loc);
211-
212199
/**
213200
* Walk through entries within FCB from newest to oldest.
214201
* fcb_getprev() finds the previous valid entry backwards from loc, and fills in
@@ -317,17 +304,6 @@ int fcb2_clear(struct fcb2 *fcb);
317304
*/
318305
int fcb2_area_info(struct fcb2 *fcb, int sector, int *elemsp, int *bytesp);
319306

320-
/**
321-
* Returns the next sector flash range, given current entry
322-
*
323-
* @param fcb Pointer to the FCB
324-
* @param loc Pointer to the location
325-
*
326-
* @return Flash sector range of the next sector
327-
*/
328-
struct flash_sector_range *
329-
fcb2_getnext_range(struct fcb2 *fcb, struct fcb2_entry *loc);
330-
331307
#ifdef __cplusplus
332308
}
333309

fs/fcb2/src/fcb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ fcb2_init(struct fcb2 *fcb)
8888
fcb->f_active_id = newest;
8989

9090
while (1) {
91-
rc = fcb2_getnext_in_area(fcb, NULL, &fcb->f_active);
91+
rc = fcb2_getnext_in_area(fcb, &fcb->f_active);
9292
if (rc == FCB2_ERR_NOVAR) {
9393
rc = FCB2_OK;
9494
break;

fs/fcb2/src/fcb_getnext.c

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,13 @@
2222
#include "fcb_priv.h"
2323

2424
int
25-
fcb2_getnext_in_area(struct fcb2 *fcb, struct flash_sector_range *range,
26-
struct fcb2_entry *loc)
25+
fcb2_getnext_in_area(struct fcb2 *fcb, struct fcb2_entry *loc)
2726
{
2827
int rc = FCB2_ERR_CRC;
2928
int len;
3029
int next_data_offset;
3130
int next_entry_offset;
3231

33-
/* If a flash range is specified, find first entry in that area */
34-
if (range) {
35-
loc->fe_range = range;
36-
loc->fe_data_off = fcb2_len_in_flash(range, sizeof(struct fcb2_disk_area));
37-
loc->fe_entry_num = 0;
38-
loc->fe_data_len = 0;
39-
loc->fe_sector = 0;
40-
}
41-
4232
while (rc == FCB2_ERR_CRC) {
4333
len = loc->fe_data_len;
4434
/* Next data offset in sector */
@@ -62,17 +52,6 @@ fcb2_getnext_in_area(struct fcb2 *fcb, struct flash_sector_range *range,
6252
return rc;
6353
}
6454

65-
struct flash_sector_range *
66-
fcb2_getnext_range(struct fcb2 *fcb, struct fcb2_entry *loc)
67-
{
68-
loc->fe_entry_num = 0;
69-
loc->fe_data_len = 0;
70-
loc->fe_sector = fcb2_getnext_sector(fcb, loc->fe_sector);
71-
loc->fe_range = fcb2_get_sector_range(fcb, loc->fe_sector);
72-
73-
return loc->fe_range;
74-
}
75-
7655
int
7756
fcb2_getnext_nolock(struct fcb2 *fcb, struct fcb2_entry *loc)
7857
{
@@ -92,7 +71,7 @@ fcb2_getnext_nolock(struct fcb2 *fcb, struct fcb2_entry *loc)
9271
loc->fe_entry_num = 1;
9372
rc = fcb2_elem_info(loc);
9473
} else {
95-
rc = fcb2_getnext_in_area(fcb, NULL, loc);
74+
rc = fcb2_getnext_in_area(fcb, loc);
9675
}
9776
switch (rc) {
9877
case 0:
@@ -103,7 +82,7 @@ fcb2_getnext_nolock(struct fcb2 *fcb, struct fcb2_entry *loc)
10382
goto next_sector;
10483
}
10584
while (rc == FCB2_ERR_CRC) {
106-
rc = fcb2_getnext_in_area(fcb, NULL, loc);
85+
rc = fcb2_getnext_in_area(fcb, loc);
10786
if (rc == 0) {
10887
return 0;
10988
}

fs/fcb2/src/fcb_priv.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ fcb2_len_in_flash(const struct flash_sector_range *range, uint16_t len)
4949
return (len + (range->fsr_align - 1)) & ~(range->fsr_align - 1);
5050
}
5151

52+
int fcb2_getnext_in_area(struct fcb2 *fcb, struct fcb2_entry *loc);
53+
5254
static inline int
5355
fcb2_getnext_sector(struct fcb2 *fcb, int sector)
5456
{

sys/log/full/src/log_fcb2.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ log_fcb2_start_append(struct log *log, int len, struct fcb2_entry *loc)
173173
}
174174
#endif
175175

176-
#if MYNEWT_VAL(LOG_FCB_BOOKMARKS) && !MYNEWT_VAL(LOG_FCB_SECTOR_BOOKMARKS)
176+
#if MYNEWT_VAL(LOG_FCB_BOOKMARKS)
177177
/* The FCB needs to be rotated. */
178178
log_fcb_rotate_bmarks(fcb_log);
179179
#endif
@@ -183,18 +183,6 @@ log_fcb2_start_append(struct log *log, int len, struct fcb2_entry *loc)
183183
goto err;
184184
}
185185

186-
#if MYNEWT_VAL(LOG_FCB_SECTOR_BOOKMARKS)
187-
/* The FCB needs to be rotated, reinit previously allocated
188-
* bookmarks
189-
*/
190-
rc = log_fcb_init_bmarks(fcb_log, fcb_log->fl_bset.lfs_bmarks,
191-
fcb_log->fl_bset.lfs_cap,
192-
fcb_log->fl_bset.lfs_en_sect_bmarks);
193-
if (rc) {
194-
goto err;
195-
}
196-
#endif
197-
198186
#if MYNEWT_VAL(LOG_STORAGE_WATERMARK)
199187
/*
200188
* FCB was rotated successfully so let's check if watermark was within

0 commit comments

Comments
 (0)