<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-03-14)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>ccj</strong></font>
<font color='#225522'><em>(on branch rtems-4-10-branch)</em></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-03-14 Chris Johns <chrisj@rtems.org>
PR 1757/filesystem
* libfs/src/rfs/rtems-rfs-block-pos.h,
libfs/src/rfs/rtems-rfs-block.h, libfs/src/rfs/rtems-rfs-file.c,
libfs/src/rfs/rtems-rfs-rtems-file.c: Set the file size in
iop-size when a file is open. Fix lseek to end of file then write
for sizes less than half the file system block size.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2346.2.81&r2=text&tr2=1.2346.2.82&diff_format=h">M</a></td><td width='1%'>1.2346.2.82</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-block-pos.h.diff?r1=text&tr1=1.1.2.3&r2=text&tr2=1.1.2.4&diff_format=h">M</a></td><td width='1%'>1.1.2.4</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-block-pos.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-block.h.diff?r1=text&tr1=1.1.2.2&r2=text&tr2=1.1.2.3&diff_format=h">M</a></td><td width='1%'>1.1.2.3</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-block.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-file.c.diff?r1=text&tr1=1.4.2.2&r2=text&tr2=1.4.2.3&diff_format=h">M</a></td><td width='1%'>1.4.2.3</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-file.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c.diff?r1=text&tr1=1.4.2.2&r2=text&tr2=1.4.2.3&diff_format=h">M</a></td><td width='1%'>1.4.2.3</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2346.2.81 rtems/cpukit/ChangeLog:1.2346.2.82
--- rtems/cpukit/ChangeLog:1.2346.2.81 Tue Mar 8 16:14:54 2011
+++ rtems/cpukit/ChangeLog Mon Mar 14 00:07:19 2011
</font><font color='#997700'>@@ -1,3 +1,12 @@
</font><font color='#000088'>+2011-03-14 Chris Johns <chrisj@rtems.org>
+
+ PR 1757/filesystem
+ * libfs/src/rfs/rtems-rfs-block-pos.h,
+ libfs/src/rfs/rtems-rfs-block.h, libfs/src/rfs/rtems-rfs-file.c,
+ libfs/src/rfs/rtems-rfs-rtems-file.c: Set the file size in
+ iop-size when a file is open. Fix lseek to end of file then write
+ for sizes less than half the file system block size.
+<span style="background-color: #FF0000"> </span>
</font> 2011-03-08 Joel Sherrill <joel.sherrilL@OARcorp.com>
PR 1759/cpukit
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-block-pos.h:1.1.2.3 rtems/cpukit/libfs/src/rfs/rtems-rfs-block-pos.h:1.1.2.4
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-block-pos.h:1.1.2.3 Wed Jun 16 23:38:29 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-block-pos.h Mon Mar 14 00:07:18 2011
</font><font color='#997700'>@@ -193,6 +193,12 @@
</font> if ((_b)->boff) --(_b)->bno; } while (0)
/**
<font color='#000088'>+ * Do the sizes match ?
+ */
+#define rtems_rfs_block_size_equal(_lhs, _rhs) \
+ (((_lhs)->count == (_rhs)->count) && ((_lhs)->offset == (_rhs)->count))
+
+/**
</font> * Zero a block size.
*
* @param size A pointer to the block size.
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-block.h:1.1.2.2 rtems/cpukit/libfs/src/rfs/rtems-rfs-block.h:1.1.2.3
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-block.h:1.1.2.2 Wed Jun 16 23:38:29 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-block.h Mon Mar 14 00:07:18 2011
</font><font color='#997700'>@@ -163,11 +163,6 @@
</font> #define rtems_rfs_block_map_size_offset(_m) ((_m)->size.offset)
/**
<font color='#880000'>- * Set the size offset for the map.
- */
-#define rtems_rfs_block_map_set_size_offset(_m, _o) ((_m)->size.offset = (_o))
-
-/**
</font> * Are we at the last block in the map ?
*/
#define rtems_rfs_block_map_last(_m) \
<font color='#997700'>@@ -196,6 +191,33 @@
</font> #define rtems_rfs_block_map_block_offset(_m) ((_m)->bpos.boff)
/**
<font color='#000088'>+ * Set the size offset for the map. The map is tagged as dirty.
+ *
+ * @param map Pointer to the open map to set the offset in.
+ * @param offset The offset to set in the map's size.
+ */
+static inline void<span style="background-color: #FF0000"> </span>
+rtems_rfs_block_map_set_size_offset (rtems_rfs_block_map* map,
+ rtems_rfs_block_off offset)
+{
+ map->size.offset = offset;
+ map->dirty = true;
+}
+
+/**
+ * Set the map's size. The map is tagged as dirty.
+ *
+ * @param map Pointer to the open map to set the offset in.
+ * @param size The size to set in the map's size.
+ */
+static inline void<span style="background-color: #FF0000"> </span>
+rtems_rfs_block_map_set_size (rtems_rfs_block_map* map,
+ rtems_rfs_block_size* size)
+{
+ rtems_rfs_block_copy_size (&map->size, size);
+ map->dirty = true;
+}
+/**
</font> * Open a block map. The block map data in the inode is copied into the
* map. The buffer handles are opened. The block position is set to the start
* so a seek of offset 0 will return the first block.
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-file.c:1.4.2.2 rtems/cpukit/libfs/src/rfs/rtems-rfs-file.c:1.4.2.3
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-file.c:1.4.2.2 Thu Aug 26 01:35:22 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-file.c Mon Mar 14 00:07:18 2011
</font><font color='#997700'>@@ -172,8 +172,10 @@
</font> handle->shared->mtime);
rtems_rfs_inode_set_ctime (&handle->shared->inode,
handle->shared->ctime);
<font color='#880000'>- handle->shared->map.size.count = handle->shared->size.count;
- handle->shared->map.size.offset = handle->shared->size.offset;
</font><font color='#000088'>+ if (!rtems_rfs_block_size_equal (&handle->shared->size,
+ &handle->shared->map.size))
+ rtems_rfs_block_map_set_size (&handle->shared->map,
+ &handle->shared->size);
</font> }
rc = rtems_rfs_block_map_close (fs, &handle->shared->map);
<font color='#997700'>@@ -420,8 +422,8 @@
</font> * This means the file needs to set the file size to the pos only when a
* write occurs.
*/
<font color='#880000'>- if (pos <= rtems_rfs_file_shared_get_size (rtems_rfs_file_fs (handle),
- handle->shared))
</font><font color='#000088'>+ if (pos < rtems_rfs_file_shared_get_size (rtems_rfs_file_fs (handle),
+ handle->shared))
</font> rtems_rfs_file_set_bpos (handle, pos);
*new_pos = pos;
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c:1.4.2.2 rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c:1.4.2.3
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c:1.4.2.2 Mon Oct 18 17:48:55 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c Mon Mar 14 00:07:18 2011
</font><font color='#997700'>@@ -70,6 +70,7 @@
</font> if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_OPEN))
printf("rtems-rfs: file-open: handle:%p\n", file);
<font color='#000088'>+ iop->size = rtems_rfs_file_size (file);
</font> iop->file_info = file;
rtems_rfs_rtems_unlock (fs);
<font color='#997700'>@@ -195,21 +196,25 @@
</font> pos = iop->offset;
/*
<font color='#880000'>- * If the iop position is past the physical end of the file we need to set the
- * file size to the new length before writing.
</font><font color='#000088'>+ * If the iop position is past the physical end of the file we need to set
+ * the file size to the new length before writing. If the position equals the
+ * size of file we are still past the end of the file as positions number
+ * from 0. For a specific position we need a file that has a length of one
+ * more.
</font> */
<font color='#880000'>- if (pos > rtems_rfs_file_size (file))
</font><font color='#000088'>+ if (pos >= rtems_rfs_file_size (file))
</font> {
<font color='#880000'>- rc = rtems_rfs_file_set_size (file, pos);
</font><font color='#000088'>+ rc = rtems_rfs_file_set_size (file, pos + 1);
</font> if (rc)
{
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
return rtems_rfs_rtems_error ("file-write: write extend", rc);
}
<font color='#880000'>- rtems_rfs_file_set_bpos (file, pos);
</font> }
<font color='#000088'>+ rtems_rfs_file_set_bpos (file, pos);
+<span style="background-color: #FF0000"> </span>
</font> while (count)
{
size_t size = count;
</pre>
<p> </p>
<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>