<!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-15)</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>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-03-15 Chris Johns <chrisj@rtems.org>
PR 1763/shell
* libmisc/shell/hexdump-conv.c: Remove debug hacks.
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.
* libfs/src/rfs/rtems-rfs-rtems-dev.c,
libfs/src/rfs/rtems-rfs-rtems-dir.c,
libfs/src/rfs/rtems-rfs-rtems.c, libfs/src/rfs/rtems-rfs-rtems.h:
Fix the fstat and fchmod calls due to the change in the iop struct
where pathinfo went away. The node_access field in pathinfo was
overloaded.
</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.2773&r2=text&tr2=1.2774&diff_format=h">M</a></td><td width='1%'>1.2774</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.4&r2=text&tr2=1.5&diff_format=h">M</a></td><td width='1%'>1.5</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.3&r2=text&tr2=1.4&diff_format=h">M</a></td><td width='1%'>1.4</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.6&r2=text&tr2=1.7&diff_format=h">M</a></td><td width='1%'>1.7</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-dev.c.diff?r1=text&tr1=1.4&r2=text&tr2=1.5&diff_format=h">M</a></td><td width='1%'>1.5</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.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-dir.c.diff?r1=text&tr1=1.7&r2=text&tr2=1.8&diff_format=h">M</a></td><td width='1%'>1.8</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.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.9&r2=text&tr2=1.10&diff_format=h">M</a></td><td width='1%'>1.10</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-rtems-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.h.diff?r1=text&tr1=1.4&r2=text&tr2=1.5&diff_format=h">M</a></td><td width='1%'>1.5</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-rtems.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems.c.diff?r1=text&tr1=1.15&r2=text&tr2=1.16&diff_format=h">M</a></td><td width='1%'>1.16</td><td width='100%'>cpukit/libfs/src/rfs/rtems-rfs-rtems.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libmisc/shell/hexdump-conv.c.diff?r1=text&tr1=1.4&r2=text&tr2=1.5&diff_format=h">M</a></td><td width='1%'>1.5</td><td width='100%'>cpukit/libmisc/shell/hexdump-conv.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2773 rtems/cpukit/ChangeLog:1.2774
--- rtems/cpukit/ChangeLog:1.2773 Mon Mar 14 13:17:27 2011
+++ rtems/cpukit/ChangeLog Tue Mar 15 00:02:34 2011
</font><font color='#997700'>@@ -1,3 +1,21 @@
</font><font color='#000088'>+2011-03-15 Chris Johns <chrisj@rtems.org>
+
+ PR 1763/shell
+ * libmisc/shell/hexdump-conv.c: Remove debug hacks.
+
+ 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.
+ * libfs/src/rfs/rtems-rfs-rtems-dev.c,
+ libfs/src/rfs/rtems-rfs-rtems-dir.c,
+ libfs/src/rfs/rtems-rfs-rtems.c, libfs/src/rfs/rtems-rfs-rtems.h:
+ Fix the fstat and fchmod calls due to the change in the iop struct
+ where pathinfo went away. The node_access field in pathinfo was
+ overloaded.
+
</font> 2011-03-14 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/mouse/mouse_parser.c, libmisc/mouse/serial_mouse.c: Remove
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-block-pos.h:1.4 rtems/cpukit/libfs/src/rfs/rtems-rfs-block-pos.h:1.5
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-block-pos.h:1.4 Wed Jun 16 22:09:00 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-block-pos.h Tue Mar 15 00:02:34 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.3 rtems/cpukit/libfs/src/rfs/rtems-rfs-block.h:1.4
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-block.h:1.3 Wed Jun 16 22:09:00 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-block.h Tue Mar 15 00:02:34 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.6 rtems/cpukit/libfs/src/rfs/rtems-rfs-file.c:1.7
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-file.c:1.6 Thu Aug 26 01:31:15 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-file.c Tue Mar 15 00:02:34 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-dev.c:1.4 rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c:1.5
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c:1.4 Thu Jul 1 15:18:41 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c Tue Mar 15 00:02:34 2011
</font><font color='#997700'>@@ -260,7 +260,7 @@
</font> .write_h = rtems_rfs_rtems_device_write,
.ioctl_h = rtems_rfs_rtems_device_ioctl,
.lseek_h = rtems_rfs_rtems_device_lseek,
<font color='#880000'>- .fstat_h = rtems_rfs_rtems_stat,
</font><font color='#000088'>+ .fstat_h = rtems_rfs_rtems_fstat,
</font> .fchmod_h = rtems_rfs_rtems_fchmod,
.ftruncate_h = rtems_rfs_rtems_device_ftruncate,
.fpathconf_h = rtems_filesystem_default_fpathconf,
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c:1.7 rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c:1.8
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c:1.7 Sun Oct 10 23:34:48 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c Tue Mar 15 00:02:34 2011
</font><font color='#997700'>@@ -234,7 +234,7 @@
</font> .write_h = rtems_filesystem_default_write,
.ioctl_h = rtems_filesystem_default_ioctl,
.lseek_h = rtems_rfs_rtems_dir_lseek,
<font color='#880000'>- .fstat_h = rtems_rfs_rtems_stat,
</font><font color='#000088'>+ .fstat_h = rtems_rfs_rtems_fstat,
</font> .fchmod_h = rtems_rfs_rtems_fchmod,
.ftruncate_h = rtems_filesystem_default_ftruncate,
.fpathconf_h = rtems_filesystem_default_fpathconf,
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c:1.9 rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c:1.10
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c:1.9 Mon Oct 18 17:39:35 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c Tue Mar 15 00:02:34 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->pathinfo.node_access = file;
rtems_rfs_rtems_unlock (fs);
<font color='#997700'>@@ -111,7 +112,7 @@
</font> * @param count
* @return int
*/
<font color='#880000'>-ssize_t
</font><font color='#000088'>+static ssize_t
</font> rtems_rfs_rtems_file_read (rtems_libio_t* iop,
void* buffer,
size_t count)
<font color='#997700'>@@ -176,7 +177,7 @@
</font> * @param count
* @return ssize_t
*/
<font color='#880000'>-ssize_t
</font><font color='#000088'>+static ssize_t
</font> rtems_rfs_rtems_file_write (rtems_libio_t* iop,
const void* buffer,
size_t count)
<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;
<font color='#997700'>@@ -255,7 +260,7 @@
</font> * @param buffer
*/
<font color='#880000'>-int
</font><font color='#000088'>+static int
</font> rtems_rfs_rtems_file_ioctl (rtems_libio_t* iop, uint32_t command, void* buffer)
{
return 0;
<font color='#997700'>@@ -269,7 +274,7 @@
</font> * @param whence
* @return rtems_off64_t
*/
<font color='#880000'>-rtems_off64_t
</font><font color='#000088'>+static rtems_off64_t
</font> rtems_rfs_rtems_file_lseek (rtems_libio_t* iop,
rtems_off64_t offset,
int whence)
<font color='#997700'>@@ -298,13 +303,69 @@
</font> }
/**
<font color='#000088'>+ * Stat the file.
+ *
+ * @param iop
+ * @param buf
+ * @return int
+ */
+static int
+rtems_rfs_rtems_file_fstat (rtems_filesystem_location_info_t* pathloc,
+ struct stat* buf)
+{
+ rtems_rfs_file_handle* file = pathloc->node_access;
+ int rc;
+
+ if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_STAT))
+ printf ("rtems-rfs: file-fstat: handle:%p\n", file);
+
+ rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
+
+ rc = rtems_rfs_rtems_stat_inode (rtems_rfs_file_fs (file),
+ rtems_rfs_file_inode (file),
+ buf);
+
+ rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
+
+ return rc;
+}
+
+/**
+ * File change mode routine.
+ *
+ * @param iop
+ * @param mode
+ * @return int
+ */
+static int
+rtems_rfs_rtems_file_fchmod (rtems_filesystem_location_info_t* pathloc,
+ mode_t mode)
+{
+ rtems_rfs_file_handle* file = pathloc->node_access;
+ int rc;
+
+ if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FCHMOD))
+ printf ("rtems-rfs: file-fchmod: handle:%p\n", file);
+
+ rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
+
+ rc = rtems_rfs_rtems_fchmod_inode (rtems_rfs_file_fs (file),
+ rtems_rfs_file_inode (file),
+ mode);
+
+ rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
+
+ return rc;
+}
+
+/**
</font> * This routine processes the ftruncate() system call.
*
* @param iop
* @param length
* @return int
*/
<font color='#880000'>-int
</font><font color='#000088'>+static int
</font> rtems_rfs_rtems_file_ftruncate (rtems_libio_t* iop,
rtems_off64_t length)
{
<font color='#997700'>@@ -338,8 +399,8 @@
</font> .write_h = rtems_rfs_rtems_file_write,
.ioctl_h = rtems_rfs_rtems_file_ioctl,
.lseek_h = rtems_rfs_rtems_file_lseek,
<font color='#880000'>- .fstat_h = rtems_rfs_rtems_stat,
- .fchmod_h = rtems_rfs_rtems_fchmod,
</font><font color='#000088'>+ .fstat_h = rtems_rfs_rtems_file_fstat,
+ .fchmod_h = rtems_rfs_rtems_file_fchmod,
</font> .ftruncate_h = rtems_rfs_rtems_file_ftruncate,
.fpathconf_h = rtems_filesystem_default_fpathconf,
.fsync_h = rtems_rfs_rtems_fdatasync,
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems.h:1.4 rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems.h:1.5
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems.h:1.4 Wed Aug 25 04:37:49 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems.h Tue Mar 15 00:02:34 2011
</font><font color='#997700'>@@ -274,20 +274,46 @@
</font> /**
* The following routine does a stat on a node.
*
<font color='#880000'>- * @param pathloc
</font><font color='#000088'>+ * @param fs The file system data.
+ * @param inode The inode to stat held in memory.
+ * @param buf The stat buffer to fill.
+ * @return int The result code.
+ */
+int rtems_rfs_rtems_stat_inode (rtems_rfs_file_system* fs,
+ rtems_rfs_inode_handle* inode,
+ struct stat* buf);
+
+/**
+ * The following routine does a stat on a node.
+ *
+ * @param iop
</font> * @param buf
* @return int
*/
<font color='#880000'>-int rtems_rfs_rtems_stat (rtems_filesystem_location_info_t* loc, struct stat* buf);
</font><font color='#000088'>+int rtems_rfs_rtems_fstat (rtems_filesystem_location_info_t* pathloc,
+ struct stat* buf);
+
+/**
+ * File change mode routine changes an inode.
+ *
+ * @param fs The file system data.
+ * @param inode The inode to change held in memory.
+ * @param buf The new mode.
+ * @return int The result code.
+ */
+int rtems_rfs_rtems_fchmod_inode (rtems_rfs_file_system* fs,
+ rtems_rfs_inode_handle* inode,
+ mode_t mode);
</font>
/**
* File change mode routine.
*
<font color='#880000'>- * @param pathloc
</font><font color='#000088'>+ * @param iop
</font> * @param mode
* @return int
*/
<font color='#880000'>-int rtems_rfs_rtems_fchmod (rtems_filesystem_location_info_t* loc, mode_t mode);
</font><font color='#000088'>+int rtems_rfs_rtems_fchmod (rtems_filesystem_location_info_t* pathloc,
+ mode_t mode);
</font>
/**
* Routine to remove a node from the RFS file system.
<font color='#006600'>diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems.c:1.15 rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems.c:1.16
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems.c:1.15 Mon Feb 7 16:41:37 2011
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems.c Tue Mar 15 00:02:34 2011
</font><font color='#997700'>@@ -65,7 +65,7 @@
</font> * @param flags
* @param pathloc
*/
<font color='#880000'>-int
</font><font color='#000088'>+static int
</font> rtems_rfs_rtems_eval_path (const char* path,
size_t pathlen,
int flags,
<font color='#997700'>@@ -246,7 +246,7 @@
</font> * @param name
* @return int
*/
<font color='#880000'>-int
</font><font color='#000088'>+static int
</font> rtems_rfs_rtems_eval_for_make (const char* path,
rtems_filesystem_location_info_t* pathloc,
const char** name)
<font color='#997700'>@@ -481,7 +481,7 @@
</font> * @param name
* @return int
*/
<font color='#880000'>-int
</font><font color='#000088'>+static int
</font> rtems_rfs_rtems_link (rtems_filesystem_location_info_t* to_loc,
rtems_filesystem_location_info_t* parent_loc,
const char* name)
<font color='#997700'>@@ -517,7 +517,7 @@
</font> * @return int
*/
<font color='#880000'>-int
</font><font color='#000088'>+static int
</font> rtems_rfs_rtems_unlink (rtems_filesystem_location_info_t* parent_loc,
rtems_filesystem_location_info_t* loc)
{
<font color='#997700'>@@ -553,7 +553,7 @@
</font> * @return rtems_filesystem_node_types_t
*/
<font color='#880000'>-rtems_filesystem_node_types_t
</font><font color='#000088'>+static rtems_filesystem_node_types_t
</font> rtems_rfs_rtems_node_type (rtems_filesystem_location_info_t* pathloc)
{
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
<font color='#997700'>@@ -677,7 +677,7 @@
</font> * return int
*/
<font color='#880000'>-int
</font><font color='#000088'>+static int
</font> rtems_rfs_rtems_utime(rtems_filesystem_location_info_t* pathloc,
time_t atime,
time_t mtime)
<font color='#997700'>@@ -721,7 +721,7 @@
</font> * return int
*/
<font color='#880000'>-int
</font><font color='#000088'>+static int
</font> rtems_rfs_rtems_symlink (rtems_filesystem_location_info_t* parent_loc,
const char* link_name,
const char* node_name)
<font color='#997700'>@@ -765,7 +765,7 @@
</font> * @return int
*/
<font color='#880000'>-ssize_t
</font><font color='#000088'>+static ssize_t
</font> rtems_rfs_rtems_readlink (rtems_filesystem_location_info_t* pathloc,
char* buf,
size_t bufsize)
<font color='#997700'>@@ -792,13 +792,40 @@
</font> return (int) length;
}
<font color='#880000'>-/**
- * File change mode routine.
- *
- * @param pathloc
- * @param mode
- * @return int
- */
</font><font color='#000088'>+int
+rtems_rfs_rtems_fchmod_inode (rtems_rfs_file_system* fs,
+ rtems_rfs_inode_handle* inode,
+ mode_t mode)
+{
+ uint16_t imode;
+#if defined (RTEMS_POSIX_API)
+ uid_t uid;
+#endif
+
+ if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FCHMOD))
+ printf ("rtems-rfs-rtems: fchmod indo: in: ino:%" PRId32 " mode:%06" PRIomode_t "\n",
+ rtems_rfs_inode_ino (inode), mode);
+<span style="background-color: #FF0000"> </span>
+ imode = rtems_rfs_inode_get_mode (inode);
+<span style="background-color: #FF0000"> </span>
+ /*
+ * Verify I am the owner of the node or the super user.
+ */
+#if defined (RTEMS_POSIX_API)
+ uid = geteuid();
+
+ if ((uid != rtems_rfs_inode_get_uid (inode)) && (uid != 0))
+ return EPERM;
+#endif
+
+ imode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX);
+ imode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX);
+
+ rtems_rfs_inode_set_mode (inode, imode);
+<span style="background-color: #FF0000"> </span>
+ return 0;
+}
+
</font> int
rtems_rfs_rtems_fchmod (rtems_filesystem_location_info_t* pathloc,
mode_t mode)
<font color='#997700'>@@ -806,10 +833,6 @@
</font> rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
rtems_rfs_ino ino = rtems_rfs_rtems_get_pathloc_ino (pathloc);
rtems_rfs_inode_handle inode;
<font color='#880000'>- uint16_t imode;
-#if defined (RTEMS_POSIX_API)
- uid_t uid;
-#endif
</font> int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FCHMOD))
<font color='#997700'>@@ -825,26 +848,13 @@
</font> return rtems_rfs_rtems_error ("fchmod: opening inode", rc);
}
<font color='#880000'>- imode = rtems_rfs_inode_get_mode (&inode);
-<span style="background-color: #FF0000"> </span>
- /*
- * Verify I am the owner of the node or the super user.
- */
-#if defined (RTEMS_POSIX_API)
- uid = geteuid();
-
- if ((uid != rtems_rfs_inode_get_uid (&inode)) && (uid != 0))
</font><font color='#000088'>+ rc = rtems_rfs_rtems_fchmod_inode (fs, &inode, mode);
+ if (rc > 0)
</font> {
rtems_rfs_inode_close (fs, &inode);
rtems_rfs_rtems_unlock (fs);
<font color='#880000'>- return rtems_rfs_rtems_error ("fchmod: not owner", EPERM);
</font><font color='#000088'>+ return rtems_rfs_rtems_error ("fchmod: fchmod inode", EPERM);
</font> }
<font color='#880000'>-#endif
-
- imode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX);
- imode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX);
-
- rtems_rfs_inode_set_mode (&inode, imode);
</font>
rc = rtems_rfs_inode_close (fs, &inode);
if (rc > 0)
<font color='#997700'>@@ -858,58 +868,39 @@
</font> return 0;
}
<font color='#880000'>-/**
- * The following routine does a stat on a node.
- *
- * @param pathloc
- * @param buf
- * @return int
- */
-
</font> int
<font color='#880000'>-rtems_rfs_rtems_stat (rtems_filesystem_location_info_t* pathloc,
- struct stat* buf)
</font><font color='#000088'>+rtems_rfs_rtems_stat_inode (rtems_rfs_file_system* fs,
+ rtems_rfs_inode_handle* inode,
+ struct stat* buf)
</font> {
<font color='#880000'>- rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
- rtems_rfs_ino ino = rtems_rfs_rtems_get_pathloc_ino (pathloc);
- rtems_rfs_inode_handle inode;
- rtems_rfs_file_shared* shared;
- uint16_t mode;
- int rc;
</font><font color='#000088'>+ rtems_rfs_file_shared* shared;
+ uint16_t mode;
</font>
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_STAT))
<font color='#880000'>- printf ("rtems-rfs-rtems: stat: in: ino:%" PRId32 "\n", ino);
-
- rtems_rfs_rtems_lock (fs);
-<span style="background-color: #FF0000"> </span>
- rc = rtems_rfs_inode_open (fs, ino, &inode, true);
- if (rc)
- {
- rtems_rfs_rtems_unlock (fs);
- return rtems_rfs_rtems_error ("stat: opening inode", rc);
- }
</font><font color='#000088'>+ printf ("rtems-rfs-rtems: stat-inode: in: ino:%" PRId32 "\n",
+ rtems_rfs_inode_ino (inode));
</font>
<font color='#880000'>- mode = rtems_rfs_inode_get_mode (&inode);
</font><font color='#000088'>+ mode = rtems_rfs_inode_get_mode (inode);
</font>
if (RTEMS_RFS_S_ISCHR (mode) || RTEMS_RFS_S_ISBLK (mode))
{
buf->st_rdev =<span style="background-color: #FF0000"> </span>
<font color='#880000'>- rtems_filesystem_make_dev_t (rtems_rfs_inode_get_block (&inode, 0),
- rtems_rfs_inode_get_block (&inode, 1));
</font><font color='#000088'>+ rtems_filesystem_make_dev_t (rtems_rfs_inode_get_block (inode, 0),
+ rtems_rfs_inode_get_block (inode, 1));
</font> }
buf->st_dev = rtems_rfs_fs_device (fs);
<font color='#880000'>- buf->st_ino = ino;
</font><font color='#000088'>+ buf->st_ino = rtems_rfs_inode_ino (inode);
</font> buf->st_mode = rtems_rfs_rtems_mode (mode);
<font color='#880000'>- buf->st_nlink = rtems_rfs_inode_get_links (&inode);
- buf->st_uid = rtems_rfs_inode_get_uid (&inode);
- buf->st_gid = rtems_rfs_inode_get_gid (&inode);
</font><font color='#000088'>+ buf->st_nlink = rtems_rfs_inode_get_links (inode);
+ buf->st_uid = rtems_rfs_inode_get_uid (inode);
+ buf->st_gid = rtems_rfs_inode_get_gid (inode);
</font>
/*
* Need to check is the ino is an open file. If so we take the values from
* the open file rather than the inode.
*/
<font color='#880000'>- shared = rtems_rfs_file_get_shared (fs, ino);
</font><font color='#000088'>+ shared = rtems_rfs_file_get_shared (fs, rtems_rfs_inode_ino (inode));
</font>
if (shared)
{
<font color='#997700'>@@ -925,19 +916,50 @@
</font> }
else
{
<font color='#880000'>- buf->st_atime = rtems_rfs_inode_get_atime (&inode);
- buf->st_mtime = rtems_rfs_inode_get_mtime (&inode);
- buf->st_ctime = rtems_rfs_inode_get_ctime (&inode);
- buf->st_blocks = rtems_rfs_inode_get_block_count (&inode);
</font><font color='#000088'>+ buf->st_atime = rtems_rfs_inode_get_atime (inode);
+ buf->st_mtime = rtems_rfs_inode_get_mtime (inode);
+ buf->st_ctime = rtems_rfs_inode_get_ctime (inode);
+ buf->st_blocks = rtems_rfs_inode_get_block_count (inode);
</font>
if (S_ISLNK (buf->st_mode))
<font color='#880000'>- buf->st_size = rtems_rfs_inode_get_block_offset (&inode);
</font><font color='#000088'>+ buf->st_size = rtems_rfs_inode_get_block_offset (inode);
</font> else
<font color='#880000'>- buf->st_size = rtems_rfs_inode_get_size (fs, &inode);
</font><font color='#000088'>+ buf->st_size = rtems_rfs_inode_get_size (fs, inode);
</font> }
buf->st_blksize = rtems_rfs_fs_block_size (fs);
<font color='#000088'>+ return 0;
+}
+
+int
+rtems_rfs_rtems_fstat (rtems_filesystem_location_info_t* pathloc,
+ struct stat* buf)
+{
+ rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
+ rtems_rfs_ino ino = rtems_rfs_rtems_get_pathloc_ino (pathloc);
+ rtems_rfs_inode_handle inode;
+ int rc;
+
+ if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_STAT))
+ printf ("rtems-rfs-rtems: stat: in: ino:%" PRId32 "\n", ino);
+
+ rtems_rfs_rtems_lock (fs);
+<span style="background-color: #FF0000"> </span>
+ rc = rtems_rfs_inode_open (fs, ino, &inode, true);
+ if (rc)
+ {
+ rtems_rfs_rtems_unlock (fs);
+ return rtems_rfs_rtems_error ("stat: opening inode", rc);
+ }
+
+ rc = rtems_rfs_rtems_stat_inode (fs, &inode, buf);
+ if (rc > 0)
+ {
+ rtems_rfs_rtems_unlock (fs);
+ return rtems_rfs_rtems_error ("stat: stat'ing the inode", rc);
+ }
+
</font> rc = rtems_rfs_inode_close (fs, &inode);
if (rc > 0)
{
<font color='#997700'>@@ -959,7 +981,7 @@
</font> * @return int
*/
<font color='#880000'>-int
</font><font color='#000088'>+static int
</font> rtems_rfs_rtems_mknod (const char *name,
mode_t mode,
dev_t dev,
<font color='#997700'>@@ -1090,7 +1112,7 @@
</font> * @param new_name The new name.
* @return int<span style="background-color: #FF0000"> </span>
*/
<font color='#880000'>-int
</font><font color='#000088'>+static int
</font> rtems_rfs_rtems_rename(rtems_filesystem_location_info_t* old_parent_loc,
rtems_filesystem_location_info_t* old_loc,
rtems_filesystem_location_info_t* new_parent_loc,
<font color='#997700'>@@ -1150,7 +1172,7 @@
</font> * @param sb
* @return int
*/
<font color='#880000'>-int
</font><font color='#000088'>+static int
</font> rtems_rfs_rtems_statvfs (rtems_filesystem_location_info_t* pathloc,
struct statvfs* sb)
{
<font color='#997700'>@@ -1186,7 +1208,7 @@
</font> .write_h = rtems_filesystem_default_write,
.ioctl_h = rtems_filesystem_default_ioctl,
.lseek_h = rtems_filesystem_default_lseek,
<font color='#880000'>- .fstat_h = rtems_rfs_rtems_stat,
</font><font color='#000088'>+ .fstat_h = rtems_rfs_rtems_fstat,
</font> .fchmod_h = rtems_filesystem_default_fchmod,
.ftruncate_h = rtems_filesystem_default_ftruncate,
.fpathconf_h = rtems_filesystem_default_fpathconf,
<font color='#006600'>diff -u rtems/cpukit/libmisc/shell/hexdump-conv.c:1.4 rtems/cpukit/libmisc/shell/hexdump-conv.c:1.5
--- rtems/cpukit/libmisc/shell/hexdump-conv.c:1.4 Fri Mar 26 12:18:43 2010
+++ rtems/cpukit/libmisc/shell/hexdump-conv.c Tue Mar 15 00:02:34 2011
</font><font color='#997700'>@@ -63,8 +63,6 @@
</font> int converr, pad, width;
char peekbuf[MB_LEN_MAX];
<font color='#880000'>- printf("MB_LEN_MAX=%i\n", MB_LEN_MAX);
- return;
</font> if (pr->mbleft > 0) {
str = "**";
pr->mbleft--;
</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>