- up(&yaffs_context_lock);
- }
-
- return buf - page < count ? buf - page : count;
-}
-
-static int yaffs_stats_proc_read(char *page,
- char **start,
- off_t offset, int count, int *eof, void *data)
-{
- struct ylist_head *item;
- char *buf = page;
- int n = 0;
-
- down(&yaffs_context_lock);
-
- /* Locate and print the Nth entry. Order N-squared but N is small. */
- ylist_for_each(item, &yaffs_context_list) {
- struct yaffs_LinuxContext *dc = ylist_entry(item, struct yaffs_LinuxContext, contextList);
- yaffs_dev_t *dev = dc->dev;
-
- int erasedChunks;
-
- erasedChunks = dev->n_erased_blocks * dev->param.chunks_per_block;
-
- buf += sprintf(buf,"%d, %d, %d, %u, %u, %u, %u\n",
- n, dev->n_free_chunks, erasedChunks,
- dev->bg_gcs, dev->oldest_dirty_gc_count,
- dev->n_obj, dev->n_tnodes);