rem: switch(v->stream.type) { case STREAM_TYPE_DIR: stat->st_mode |= S_IFDIR; break; case STREAM_TYPE_FILE: stat->st_size = v->stream.u.file.len; stat->st_mode |= S_IFREG; break; default: err = EINVAL; break; }
add: if (v->stream.type == S_IFREG) stat->st_size = v->stream.u.file.len; else stat->st_size = 0;
context: bootfs_read_stat(fs_volume _fs, fs_vnode _v, struct stat *stat){	struct bootfs *fs = _fs;	struct bootfs_vnode *v = _v;	status_t err = 0;	TRACE(("bootfs_rstat: fs_cookie %p vnode %p v->id 0x%Lx , stat %p\n", fs, v, v->id, stat));	mutex_lock(&fs->lock);    /* Read Only File System */    /** XXX - no pretense at access control, just tell people     *        they can read it :)     */	stat->st_mode = (S_IRUSR | S_IRGRP | S_IROTH);	stat->st_size = 0;	stat->st_ino = v->id;	switch(v->stream.type) {		case STREAM_TYPE_DIR:			stat->st_mode |= S_IFDIR;			break;		case STREAM_TYPE_FILE:			stat->st_size = v->stream.u.file.len;			stat->st_mode |= S_IFREG;			break;		default:			err = EINVAL;			break;	}err:	mutex_unlock(&fs->lock);	return err;}