Commit Graph

168 Commits

Author SHA1 Message Date
Benoît Thébaudeau
d70c75914a cfs-coffee: Fix build warning
Fix this build warning, which is generated if micro logs are enabled:

In file included from ../../core/cfs/cfs-coffee.c:59:0:
../../core/cfs/cfs-coffee.c: In function 'read_log_page':
../../cpu/cc2538/./cfs-coffee-arch.h:145:24: warning: passing argument 1 of 'cfs_coffee_arch_read' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   cfs_coffee_arch_read((buf), (size), (offset))
                        ^
../../core/cfs/cfs-coffee.c:757:3: note: in expansion of macro 'COFFEE_READ'
   COFFEE_READ(lp->buf, lp->size, base);
   ^
../../cpu/cc2538/./cfs-coffee-arch.h:176:6: note: expected 'void *' but argument is of type 'const char *'
 void cfs_coffee_arch_read(void *buf, unsigned int size, cfs_offset_t offset);
      ^

COFFEE_READ() needs to write to lp->buf, so the target type of this
pointer cannot be qualified as "const".

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-05-30 23:05:11 +02:00
Joakim Nohlgård
19550f9f7f core/cfs: Disallow seeking past the end of a file if it is not writable 2016-05-03 07:10:35 +02:00
Frank Freihube
59727ede70 fixup! make changes configurable through io_semantics() 2016-04-29 08:12:55 +02:00
Frank Freihube
5bd7fc86c3 make changes configurable through io_semantics() 2016-04-29 08:07:27 +02:00
Frank Freihube
7ba5b0d150 Trailing zeros in file leading to unexpected file length get set in destination buffer 2016-04-27 10:39:05 +02:00
Nicolas Tsiftes
86733e8702 Clarified and cleaned up Coffee's documentation and the debug statements. Formatted some source code for easier reading. 2016-04-20 14:34:17 +02:00
Nicolas Tsiftes
7f700c9564 Remove the protected memory code associated with sensornet checkpointing because this functionality has been removed from Contiki. 2016-04-20 12:47:37 +02:00
rajithr
0d8de9022c Remove redundant assignment 2015-05-20 15:37:32 +05:30
Nicolas Tsiftes
da04ec74ed Corrected some code style issues in Coffee. 2015-02-17 11:02:06 +01:00
Enrico Joerns
85b494c16b [doc] Give files a common structure by placing license first (partial)
Followed by doxyen file and group tags.
This patch is only a first attempt to make provide a clean structure,
many more files require rework, too.
2014-11-10 23:54:49 +01:00
Nicolas Tsiftes
7004355c0f Do not copy more bytes than the filename string contains. 2014-06-11 14:10:00 +02:00
Nicolas Tsiftes
aef0e9eae6 Ensure that the file end is updated in the original file extent if it has been overwritten through a micro log operation. 2014-03-03 21:27:26 +01:00
Adam Dunkels
bb2dcaa057 A massive all-tree automated update of all double inclusion guard #defines that changes from using two underscores as a prefix, which are reserved, to not using two underscores as a prefix 2013-11-24 20:20:11 +01:00
Oliver Schmidt
1fdeb4c788 Changed handling of predefined macros in cc65 allows for simplification. 2013-11-20 20:55:56 +01:00
Oliver Schmidt
9970a3631a The new POSIX directory access in the CBM C library comes with a d_blocks field too. 2013-02-17 01:03:51 +01:00
nvt
757a54f63c Added some comments about Antelope and Coffee. 2012-11-19 13:21:59 +01:00
Adam Dunkels
944537fccf Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00
nvt
5330dd1565 Avoid reading bytes from the original file when their is a log entry for that part of the file. 2011-07-30 10:05:23 +02:00
Nicolas Tsiftes
ce909a97e6 Removed unread stack variable 2011-06-10 17:41:46 +02:00
Joakim Eriksson
77ec0bfa0f fixed the z1 platform and generic code used by z1 to work with IAR compiler 2011-05-25 17:21:51 +02:00
Fredrik Osterlind
499c13a357 removed execute flag of source files (avoids diff problems with egit) 2011-03-01 18:16:42 +01:00
nvt
20bf23cf06 Replaced ifdef with if, as salvopitru suggested 2011-02-14 15:53:08 +01:00
nvt
4125c38808 missing word 2011-02-13 21:34:29 +01:00
Nicolas Tsiftes
774aa3984a Use a more understandable name 2011-02-09 15:17:25 +01:00
Nicolas Tsiftes
c77cb63df1 ifdef -> if 2011-02-09 15:13:50 +01:00
Nicolas Tsiftes
39ea9405bb Added a function for setting the I/O semantics on a Coffee file descriptor. Changed the configuration parameters slightly and updated the platform definitions to reflect this change. 2011-02-09 15:03:57 +01:00
nvt-se
faab7229c9 Must check the storage boundary in find_contiguous_pages. 2011-01-25 18:39:09 +00:00
nvt-se
28421f1fe2 Removed watchdog calls from Coffee 2011-01-18 14:06:33 +00:00
nvt-se
404230a047 Added a macro for portable watchdog calls. 2010-12-15 14:01:07 +00:00
nvt-se
1168703506 Minor clarifications in the code and comments. Integrated atches from Frederic Sureau: 1. copy_buf is now an ordinary char pointer. 2. Read directly from a file that is not modified. This reduces the code size when COFFEE_MICRO_LOGS is set to 0. 3. Update the file end value each time it is changed in case a log merge operation occurs later. 4. Avoid possible alignment problem in reading from the dummy_space area when calling cfs_readdir. 2010-11-11 13:08:23 +00:00
nvt-se
909569f834 Must check if load_file succeeded 2010-10-01 20:14:14 +00:00
nvt-se
8c3ed291bb Preserve the file offset if a seek operation fails. 2010-05-13 18:24:55 +00:00
nvt-se
e4187b2fc8 Made pointers constant and thereby reduced the code size slightly. 2010-05-05 12:35:39 +00:00
nvt-se
f9ca4a546d Introduced append-only mode for systems with little available code space left, but which require basic FS support. Removes about 1.5kB ROM when the mode is enabled, i.e., COFFEE_CONF_APPEND_ONLY=1 2010-04-12 13:20:55 +00:00
fros4943
b952f97799 stopping watchdog during find_file 2010-03-29 11:31:35 +00:00
nvt-se
f4d19560fc Fixed a performance problem by not allowing GC while doing merges of files and micro logs. 2010-02-08 14:08:14 +00:00
nvt-se
3c890c48a9 Added some comments to clarify how Coffee works internally 2010-01-19 16:18:34 +00:00
nvt-se
d2655eac7a make watchdog management slightly more abstract to simplify porting 2010-01-14 21:16:58 +00:00
nvt-se
8acea82207 Set a file mode in the third argument when calling open() with O_CREAT in
the flags. Required by IEEE Std 1003.1, 2004 Edition.
2009-08-10 09:50:55 +00:00
dak664
c1b7375a5a *** empty log message *** 2009-07-23 16:13:48 +00:00
nvt-se
62b380b0a6 Fixed a bug with reading to far in get_record index. Thanks to Darren Moore for reporting this. 2009-07-16 11:58:44 +00:00
nvt-se
906717a333 * isolate only pages in the last sector
* set max_pages to 0 when calling remove_by_page to prevent file starvation.
* when allocating files, only update next_free if the allocated file starts at next_free.

