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.
This commit is contained in:
Chris Johns
2011-03-15 05:02:34 +00:00
parent 03b50961d8
commit d0fcd0b8a6
10 changed files with 263 additions and 108 deletions
+18
View File
@@ -1,3 +1,21 @@
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.
2011-03-14 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/mouse/mouse_parser.c, libmisc/mouse/serial_mouse.c: Remove
@@ -192,6 +192,12 @@ typedef struct rtems_rfs_block_size_s
(_b)->block = 0; \
if ((_b)->boff) --(_b)->bno; } while (0)
/**
* Do the sizes match ?
*/
#define rtems_rfs_block_size_equal(_lhs, _rhs) \
(((_lhs)->count == (_rhs)->count) && ((_lhs)->offset == (_rhs)->count))
/**
* Zero a block size.
*
+27 -5
View File
@@ -162,11 +162,6 @@ typedef struct rtems_rfs_block_map_s
*/
#define rtems_rfs_block_map_size_offset(_m) ((_m)->size.offset)
/**
* Set the size offset for the map.
*/
#define rtems_rfs_block_map_set_size_offset(_m, _o) ((_m)->size.offset = (_o))
/**
* Are we at the last block in the map ?
*/
@@ -195,6 +190,33 @@ typedef struct rtems_rfs_block_map_s
*/
#define rtems_rfs_block_map_block_offset(_m) ((_m)->bpos.boff)
/**
* 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
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
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;
}
/**
* 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
+6 -4
View File
@@ -172,8 +172,10 @@ rtems_rfs_file_close (rtems_rfs_file_system* fs,
handle->shared->mtime);
rtems_rfs_inode_set_ctime (&handle->shared->inode,
handle->shared->ctime);
handle->shared->map.size.count = handle->shared->size.count;
handle->shared->map.size.offset = handle->shared->size.offset;
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);
}
rc = rtems_rfs_block_map_close (fs, &handle->shared->map);
@@ -420,8 +422,8 @@ rtems_rfs_file_seek (rtems_rfs_file_handle* handle,
* This means the file needs to set the file size to the pos only when a
* write occurs.
*/
if (pos <= rtems_rfs_file_shared_get_size (rtems_rfs_file_fs (handle),
handle->shared))
if (pos < rtems_rfs_file_shared_get_size (rtems_rfs_file_fs (handle),
handle->shared))
rtems_rfs_file_set_bpos (handle, pos);
*new_pos = pos;
+1 -1
View File
@@ -260,7 +260,7 @@ const rtems_filesystem_file_handlers_r rtems_rfs_rtems_device_handlers = {
.write_h = rtems_rfs_rtems_device_write,
.ioctl_h = rtems_rfs_rtems_device_ioctl,
.lseek_h = rtems_rfs_rtems_device_lseek,
.fstat_h = rtems_rfs_rtems_stat,
.fstat_h = rtems_rfs_rtems_fstat,
.fchmod_h = rtems_rfs_rtems_fchmod,
.ftruncate_h = rtems_rfs_rtems_device_ftruncate,
.fpathconf_h = rtems_filesystem_default_fpathconf,
+1 -1
View File
@@ -234,7 +234,7 @@ const rtems_filesystem_file_handlers_r rtems_rfs_rtems_dir_handlers = {
.write_h = rtems_filesystem_default_write,
.ioctl_h = rtems_filesystem_default_ioctl,
.lseek_h = rtems_rfs_rtems_dir_lseek,
.fstat_h = rtems_rfs_rtems_stat,
.fstat_h = rtems_rfs_rtems_fstat,
.fchmod_h = rtems_rfs_rtems_fchmod,
.ftruncate_h = rtems_filesystem_default_ftruncate,
.fpathconf_h = rtems_filesystem_default_fpathconf,
+73 -12
View File
@@ -70,6 +70,7 @@ rtems_rfs_rtems_file_open (rtems_libio_t* iop,
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_OPEN))
printf("rtems-rfs: file-open: handle:%p\n", file);
iop->size = rtems_rfs_file_size (file);
iop->pathinfo.node_access = file;
rtems_rfs_rtems_unlock (fs);
@@ -111,7 +112,7 @@ rtems_rfs_rtems_file_close (rtems_libio_t* iop)
* @param count
* @return int
*/
ssize_t
static ssize_t
rtems_rfs_rtems_file_read (rtems_libio_t* iop,
void* buffer,
size_t count)
@@ -176,7 +177,7 @@ rtems_rfs_rtems_file_read (rtems_libio_t* iop,
* @param count
* @return ssize_t
*/
ssize_t
static ssize_t
rtems_rfs_rtems_file_write (rtems_libio_t* iop,
const void* buffer,
size_t count)
@@ -195,21 +196,25 @@ rtems_rfs_rtems_file_write (rtems_libio_t* iop,
pos = iop->offset;
/*
* 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 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.
*/
if (pos > rtems_rfs_file_size (file))
if (pos >= rtems_rfs_file_size (file))
{
rc = rtems_rfs_file_set_size (file, pos);
rc = rtems_rfs_file_set_size (file, pos + 1);
if (rc)
{
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
return rtems_rfs_rtems_error ("file-write: write extend", rc);
}
rtems_rfs_file_set_bpos (file, pos);
}
rtems_rfs_file_set_bpos (file, pos);
while (count)
{
size_t size = count;
@@ -255,7 +260,7 @@ rtems_rfs_rtems_file_write (rtems_libio_t* iop,
* @param buffer
*/
int
static int
rtems_rfs_rtems_file_ioctl (rtems_libio_t* iop, uint32_t command, void* buffer)
{
return 0;
@@ -269,7 +274,7 @@ rtems_rfs_rtems_file_ioctl (rtems_libio_t* iop, uint32_t command, void* buffer)
* @param whence
* @return rtems_off64_t
*/
rtems_off64_t
static rtems_off64_t
rtems_rfs_rtems_file_lseek (rtems_libio_t* iop,
rtems_off64_t offset,
int whence)
@@ -297,6 +302,62 @@ rtems_rfs_rtems_file_lseek (rtems_libio_t* iop,
return iop->offset;
}
/**
* 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;
}
/**
* This routine processes the ftruncate() system call.
*
@@ -304,7 +365,7 @@ rtems_rfs_rtems_file_lseek (rtems_libio_t* iop,
* @param length
* @return int
*/
int
static int
rtems_rfs_rtems_file_ftruncate (rtems_libio_t* iop,
rtems_off64_t length)
{
@@ -338,8 +399,8 @@ const rtems_filesystem_file_handlers_r rtems_rfs_rtems_file_handlers = {
.write_h = rtems_rfs_rtems_file_write,
.ioctl_h = rtems_rfs_rtems_file_ioctl,
.lseek_h = rtems_rfs_rtems_file_lseek,
.fstat_h = rtems_rfs_rtems_stat,
.fchmod_h = rtems_rfs_rtems_fchmod,
.fstat_h = rtems_rfs_rtems_file_fstat,
.fchmod_h = rtems_rfs_rtems_file_fchmod,
.ftruncate_h = rtems_rfs_rtems_file_ftruncate,
.fpathconf_h = rtems_filesystem_default_fpathconf,
.fsync_h = rtems_rfs_rtems_fdatasync,
+101 -79
View File
@@ -65,7 +65,7 @@
* @param flags
* @param pathloc
*/
int
static int
rtems_rfs_rtems_eval_path (const char* path,
size_t pathlen,
int flags,
@@ -246,7 +246,7 @@ rtems_rfs_rtems_eval_path (const char* path,
* @param name
* @return int
*/
int
static int
rtems_rfs_rtems_eval_for_make (const char* path,
rtems_filesystem_location_info_t* pathloc,
const char** name)
@@ -481,7 +481,7 @@ rtems_rfs_rtems_eval_for_make (const char* path,
* @param name
* @return int
*/
int
static int
rtems_rfs_rtems_link (rtems_filesystem_location_info_t* to_loc,
rtems_filesystem_location_info_t* parent_loc,
const char* name)
@@ -517,7 +517,7 @@ rtems_rfs_rtems_link (rtems_filesystem_location_info_t* to_loc,
* @return int
*/
int
static int
rtems_rfs_rtems_unlink (rtems_filesystem_location_info_t* parent_loc,
rtems_filesystem_location_info_t* loc)
{
@@ -553,7 +553,7 @@ rtems_rfs_rtems_unlink (rtems_filesystem_location_info_t* parent_loc,
* @return rtems_filesystem_node_types_t
*/
rtems_filesystem_node_types_t
static rtems_filesystem_node_types_t
rtems_rfs_rtems_node_type (rtems_filesystem_location_info_t* pathloc)
{
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
@@ -677,7 +677,7 @@ rtems_rfs_rtems_chown (rtems_filesystem_location_info_t *pathloc,
* return int
*/
int
static int
rtems_rfs_rtems_utime(rtems_filesystem_location_info_t* pathloc,
time_t atime,
time_t mtime)
@@ -721,7 +721,7 @@ rtems_rfs_rtems_utime(rtems_filesystem_location_info_t* pathloc,
* return int
*/
int
static int
rtems_rfs_rtems_symlink (rtems_filesystem_location_info_t* parent_loc,
const char* link_name,
const char* node_name)
@@ -765,7 +765,7 @@ rtems_rfs_rtems_symlink (rtems_filesystem_location_info_t* parent_loc,
* @return int
*/
ssize_t
static ssize_t
rtems_rfs_rtems_readlink (rtems_filesystem_location_info_t* pathloc,
char* buf,
size_t bufsize)
@@ -792,13 +792,40 @@ rtems_rfs_rtems_readlink (rtems_filesystem_location_info_t* pathloc,
return (int) length;
}
/**
* File change mode routine.
*
* @param pathloc
* @param mode
* @return int
*/
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);
imode = rtems_rfs_inode_get_mode (inode);
/*
* 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);
return 0;
}
int
rtems_rfs_rtems_fchmod (rtems_filesystem_location_info_t* pathloc,
mode_t mode)
@@ -806,10 +833,6 @@ rtems_rfs_rtems_fchmod (rtems_filesystem_location_info_t* pathloc,
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;
uint16_t imode;
#if defined (RTEMS_POSIX_API)
uid_t uid;
#endif
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FCHMOD))
@@ -825,26 +848,13 @@ rtems_rfs_rtems_fchmod (rtems_filesystem_location_info_t* pathloc,
return rtems_rfs_rtems_error ("fchmod: opening inode", rc);
}
imode = rtems_rfs_inode_get_mode (&inode);
/*
* 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))
rc = rtems_rfs_rtems_fchmod_inode (fs, &inode, mode);
if (rc > 0)
{
rtems_rfs_inode_close (fs, &inode);
rtems_rfs_rtems_unlock (fs);
return rtems_rfs_rtems_error ("fchmod: not owner", EPERM);
return rtems_rfs_rtems_error ("fchmod: fchmod inode", 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);
rc = rtems_rfs_inode_close (fs, &inode);
if (rc > 0)
@@ -858,58 +868,39 @@ rtems_rfs_rtems_fchmod (rtems_filesystem_location_info_t* pathloc,
return 0;
}
/**
* The following routine does a stat on a node.
*
* @param pathloc
* @param buf
* @return int
*/
int
rtems_rfs_rtems_stat (rtems_filesystem_location_info_t* pathloc,
struct stat* buf)
rtems_rfs_rtems_stat_inode (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* inode,
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;
rtems_rfs_file_shared* shared;
uint16_t mode;
int rc;
rtems_rfs_file_shared* shared;
uint16_t mode;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_STAT))
printf ("rtems-rfs-rtems: stat: in: ino:%" PRId32 "\n", ino);
printf ("rtems-rfs-rtems: stat-inode: in: ino:%" PRId32 "\n",
rtems_rfs_inode_ino (inode));
rtems_rfs_rtems_lock (fs);
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);
}
mode = rtems_rfs_inode_get_mode (&inode);
mode = rtems_rfs_inode_get_mode (inode);
if (RTEMS_RFS_S_ISCHR (mode) || RTEMS_RFS_S_ISBLK (mode))
{
buf->st_rdev =
rtems_filesystem_make_dev_t (rtems_rfs_inode_get_block (&inode, 0),
rtems_rfs_inode_get_block (&inode, 1));
rtems_filesystem_make_dev_t (rtems_rfs_inode_get_block (inode, 0),
rtems_rfs_inode_get_block (inode, 1));
}
buf->st_dev = rtems_rfs_fs_device (fs);
buf->st_ino = ino;
buf->st_ino = rtems_rfs_inode_ino (inode);
buf->st_mode = rtems_rfs_rtems_mode (mode);
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);
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);
/*
* Need to check is the ino is an open file. If so we take the values from
* the open file rather than the inode.
*/
shared = rtems_rfs_file_get_shared (fs, ino);
shared = rtems_rfs_file_get_shared (fs, rtems_rfs_inode_ino (inode));
if (shared)
{
@@ -925,19 +916,50 @@ rtems_rfs_rtems_stat (rtems_filesystem_location_info_t* pathloc,
}
else
{
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);
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);
if (S_ISLNK (buf->st_mode))
buf->st_size = rtems_rfs_inode_get_block_offset (&inode);
buf->st_size = rtems_rfs_inode_get_block_offset (inode);
else
buf->st_size = rtems_rfs_inode_get_size (fs, &inode);
buf->st_size = rtems_rfs_inode_get_size (fs, inode);
}
buf->st_blksize = rtems_rfs_fs_block_size (fs);
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);
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);
}
rc = rtems_rfs_inode_close (fs, &inode);
if (rc > 0)
{
@@ -959,7 +981,7 @@ rtems_rfs_rtems_stat (rtems_filesystem_location_info_t* pathloc,
* @return int
*/
int
static int
rtems_rfs_rtems_mknod (const char *name,
mode_t mode,
dev_t dev,
@@ -1090,7 +1112,7 @@ rtems_rfs_rtems_fdatasync (rtems_libio_t* iop)
* @param new_name The new name.
* @return int
*/
int
static int
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,
@@ -1150,7 +1172,7 @@ rtems_rfs_rtems_rename(rtems_filesystem_location_info_t* old_parent_loc,
* @param sb
* @return int
*/
int
static int
rtems_rfs_rtems_statvfs (rtems_filesystem_location_info_t* pathloc,
struct statvfs* sb)
{
@@ -1186,7 +1208,7 @@ const rtems_filesystem_file_handlers_r rtems_rfs_rtems_link_handlers =
.write_h = rtems_filesystem_default_write,
.ioctl_h = rtems_filesystem_default_ioctl,
.lseek_h = rtems_filesystem_default_lseek,
.fstat_h = rtems_rfs_rtems_stat,
.fstat_h = rtems_rfs_rtems_fstat,
.fchmod_h = rtems_filesystem_default_fchmod,
.ftruncate_h = rtems_filesystem_default_ftruncate,
.fpathconf_h = rtems_filesystem_default_fpathconf,
+30 -4
View File
@@ -274,20 +274,46 @@ extern const rtems_filesystem_file_handlers_r rtems_rfs_rtems_file_handlers;
/**
* The following routine does a stat on a node.
*
* @param pathloc
* @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
* @param buf
* @return int
*/
int rtems_rfs_rtems_stat (rtems_filesystem_location_info_t* loc, struct stat* buf);
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);
/**
* File change mode routine.
*
* @param pathloc
* @param iop
* @param mode
* @return int
*/
int rtems_rfs_rtems_fchmod (rtems_filesystem_location_info_t* loc, mode_t mode);
int rtems_rfs_rtems_fchmod (rtems_filesystem_location_info_t* pathloc,
mode_t mode);
/**
* Routine to remove a node from the RFS file system.
-2
View File
@@ -63,8 +63,6 @@ conv_c(rtems_shell_hexdump_globals* globals, PR *pr, u_char *p, size_t bufsize)
int converr, pad, width;
char peekbuf[MB_LEN_MAX];
printf("MB_LEN_MAX=%i\n", MB_LEN_MAX);
return;
if (pr->mbleft > 0) {
str = "**";
pr->mbleft--;