Commit Graph

958 Commits

Author SHA1 Message Date
Vincent Sanders
73e45ff024 Fix error reporting from fetch_start
Any fetch start error was being reported as "out of memory" which was
clearly insufficient. Foe example bad urls (reported was file:// with
a missing /) were causing a warn_user with out of memory. This change
now at least causes a "bad url" message.
2015-06-24 10:31:13 +01:00
Vincent Sanders
e9b89f776d Allow the resource scheme to provide data directly.
This allows front ends to provide resources from compiled in data
instead of requiring the resources to be available on disc and forcing
a redirect.
2015-06-17 21:35:40 +01:00
Vincent Sanders
0d811963c1 fixup all the remaining logging macro callsites
The semantic patch tool appears to have missed some difficult to
reason about callsites which have now been manually cleaned up
2015-05-28 17:06:18 +01:00
Vincent Sanders
c105738fa3 Change LOG() macro to be varadic
This changes the LOG macro to be varadic removing the need for all
callsites to have double bracketing and allows for future improvement
on how we use the logging macros.

The callsites were changed with coccinelle and the changes checked by
hand. Compile tested for several frontends but not all.

A formatting annotation has also been added which allows the compiler
to check the parameters and types passed to the logging.
2015-05-28 16:08:46 +01:00
Michael Drake
8f1c9673d7 Fix format string type missmatches on 32-bit systems.
Use C99 inttypes header for format string macros.
2015-05-12 10:19:38 +01:00
Michael Drake
82237d7070 Avoid generating confusing warning.
Now the disc cache will be disabled silently if its too slow.
2015-05-12 10:01:06 +01:00
Vincent Sanders
37aad9c749 Improve the logge dinformation about written cache data 2015-05-08 15:42:49 +01:00
Vincent Sanders
35751f3faa Move the setting of block file extents to background maintinance.
On some OS the ftruncate operation can take some time so move it to
occour in the background maintinance operations instead of when data
blocks are initialy opened. This should improve browsing responsiveness.
2015-05-04 09:54:03 +01:00
Vincent Sanders
2aef095f27 Ensure bandwidth minimum check is only performed when enough data has
been written.
2015-04-30 14:28:18 +01:00
Vincent Sanders
05538c0264 Ensure small block cache files allocate their entire extent at open.
It seems many filesystems are greatly more efficient if the block file
is allocated its entire extent once rather than trying to
continuously grown the file later.

The size of the block files is known at their creation time so this
change ensures they are grown to the full possible extent hence removing
future inefficient writes.
2015-04-30 13:49:25 +01:00
Vincent Sanders
ea2e1c4d98 Add scaled content redraw interface.
Add a new interface to the content to allow automaticaly scaled
content redraws. This is intended to replace the thumbnail_redraw
interface with something more generic.
2015-04-23 15:47:28 +01:00
Vincent Sanders
f37e52c394 Move bitmap operations into an operation table.
The generic bitmap handlers provided by each frontend are called back
from the core and therefore should be in an operation table. This was
one of the very few remaining interfaces stopping the core code from
being split into a library.
2015-04-13 23:19:04 +01:00
Vincent Sanders
ea9a2ff01d Fix up some doxygen errors 2015-04-03 00:28:22 +01:00
Vincent Sanders
77ffda1e46 Use nsutils unistd operations for pread and pwrite to get consistant interface 2015-04-02 17:28:55 +01:00
Vincent Sanders
47d08b6506 Revert "Fix RISC OS not having a pread/pwrite implementation."
This reverts commit 82c7a7a4ba.

Conflicts:
	content/fs_backing_store.c
2015-04-02 16:37:04 +01:00
Vincent Sanders
576b1c55bf extend backing store logging to show errno values ofter operations 2015-04-01 09:26:39 +01:00
Vincent Sanders
82c7a7a4ba Fix RISC OS not having a pread/pwrite implementation. 2015-03-31 22:41:37 +01:00
Vincent Sanders
87a38ca5c1 ensure entry invalidation copes with entries in blocks 2015-03-31 22:02:07 +01:00
Vincent Sanders
9511e9c4e9 Improve file naming inside cache 2015-03-31 20:57:00 +01:00
Vincent Sanders
f1d4094566 allocate small block using block use bitmaps to find free entries. 2015-03-31 20:56:55 +01:00
Vincent Sanders
706a77170d implement block read and write operations. 2015-03-31 20:56:55 +01:00
Vincent Sanders
c965fa8739 Block file usage bitmaps (de)serialising 2015-03-31 20:56:55 +01:00
Vincent Sanders
a8e501a663 define block store parameters 2015-03-31 20:56:55 +01:00
Vincent Sanders
980e28d916 Change backing store fetch operation to always perform the allocations
The fetch API previously allowed for the caller to supply the storage,
this was never used and was preventing the refactoring necessary for
small black storage to be available.
2015-03-31 20:56:55 +01:00
Vincent Sanders
1d03f34d62 Compute the element index once and use that as a parameter.
Change to computing the element index from the flags passed to store
and fetch methods instead of passing the flags around and calculating
everywhere.

