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); }
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); }
static int handler_fstat( const rtems_filesystem_location_info_t *loc, struct stat *buf ) { test_state *state = IMFS_generic_get_context_by_location(loc); switch (*state) { case TEST_INITIALIZED: *state = TEST_FSTAT_OPEN; break; case TEST_CLOSED: *state = TEST_FSTAT_UNLINK; break; default: rtems_test_assert(0); break; } return rtems_filesystem_default_fstat(loc, buf); }