Commit Graph

258 Commits

Author SHA1 Message Date
Sebastian Huber
eb93595b4c libblock: Documentation 2012-11-02 09:40:58 +01:00
Sebastian Huber
9f0a68ce5a libblock: Block device transfer request API change
Add and use rtems_blkdev_request_done().  Block device transfer requests
must signal the completion status now with rtems_blkdev_request_done().
The return value of the block device IO control will be ignored for
transfer requests.

The first parameter of rtems_blkdev_request_cb is now the transfer
request structure.

Renamed rtems_blkdev_request::req_done to rtems_blkdev_request::done to
break third party drivers at compile time, otherwise this API change
would result in runtime errors.
2012-11-02 09:40:58 +01:00
Sebastian Huber
ee82825dec libblock: Use transient event 2012-10-30 18:03:29 +01:00
Sebastian Huber
9dffa384e1 libblock: rtems_bdbuf_set_block_size() API change
The set block size must synchronize and purge the disk to avoid an
inconsistent cache state and data corruption.  The synchronization is
optional depending on the new sync parameter.  In some contexts a
synchronization must not be performed, e.g. during disk creation.
2012-10-26 22:03:22 +02:00
Sebastian Huber
48680bb176 libblock: ramdisk documentation 2012-10-26 21:30:40 +02:00
Ralf Corsépius
1c554014af Remove CVS-Ids. 2012-07-19 16:55:18 +02:00
Sebastian Huber
5b29a08d69 libblock: Fix read-ahead task wake-up
In case the read-ahead task is not configured we must not send a wake-up
event.  This would send the wake-up event to the executing task.

We must send the wake-up event only in case the request list changes
from empty to non-empty.  Since otherwise we may send a false transfer
event.
2012-07-09 10:42:08 +02:00
Sebastian Huber
2cc4f3ca45 libblock: Move read-ahead trigger check
In case the read-ahead task has a higher priority than the reading task,
this ensures that the read-ahead request is issued after the read miss
is serviced.
2012-07-03 10:25:12 +02:00
Sebastian Huber
71092f7c94 libblock: Fix read-ahead trigger and next update
The previous version was sub-optimal for read-ahead transfer counts of
one.
2012-07-02 17:03:28 +02:00
Sebastian Huber
f29d969a72 libblock: Fix read-ahead trigger and next update 2012-07-02 16:15:54 +02:00
Sebastian Huber
f12249ff05 libblock: Fix continuous blocks write request 2012-07-02 16:15:54 +02:00
Sebastian Huber
828f9462be libblock: Remove unused field 2012-07-02 16:15:54 +02:00
Sebastian Huber
9f527308d7 libblock: Add block device statistics 2012-06-12 10:12:40 +02:00
Sebastian Huber
7d4a859441 libblock: Remove const qualifier
This allows addtion of per disk statistics for example.
2012-06-12 10:12:40 +02:00
Sebastian Huber
df84ca249d libblock: Rename structure 2012-06-04 17:30:20 +02:00
Sebastian Huber
39ee704e75 libblock: Add read-ahead task
Read-ahead requests were previously executed in the context of the
reading task.  This blocks the reading task until the complete read
with read-ahead transfer is finished.  A read-ahead task is introduced
to off-load the read-ahead transfer.  This allows the reading task to
work with the requested block more quickly.  The read-ahead is triggered
after two misses of ascending consecutive blocks or a read hit of a
block read by the most-recent read-ahead transfer.  The read-ahead
feature is configurable and can be disabled.
2012-06-04 09:54:31 +02:00
Joel Sherrill
721fe34aae Fix C files which had two semi-colons at EOL 2012-05-31 15:34:36 -05:00
Sebastian Huber
f164ae751a libblock: Move rtems_bdbuf_get_media_block() call
Move rtems_bdbuf_get_media_block() call inside the bdbuf lock.
2012-05-31 11:05:48 +02:00
Sebastian Huber
73c09b3b8e libblock: Simplify disk management
Add block_count and media_blocks_per_block to rtems_disk_device.  Add
and use rtems_disk_init_phys() and rtems_disk_init_log().
2012-05-31 11:05:48 +02:00
Sebastian Huber
2c6cc3c0de libblock: Remove explicit bds_per_group parameter 2012-05-31 11:05:48 +02:00
Sebastian Huber
40284de844 libblock: Remove const qualifier from bdbuf API
This allows addtion of per disk statistics for example.
2012-05-31 11:05:48 +02:00
Sebastian Huber
b6911069d4 libblock: Add task stack size bdbuf configuration
The task stack size for the swap-out and worker tasks is now
configurable.  The bdbuf task resources are now included in the work
space size estimate.
2012-05-31 11:05:48 +02:00
Sebastian Huber
13d3a37d38 libblock: Fix read request block count calculation 2012-05-24 17:36:49 +02:00
Sebastian Huber
e7096b1fdf libblock: Fix state descriptions 2012-05-24 17:32:24 +02:00
Sebastian Huber
53da07e436 Filesystem: PR1255: Move offset update to handlers
It is now the responsibility of the read() and write() handler to update
the offset field of the IO descriptor (rtems_libio_t).  This change
makes it possible to protect the IO descriptor from concurrent access by
per file locks.
2012-05-15 10:01:42 +02:00
Sebastian Huber
3c462734ba libblock: Fix purge device tree traversal 2012-05-14 16:57:59 +02:00
Joel Sherrill
9b4422a251 Remove All CVS Id Strings Possible Using a Script
Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines
  next to each other after Id string line removed.
+ remove entire comment blocks which only exited to
  contain CVS Ids
+ If the processing left a blank line at the top of
  a file, it was removed.
