summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2023-10-03 13:42:26 -0400
committerWilliam Wilgus <me.theuser@yahoo.com>2023-10-03 13:56:00 -0400
commiteee48dca39cbbe3cf4ad13bcf1d90bb3492151e5 (patch)
tree85f3a49ed127e80e0ea9aa0de434babfb0aba061
parent69f62b78915e360a1bcb18fcb7383ab1fa716c57 (diff)
downloadrockbox-eee48dca39cbbe3cf4ad13bcf1d90bb3492151e5.tar.gz
rockbox-eee48dca39cbbe3cf4ad13bcf1d90bb3492151e5.zip
tagcache reduce stack usage in tmpbuf_insert and build_index functions #2
move some functions around for later ifdef for tagcache commit plugin used fixed width variables in struct temp_file_entry Change-Id: I7f66b15cd1bdf5abcefa700086d390d22d3b5e21
-rw-r--r--apps/tagcache.c307
1 files changed, 155 insertions, 152 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index f7746f1ec3..e60732fb65 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -55,6 +55,7 @@
55 * 55 *
56 */ 56 */
57 57
58
58/*#define LOGF_ENABLE*/ 59/*#define LOGF_ENABLE*/
59/*#define LOGF_CLAUSES define to enable logf clause matching (LOGF_ENABLE req'd) */ 60/*#define LOGF_CLAUSES define to enable logf clause matching (LOGF_ENABLE req'd) */
60 61
@@ -174,7 +175,9 @@ static const char tagcache_thread_name[] = "tagcache";
174 175
175/* Previous path when scanning directory tree recursively. */ 176/* Previous path when scanning directory tree recursively. */
176static char curpath[TAGCACHE_BUFSZ]; 177static char curpath[TAGCACHE_BUFSZ];
177 178/* Shared buffer for several build_index fns to reduce stack usage */
179static char build_idx_buf[TAGCACHE_BUFSZ];
180static const long build_idx_bufsz = sizeof(build_idx_buf);
178/* Used when removing duplicates. */ 181/* Used when removing duplicates. */
179static char *tempbuf; /* Allocated when needed. */ 182static char *tempbuf; /* Allocated when needed. */
180static long tempbufidx; /* Current location in buffer. */ 183static long tempbufidx; /* Current location in buffer. */
@@ -355,11 +358,10 @@ static inline void tcrc_buffer_unlock(void)
355 * Full tag entries stored in a temporary file waiting 358 * Full tag entries stored in a temporary file waiting
356 * for commit to the cache. */ 359 * for commit to the cache. */
357struct temp_file_entry { 360struct temp_file_entry {
358 long tag_offset[TAG_COUNT]; 361 int32_t tag_offset[TAG_COUNT];
359 short tag_length[TAG_COUNT]; 362 int16_t tag_length[TAG_COUNT];
360 long flag; 363 int32_t flag;
361 364 int32_t data_length;
362 long data_length;
363}; 365};
364 366
365struct tempbuf_id_list { 367struct tempbuf_id_list {
@@ -396,43 +398,6 @@ static inline void str_setlen(char *buf, size_t len)
396 buf[len] = '\0'; 398 buf[len] = '\0';
397} 399}
398 400
399static void allocate_tempbuf(void)
400{
401 /* Yeah, malloc would be really nice now :) */
402 size_t size;
403 tempbuf_size = 0;
404
405#ifdef __PCTOOL__
406 size = 32*1024*1024;
407 tempbuf = malloc(size);
408 if (tempbuf)
409 tempbuf_size = size;
410#else /* !__PCTOOL__ */
411 /* Need to pass dummy ops to prevent the buffer being moved
412 * out from under us, since we yield during the tagcache commit. */
413 tempbuf_handle = core_alloc_maximum(&size, &buflib_ops_locked);
414 if (tempbuf_handle > 0)
415 {
416 tempbuf = core_get_data(tempbuf_handle);
417 tempbuf_size = size;
418 }
419#endif /* __PCTOOL__ */
420}
421
422static void free_tempbuf(void)
423{
424 if (tempbuf_size == 0)
425 return ;
426
427#ifdef __PCTOOL__
428 free(tempbuf);
429#else
430 tempbuf_handle = core_free(tempbuf_handle);
431#endif
432 tempbuf = NULL;
433 tempbuf_size = 0;
434}
435
436const char* tagcache_tag_to_str(int tag) 401const char* tagcache_tag_to_str(int tag)
437{ 402{
438 return tags_str[tag]; 403 return tags_str[tag];
@@ -631,8 +596,8 @@ static int open_tag_fd(struct tagcache_header *hdr, int tag, bool write)
631 tc_stat.db_path, tag); 596 tc_stat.db_path, tag);
632 if (fd < 0) 597 if (fd < 0)
633 { 598 {
634 logf("tag file open failed: tag=%d write=%d file= " TAGCACHE_FILE_INDEX, 599 logf("%s failed: tag=%d write=%d file= " TAGCACHE_FILE_INDEX,
635 tag, write, tag); 600 __func__, tag, write, tag);
636 tc_stat.ready = false; 601 tc_stat.ready = false;
637 return fd; 602 return fd;
638 } 603 }
@@ -693,6 +658,85 @@ static int open_master_fd(struct master_header *hdr, bool write)
693 return fd; 658 return fd;
694} 659}
695 660
661static void remove_files(void)
662{
663 int i;
664 char buf[MAX_PATH];
665 const int bufsz = sizeof(buf);
666 logf("%s", __func__);
667
668 tc_stat.ready = false;
669 tc_stat.ramcache = false;
670 tc_stat.econ = false;
671 remove_db_file(TAGCACHE_FILE_MASTER);
672 for (i = 0; i < TAG_COUNT; i++)
673 {
674 if (TAGCACHE_IS_NUMERIC(i))
675 continue;
676
677 snprintf(buf, bufsz, "%s/" TAGCACHE_FILE_INDEX,
678 tc_stat.db_path, i);
679 remove(buf);
680 }
681}
682
683static bool check_all_headers(void)
684{
685 struct master_header myhdr;
686 struct tagcache_header tch;
687 int tag;
688 int fd;
689
690 if ( (fd = open_master_fd(&myhdr, false)) < 0)
691 return false;
692
693 close(fd);
694 if (myhdr.dirty)
695 {
696 logf("tagcache is dirty!");
697 return false;
698 }
699
700 memcpy(&current_tcmh, &myhdr, sizeof(struct master_header));
701
702 for (tag = 0; tag < TAG_COUNT; tag++)
703 {
704 if (TAGCACHE_IS_NUMERIC(tag))
705 continue;
706
707 if ( (fd = open_tag_fd(&tch, tag, false)) < 0)
708 return false;
709
710 close(fd);
711 }
712
713 return true;
714}
715
716static bool update_master_header(void)
717{
718 struct master_header myhdr;
719 int fd;
720
721 if (!tc_stat.ready)
722 return false;
723
724 if ( (fd = open_master_fd(&myhdr, true)) < 0)
725 return false;
726
727 myhdr.serial = current_tcmh.serial;
728 myhdr.commitid = current_tcmh.commitid;
729 myhdr.dirty = current_tcmh.dirty;
730
731 /* Write it back */
732 lseek(fd, 0, SEEK_SET);
733 write_master_header(fd, &myhdr);
734 close(fd);
735
736 return true;
737}
738
739
696#ifndef __PCTOOL__ 740#ifndef __PCTOOL__
697static bool do_timed_yield(void) 741static bool do_timed_yield(void)
698{ 742{
@@ -708,6 +752,44 @@ static bool do_timed_yield(void)
708} 752}
709#endif /* __PCTOOL__ */ 753#endif /* __PCTOOL__ */
710 754
755static void allocate_tempbuf(void)
756{
757 /* Yeah, malloc would be really nice now :) */
758 size_t size;
759 tempbuf_size = 0;
760
761#ifdef __PCTOOL__
762 size = 32*1024*1024;
763 tempbuf = malloc(size);
764 if (tempbuf)
765 tempbuf_size = size;
766#else /* !__PCTOOL__ */
767 /* Need to pass dummy ops to prevent the buffer being moved
768 * out from under us, since we yield during the tagcache commit. */
769 tempbuf_handle = core_alloc_maximum(&size, &buflib_ops_locked);
770 if (tempbuf_handle > 0)
771 {
772 tempbuf = core_get_data(tempbuf_handle);
773 tempbuf_size = size;
774 }
775#endif /* __PCTOOL__ */
776
777}
778
779static void free_tempbuf(void)
780{
781 if (tempbuf_size == 0)
782 return ;
783
784#ifdef __PCTOOL__
785 free(tempbuf);
786#else
787 tempbuf_handle = core_free(tempbuf_handle);
788#endif
789 tempbuf = NULL;
790 tempbuf_size = 0;
791}
792
711#if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE) 793#if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE)
712/* find the ramcache entry corresponding to the file indicated by 794/* find the ramcache entry corresponding to the file indicated by
713 * filename and dc (it's corresponding dircache id). */ 795 * filename and dc (it's corresponding dircache id). */
@@ -1636,61 +1718,6 @@ static bool build_lookup_list(struct tagcache_search *tcs)
1636} 1718}
1637 1719
1638 1720
1639static void remove_files(void)
1640{
1641 int i;
1642 char buf[MAX_PATH];
1643 const int bufsz = sizeof(buf);
1644
1645 tc_stat.ready = false;
1646 tc_stat.ramcache = false;
1647 tc_stat.econ = false;
1648 remove_db_file(TAGCACHE_FILE_MASTER);
1649 for (i = 0; i < TAG_COUNT; i++)
1650 {
1651 if (TAGCACHE_IS_NUMERIC(i))
1652 continue;
1653
1654 snprintf(buf, bufsz, "%s/" TAGCACHE_FILE_INDEX,
1655 tc_stat.db_path, i);
1656 remove(buf);
1657 }
1658}
1659
1660
1661static bool check_all_headers(void)
1662{
1663 struct master_header myhdr;
1664 struct tagcache_header tch;
1665 int tag;
1666 int fd;
1667
1668 if ( (fd = open_master_fd(&myhdr, false)) < 0)
1669 return false;
1670
1671 close(fd);
1672 if (myhdr.dirty)
1673 {
1674 logf("tagcache is dirty!");
1675 return false;
1676 }
1677
1678 memcpy(&current_tcmh, &myhdr, sizeof(struct master_header));
1679
1680 for (tag = 0; tag < TAG_COUNT; tag++)
1681 {
1682 if (TAGCACHE_IS_NUMERIC(tag))
1683 continue;
1684
1685 if ( (fd = open_tag_fd(&tch, tag, false)) < 0)
1686 return false;
1687
1688 close(fd);
1689 }
1690
1691 return true;
1692}
1693
1694bool tagcache_search(struct tagcache_search *tcs, int tag) 1721bool tagcache_search(struct tagcache_search *tcs, int tag)
1695{ 1722{
1696 struct tagcache_header tag_hdr; 1723 struct tagcache_header tag_hdr;
@@ -2005,29 +2032,6 @@ bool tagcache_retrieve(struct tagcache_search *tcs, int idxid,
2005 return retrieve(tcs, IF_DIRCACHE(idxid,) &idx, tag, buf, size); 2032 return retrieve(tcs, IF_DIRCACHE(idxid,) &idx, tag, buf, size);
2006} 2033}
2007 2034
2008static bool update_master_header(void)
2009{
2010 struct master_header myhdr;
2011 int fd;
2012
2013 if (!tc_stat.ready)
2014 return false;
2015
2016 if ( (fd = open_master_fd(&myhdr, true)) < 0)
2017 return false;
2018
2019 myhdr.serial = current_tcmh.serial;
2020 myhdr.commitid = current_tcmh.commitid;
2021 myhdr.dirty = current_tcmh.dirty;
2022
2023 /* Write it back */
2024 lseek(fd, 0, SEEK_SET);
2025 write_master_header(fd, &myhdr);
2026 close(fd);
2027
2028 return true;
2029}
2030
2031void tagcache_search_finish(struct tagcache_search *tcs) 2035void tagcache_search_finish(struct tagcache_search *tcs)
2032{ 2036{
2033 int i; 2037 int i;
@@ -2366,15 +2370,14 @@ static bool tempbuf_insert(char *str, int id, int idx_id, bool unique)
2366 struct tempbuf_searchidx *index = (struct tempbuf_searchidx *)tempbuf; 2370 struct tempbuf_searchidx *index = (struct tempbuf_searchidx *)tempbuf;
2367 int len = strlen(str)+1; 2371 int len = strlen(str)+1;
2368 int i; 2372 int i;
2369 unsigned crc32;
2370 unsigned *crcbuf = (unsigned *)&tempbuf[tempbuf_size-4]; 2373 unsigned *crcbuf = (unsigned *)&tempbuf[tempbuf_size-4];
2371 char buf[TAGCACHE_BUFSZ]; 2374 unsigned crc32 = 0xffffffff;
2372 const int bufsz = sizeof(buf); 2375 char chr_lower;
2373 2376 for (i = 0; str[i] != '\0' && i < len; i++)
2374 for (i = 0; str[i] != '\0' && i < bufsz-1; i++) 2377 {
2375 buf[i] = tolower(str[i]); 2378 chr_lower = tolower(str[i]);
2376 2379 crc32 = crc_32(&chr_lower, 1, crc32);
2377 crc32 = crc_32(buf, i, 0xffffffff); 2380 }
2378 2381
2379 if (unique) 2382 if (unique)
2380 { 2383 {
@@ -2568,9 +2571,6 @@ static bool build_numeric_indices(struct tagcache_header *h, int tmpfd)
2568 int entries_processed = 0; 2571 int entries_processed = 0;
2569 int i, j; 2572 int i, j;
2570 2573
2571 char buf[TAGCACHE_BUFSZ];
2572 const int bufsz = sizeof(buf);
2573
2574 max_entries = tempbuf_size / sizeof(struct temp_file_entry) - 1; 2574 max_entries = tempbuf_size / sizeof(struct temp_file_entry) - 1;
2575 2575
2576 logf("Building numeric indices..."); 2576 logf("Building numeric indices...");
@@ -2621,23 +2621,23 @@ static bool build_numeric_indices(struct tagcache_header *h, int tmpfd)
2621 */ 2621 */
2622#define tmpdb_read_string_tag(tag) \ 2622#define tmpdb_read_string_tag(tag) \
2623 lseek(tmpfd, tfe->tag_offset[tag], SEEK_CUR); \ 2623 lseek(tmpfd, tfe->tag_offset[tag], SEEK_CUR); \
2624 if ((unsigned long)tfe->tag_length[tag] > (unsigned long)bufsz) \ 2624 if ((unsigned long)tfe->tag_length[tag] > (unsigned long)build_idx_bufsz) \
2625 { \ 2625 { \
2626 logf("read fail: buffer overflow"); \ 2626 logf("read fail: buffer overflow"); \
2627 close(masterfd); \ 2627 close(masterfd); \
2628 return false; \ 2628 return false; \
2629 } \ 2629 } \
2630 \ 2630 \
2631 if (read(tmpfd, buf, tfe->tag_length[tag]) != \ 2631 if (read(tmpfd, build_idx_buf, tfe->tag_length[tag]) != \
2632 tfe->tag_length[tag]) \ 2632 tfe->tag_length[tag]) \
2633 { \ 2633 { \
2634 logf("read fail #2"); \ 2634 logf("read fail #2"); \
2635 close(masterfd); \ 2635 close(masterfd); \
2636 return false; \ 2636 return false; \
2637 } \ 2637 } \
2638 str_setlen(buf, tfe->tag_length[tag]); \ 2638 str_setlen(build_idx_buf, tfe->tag_length[tag]); \
2639 \ 2639 \
2640 tfe->tag_offset[tag] = crc_32(buf, strlen(buf), 0xffffffff); \ 2640 tfe->tag_offset[tag] = crc_32(build_idx_buf, strlen(build_idx_buf), 0xffffffff); \
2641 lseek(tmpfd, datastart, SEEK_SET) 2641 lseek(tmpfd, datastart, SEEK_SET)
2642 2642
2643 tmpdb_read_string_tag(tag_filename); 2643 tmpdb_read_string_tag(tag_filename);
@@ -2808,8 +2808,6 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd)
2808 struct master_header tcmh; 2808 struct master_header tcmh;
2809 struct index_entry idxbuf[IDX_BUF_DEPTH]; 2809 struct index_entry idxbuf[IDX_BUF_DEPTH];
2810 int idxbuf_pos; 2810 int idxbuf_pos;
2811 char buf[TAGCACHE_BUFSZ];
2812 const long bufsz = sizeof(buf);
2813 int fd = -1, masterfd; 2811 int fd = -1, masterfd;
2814 bool error = false; 2812 bool error = false;
2815 int init; 2813 int init;
@@ -2905,7 +2903,7 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd)
2905 struct tagfile_entry entry; 2903 struct tagfile_entry entry;
2906 int loc = lseek(fd, 0, SEEK_CUR); 2904 int loc = lseek(fd, 0, SEEK_CUR);
2907 bool ret; 2905 bool ret;
2908 switch (read_tagfile_entry_and_tag(fd, &entry, buf, bufsz)) 2906 switch (read_tagfile_entry_and_tag(fd, &entry, build_idx_buf, build_idx_bufsz))
2909 { 2907 {
2910 case e_SUCCESS_LEN_ZERO: /* Skip deleted entries. */ 2908 case e_SUCCESS_LEN_ZERO: /* Skip deleted entries. */
2911 continue; 2909 continue;
@@ -2930,7 +2928,7 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd)
2930 * is saved so we can later reindex the master lookup 2928 * is saved so we can later reindex the master lookup
2931 * table when the index gets resorted. 2929 * table when the index gets resorted.
2932 */ 2930 */
2933 ret = tempbuf_insert(buf, loc/TAGFILE_ENTRY_CHUNK_LENGTH 2931 ret = tempbuf_insert(build_idx_buf, loc/TAGFILE_ENTRY_CHUNK_LENGTH
2934 + commit_entry_count, entry.idx_id, 2932 + commit_entry_count, entry.idx_id,
2935 TAGCACHE_IS_UNIQUE(index_type)); 2933 TAGCACHE_IS_UNIQUE(index_type));
2936 if (!ret) 2934 if (!ret)
@@ -2947,6 +2945,7 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd)
2947 } 2945 }
2948 else 2946 else
2949 { 2947 {
2948 logf("Create New Index: %d", index_type);
2950 /** 2949 /**
2951 * Creating new index file to store the tags. No need to preload 2950 * Creating new index file to store the tags. No need to preload
2952 * anything whether the index type is sorted or not. 2951 * anything whether the index type is sorted or not.
@@ -2954,7 +2953,8 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd)
2954 * Note: although we are creating a file under the db path, it must 2953 * Note: although we are creating a file under the db path, it must
2955 * already exist by this point so no mkdir is required. 2954 * already exist by this point so no mkdir is required.
2956 */ 2955 */
2957 fd = open_pathfmt(buf, bufsz, O_WRONLY | O_CREAT | O_TRUNC, 2956 fd = open_pathfmt(build_idx_buf, build_idx_bufsz,
2957 O_WRONLY | O_CREAT | O_TRUNC,
2958 "%s/" TAGCACHE_FILE_INDEX, 2958 "%s/" TAGCACHE_FILE_INDEX,
2959 tc_stat.db_path, index_type); 2959 tc_stat.db_path, index_type);
2960 if (fd < 0) 2960 if (fd < 0)
@@ -3056,7 +3056,7 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd)
3056 } 3056 }
3057 3057
3058 /* Read data. */ 3058 /* Read data. */
3059 if (entry.tag_length[index_type] >= (long)bufsz) 3059 if (entry.tag_length[index_type] >= build_idx_bufsz)
3060 { 3060 {
3061 logf("too long entry!"); 3061 logf("too long entry!");
3062 error = true; 3062 error = true;
@@ -3064,19 +3064,20 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd)
3064 } 3064 }
3065 3065
3066 lseek(tmpfd, entry.tag_offset[index_type], SEEK_CUR); 3066 lseek(tmpfd, entry.tag_offset[index_type], SEEK_CUR);
3067 if (read(tmpfd, buf, entry.tag_length[index_type]) != 3067 if (read(tmpfd, build_idx_buf, entry.tag_length[index_type]) !=
3068 entry.tag_length[index_type]) 3068 entry.tag_length[index_type])
3069 { 3069 {
3070 logf("read fail #4"); 3070 logf("read fail #4");
3071 error = true; 3071 error = true;
3072 goto error_exit; 3072 goto error_exit;
3073 } 3073 }
3074 str_setlen(buf, entry.tag_length[index_type]); 3074 str_setlen(build_idx_buf, entry.tag_length[index_type]);
3075 3075
3076 if (TAGCACHE_IS_UNIQUE(index_type)) 3076 if (TAGCACHE_IS_UNIQUE(index_type))
3077 error = !tempbuf_insert(buf, i, -1, true); 3077 error = !tempbuf_insert(build_idx_buf, i, -1, true);
3078 else 3078 else
3079 error = !tempbuf_insert(buf, i, tcmh.tch.entry_count + i, false); 3079 error = !tempbuf_insert(build_idx_buf, i,
3080 tcmh.tch.entry_count + i, false);
3080 3081
3081 if (error) 3082 if (error)
3082 { 3083 {
@@ -3210,7 +3211,7 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd)
3210 } 3211 }
3211 3212
3212 /* Read data. */ 3213 /* Read data. */
3213 if (entry.tag_length[index_type] >= (int)sizeof(buf)) 3214 if (entry.tag_length[index_type] >= build_idx_bufsz)
3214 { 3215 {
3215 logf("too long entry!"); 3216 logf("too long entry!");
3216 logf("length=%d", entry.tag_length[index_type]); 3217 logf("length=%d", entry.tag_length[index_type]);
@@ -3220,7 +3221,7 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd)
3220 } 3221 }
3221 3222
3222 lseek(tmpfd, entry.tag_offset[index_type], SEEK_CUR); 3223 lseek(tmpfd, entry.tag_offset[index_type], SEEK_CUR);
3223 if (read(tmpfd, buf, entry.tag_length[index_type]) != 3224 if (read(tmpfd, build_idx_buf, entry.tag_length[index_type]) !=
3224 entry.tag_length[index_type]) 3225 entry.tag_length[index_type])
3225 { 3226 {
3226 logf("read fail #8"); 3227 logf("read fail #8");
@@ -3235,7 +3236,7 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd)
3235 fe.tag_length = entry.tag_length[index_type]; 3236 fe.tag_length = entry.tag_length[index_type];
3236 fe.idx_id = tcmh.tch.entry_count + i + j; 3237 fe.idx_id = tcmh.tch.entry_count + i + j;
3237 write_tagfile_entry(fd, &fe); 3238 write_tagfile_entry(fd, &fe);
3238 write(fd, buf, fe.tag_length); 3239 write(fd, build_idx_buf, fe.tag_length);
3239 tempbufidx++; 3240 tempbufidx++;
3240 3241
3241 /* Skip to next. */ 3242 /* Skip to next. */
@@ -3408,6 +3409,7 @@ static bool commit(void)
3408 tc_stat.commit_step = 0; 3409 tc_stat.commit_step = 0;
3409 goto commit_error; 3410 goto commit_error;
3410 } 3411 }
3412 do_timed_yield();
3411 } 3413 }
3412 3414
3413 if (!build_numeric_indices(&tch, tmpfd)) 3415 if (!build_numeric_indices(&tch, tmpfd))
@@ -3443,7 +3445,7 @@ static bool commit(void)
3443 tc_stat.ready = check_all_headers(); 3445 tc_stat.ready = check_all_headers();
3444 tc_stat.readyvalid = true; 3446 tc_stat.readyvalid = true;
3445 3447
3446#ifdef HAVE_TC_RAMCACHE 3448#if defined(HAVE_TC_RAMCACHE)
3447 if (ramcache_buffer_stolen) 3449 if (ramcache_buffer_stolen)
3448 { 3450 {
3449 tempbuf = NULL; 3451 tempbuf = NULL;
@@ -3483,6 +3485,7 @@ commit_error:
3483 return rc; 3485 return rc;
3484} 3486}
3485 3487
3488
3486#ifndef __PCTOOL__ 3489#ifndef __PCTOOL__
3487 3490
3488static bool modify_numeric_entry(int masterfd, int idx_id, int tag, long data) 3491static bool modify_numeric_entry(int masterfd, int idx_id, int tag, long data)