Exemplo n.º 1
0
static int IMFS_stat_directory(
  const rtems_filesystem_location_info_t *loc,
  struct stat *buf
)
{
  const IMFS_jnode_t *node = loc->node_access;

  buf->st_size = IMFS_directory_size( node );

  return IMFS_stat( loc, buf );
}
Exemplo n.º 2
0
static int i2c_dev_fstat(
  const rtems_filesystem_location_info_t *loc,
  struct stat *buf
)
{
  i2c_dev *dev = IMFS_generic_get_context_by_location(loc);

  buf->st_size = (*dev->get_size)(dev);
  buf->st_blksize = (*dev->get_block_size)(dev);

  return IMFS_stat(loc, buf);
}
Exemplo n.º 3
0
static int IMFS_stat_device(
  const rtems_filesystem_location_info_t *loc,
  struct stat *buf
)
{
  const IMFS_jnode_t *node = loc->node_access;
  const IMFS_device_t *io = &node->info.device;

  buf->st_rdev = rtems_filesystem_make_dev_t( io->major, io->minor );

  return IMFS_stat( loc, buf );
}
Exemplo n.º 4
0
static int rtems_blkdev_imfs_fstat(
  const rtems_filesystem_location_info_t *loc,
  struct stat *buf
)
{
  rtems_blkdev_imfs_context *ctx =
    IMFS_generic_get_context_by_location(loc);
  rtems_disk_device *dd = &ctx->dd;

  buf->st_rdev = rtems_disk_get_device_identifier(dd);
  buf->st_blksize = rtems_disk_get_block_size(dd);
  buf->st_blocks = rtems_disk_get_block_count(dd);

  return IMFS_stat(loc, buf);
}
Exemplo n.º 5
0
static int IMFS_stat_link(
  const rtems_filesystem_location_info_t *loc,
  struct stat *buf
)
{
  const IMFS_jnode_t *node = loc->node_access;

  if ( IMFS_type( node ) != IMFS_HARD_LINK ) {
    buf->st_size = strlen( node->info.sym_link.name );

    return IMFS_stat( loc, buf );
  } else {
    rtems_filesystem_location_info_t targetloc = *loc;

    targetloc.node_access = node->info.hard_link.link_node;
    IMFS_Set_handlers( &targetloc );

    return (targetloc.handlers->fstat_h)( &targetloc, buf );
  }
}