2012-05-11 08:44:13 -05:00
Sebastian Huber
84ab4fce24 libblock: Add RTEMS_BLKIO_PURGEDEV 2012-05-11 13:58:43 +02:00
Sebastian Huber
30d412469c Filesystem: PR1398: Fix lseek() mechanic
According to POSIX the lseek() function shall not, by itself, extend the
size of a file.

Remove the size field of rtems_libio_t.  A file has only one size but
may have multiple open file descriptors.  Thus a file size field in the
file descriptor may lead to inconsistencies.

New default handlers rtems_filesystem_default_lseek_file() and
rtems_filesystem_default_lseek_directory().
2012-05-11 13:58:43 +02:00
Joel Sherrill
33a105fb69 Revert: Remove CVS Ids
See http://www.rtems.org/pipermail/rtems-devel/2012-May/001006.html
for details.
2012-05-07 11:08:48 -05:00
Ralf Corsépius
ee32f67a6f Remove CVS-Ids. 2012-05-04 09:36:25 +02:00
Sebastian Huber
08b9d53460 libblock: PR2040: Fix recycle destination update
Check the availablity of a recycle destination segment only when it is
necessary to avoid missing resycle source segment erasures.
2012-04-16 11:06:45 +02:00
Sebastian Huber
ac50df2304 libblock: PR2040: Add starvation threshold
Do not use the unavailable block count as the erased blocks starvation
threshold.  Use instead the block count of the largest segment.  This
improves the starvation resolution gain of available blocks.
2012-04-16 11:06:45 +02:00
Sebastian Huber
b467782b53 libblock: Add rtems_bdbuf_set_block_size()
The new function rtems_bdbuf_set_block_size() must be used to set the
block size of a disk device.  It will check if the block size is valid
and set the new fields block_to_media_block_shift and bds_per_group of
the rtems_disk_device structure.  This helps to avoid complex arithmetic
operations in the block device buffer get and read path.
2012-04-12 10:42:43 +02:00
Sebastian Huber
3d60c1b22a libblock: Change error status to fatal error
Calling the bdbuf API functions in the not configured state is now a
fatal error.
2012-04-12 10:42:43 +02:00
Sebastian Huber
462ee70f9b libblock: Use unprotected chain operations
The transfer chain is accessed by at most one thread at a time.
2012-04-12 10:42:43 +02:00
Sebastian Huber
89a84c0fa3 libblock: Use unprotected chain operations
The chains are protected by the bdbuf cache lock.
2012-04-12 10:42:42 +02:00
Sebastian Huber
5b045eb6f8 Filesystem: Change type of ioctl_return
Change the ioctl_return type of rtems_libio_ioctl_args_t to match the
ioctl() return value type.
2012-04-03 15:03:18 +02:00
Sebastian Huber
9f808d1f53 PR2040: libblock: Flash disk starvations statistic 2012-03-14 10:49:49 +01:00
Sebastian Huber
a757d0f80a PR2040: libblock: Flash disk documentation 2012-03-14 10:49:49 +01:00
Sebastian Huber
a309a7941e PR2040: libblock: Fix return status 2012-03-14 10:49:07 +01:00
Sebastian Huber
c08072ce31 PR2040: libblock: Avoid erased blocks starvation
The compaction process needs erased blocks.  It is only possible to
erase an entire segment.  Thus in order to make a progress we always
need enough erased blocks to empty a used or available segment which can
be erased in turn.  A (possibly the worst case) lower bound of erased
blocks is the block count of the largest segment.  The number of
unavailable blocks specified by the configuration will be used to
determine the erase blocks starvation situation.  The number of
unavailable blocks must be greater than or equal to the number of blocks
in the largest segment.
2012-03-14 10:48:54 +01:00
Sebastian Huber
f9fd0c203e PR2040: libblock: Track number of erased blocks 2012-03-14 10:48:39 +01:00
Sebastian Huber
12806cd02f PR2040: libblock: Use segment control as parameter 2012-03-14 10:48:17 +01:00
Sebastian Huber
3ab9c76d3f libblock: Use new API for disk media 2012-03-13 12:24:19 +01:00
Sebastian Huber
01211720ec libblock: Add generic IMFS block device nodes
New functions
 o rtems_blkdev_create(), and
 o rtems_blkdev_create_partition().

New test libtests/block11.
2012-03-13 12:24:18 +01:00
Sebastian Huber
291c926449 libblock: Split file and simplify 2012-03-13 12:24:18 +01:00
Sebastian Huber
3ee7b84394 libblock: New support functions
Add
 o rtems_disk_get_block_size(),
 o rtems_disk_get_block_begin(), and
 o rtems_disk_get_block_count().
2012-03-13 12:24:18 +01:00
Sebastian Huber
796967c3df libblock: Change bdbuf API
The functions
 o rtems_bdbuf_get(),
 o rtems_bdbuf_read(),
 o rtems_bdbuf_syncdev(), and
 o rtems_bdbuf_purge_dev(),
use now the disk device instead of the device identifier.  This makes
bdbuf independent of rtems_disk_obtain() and rtems_disk_release().  It
is the responsiblity of the file system to obtain the disk device.  This
also reduces the overhead to get a buffer.

The key for the AVL tree uses now the disk device instead of the device
identifier.  The pointer is interpreted as an unsigned integer.  This
reduces the memory overhead and makes the comparison operation a bit
faster.

Removed function rtems_bdbuf_purge_major().  This function was too
destructive and could have unpredictable side effects.
2012-03-13 12:24:18 +01:00
Sebastian Huber
1024561f19 libblock: Documentation 2012-03-13 12:24:18 +01:00