Additionally split out writing element of entry to file into distinct
function to make code clearer.
2015-03-31 20:56:55 +01:00
Vincent Sanders
c2eda75710 Change element layout and cope with index collisions. 2015-03-31 20:56:55 +01:00
Vincent Sanders
8a99b045bc Remove url from content thumbnailers API
The content thumbnailers for each frontend were being provided the
contents url. This was only ever used to call the urldb thumbnail
setting API.

This changes it so the single callsite that passed a valid url adds
the bitmap to that url itself in desktop_history.c instead of forcing
every frontend to require the urldb API.

Additionally the old API could pass the url as NULL which was causing
asserts where this was not an expected parameter value. Because of
this this fixes bug #2286 which was also present in the monkey
frontend as both called nsurl_access() on the url without the NULL
check and caused an assertion.
2015-03-15 00:00:45 +00:00
Vincent Sanders
a487f7e611 Move win32 window operations into their own module
This splits up a great deal of the win32 window code out from other
gui code. It also remove large quantities of unused and junk
variables and functions.
2015-03-12 23:48:53 +00:00
Michael Drake
ac636100e8 Remove include of nsurl from corestrings.h 2015-02-26 16:58:41 +00:00
Michael Drake
cbd9d710a3 Use forward declaration instead of #include for nsurl. 2015-02-26 16:14:23 +00:00
Michael Drake
ee75f5b3ad Fix to support non-POSIX behaviour when renaming cache entries on disc. 2015-02-03 10:22:28 +00:00
Vincent Sanders
9927232a2d Improve metadata deserialisation to only update object on success
The low level cache deserialisation was leaving bad data in an low
level cache object in the error case. This fixes it so the object
state only gets modified on successful deserialisation of all the
metadata.
2015-01-28 22:39:39 +00:00
Vincent Sanders
5464dc7778 Ensure no division by zero occours if no time has ever been spent writing llcache 2015-01-03 15:13:40 +00:00
Vincent Sanders
6b645664fe add missing includes 2014-12-27 22:48:37 +00:00
Vincent Sanders
45f98ffd6e improve comments in low level cache and remove completed todo 2014-12-04 21:09:42 +00:00
Vincent Sanders
5bf4b3ff2b move the low bandwidth check to allow for an average over a much longer time 2014-12-03 20:13:10 +00:00
Vincent Sanders
57cd5c77b2 Use translated messgae for low bandwidth error 2014-12-02 10:03:27 +00:00
Vincent Sanders
c9ee49baa8 cope with backing store writeout making no progress 2014-12-01 11:32:33 +00:00
Vincent Sanders
ba5ade87b2 ensure the backing store write reports at least a minimal amount of time 2014-12-01 09:18:31 +00:00
Vincent Sanders
1c735140b6 fix resource leak on error (Coverity 1256245) 2014-11-30 11:21:34 +00:00
Vincent Sanders
61ab2777da Improve writeout rescheduling if list of objects is completed quickly 2014-11-30 00:27:05 +00:00
Vincent Sanders
d08acbc5ae correctly calculate writeout bandwidth and properly impose limits 2014-11-29 23:57:15 +00:00
Vincent Sanders
6b2676d33f Improve llcache writeout stratagy 2014-11-28 19:17:42 +00:00
Vincent Sanders
8d51dd4879 update the backing store to allow for invalidating entries which have an allocation 2014-11-27 13:31:43 +00:00
Vincent Sanders
79d5b1bf3b stop using gettimeofday and use the monotonic time interface fron nsutils 2014-11-26 21:29:13 +00:00
Vincent Sanders
81417ae4a5 caclulate the total amount of time spent writing an object out
In order to calculate the writeout bandwidth we need to know how long
it took to write the data to peristant storage in addition to how much
was written.
2014-11-25 23:11:41 +00:00
Vincent Sanders
5a78cd810f correctly release source data from llcache 2014-11-23 18:21:56 +00:00
Vincent Sanders
01b2bc5a57 Improve doxygen comments and add todo for cache and backing store 2014-11-23 15:43:03 +00:00
Vincent Sanders
246a1fec05 remove constness from backing stores store method 2014-11-23 01:37:24 +00:00
Vincent Sanders
63c35da66e annotate element struct with packing attributes to reduce entry size 2014-11-23 01:25:14 +00:00