// -------------------------------------------------------------------------
// romfs_getinfo()
-// Getinfo. Currently only support pathconf().
+// Getinfo. Currently only support pathconf() and file system block usage
static int romfs_getinfo ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
int key, void *buf, int len )
case FS_INFO_CONF:
err = romfs_pathconf( ds.node, (struct cyg_pathconf_info *)buf );
break;
-
+#if defined(CYGSEM_FILEIO_BLOCK_USAGE)
+ case FS_INFO_BLOCK_USAGE: {
+ struct cyg_fs_block_usage *usage = (struct cyg_fs_block_usage *) buf;
+ struct romfs_disk *disk = (struct romfs_disk*) mte->data;
+ usage->total_blocks = disk->disksize;
+ usage->free_blocks = 0;
+ usage->block_size = 1;
+ return ENOERR;
+ }
+#endif
default:
err = EINVAL;
}
for ( i = 0 ; i < nlen && d->name[i] ; i++, nbuf++ )
*nbuf = d->name[i];
+#ifdef CYGPKG_FS_ROM_RET_DIRENT_DTYPE
+ ent->d_type = (((romfs_disk *)fp->f_mte->data)->node[d->node]).mode;
+#endif
// A successful read. Terminate the entry name with a NUL, set the
// residue and set the file offset to restart at the next