Thanks to Darren Moore (CSIRO) for suggesting the first two of the
three changes.
2009-07-09 22:16:22 +00:00
nvt-se
c872a86653 undo accidental enabling of debug output. 2009-06-29 13:33:12 +00:00
nvt-se
1e0ca9ceac Made the use of micro logs configurable to make file modifications
more efficient on storage types that support inline updates.

The sky platform uses logs, and the native platform uses no logs.
2009-06-29 13:30:16 +00:00
nvt-se
53a8acc49a cleared debug flag. 2009-06-10 15:13:37 +00:00
nvt-se
349e14abd4 fixed GC bug with big files and unwanted buffer overwrite bug. 2009-06-10 15:03:35 +00:00
nvt-se
d9b75b2fda stop the watchdog while merging. 2009-05-26 14:27:06 +00:00
nvt-se
88766d8740 use unsigned for sector count type. 2009-05-25 22:10:04 +00:00
nvt-se
2978270e43 decreased the code size to less than 5000 bytes. (msp430 code)
improved clarity in read and write code.
added negative offset check in cfs_seek().
removed unnecessary multiplication.
2009-05-13 13:27:19 +00:00
nvt-se
995e788d73 Fixed append->modify->append bug.
Approximately doubled the speed of file reservations.

Reduced the compiled code size by about 100 bytes by removing redundant code.
2009-05-11 16:35:49 +00:00