예제 #1
0
/*ARGSUSED*/
void     
db_vnode_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
{
	boolean_t full = FALSE;

	if (modif[0] == 'f')
		full = TRUE;

	vfs_vnode_print((void *)addr, full, db_printf);
}
예제 #2
0
void
db_show_files_cmd(db_expr_t addr, bool haddr,
	      db_expr_t count, const char *modif)
{
#ifdef _KERNEL	/* XXX CRASH(8) */
	struct proc *p;
	int i;
	filedesc_t *fdp;
	fdfile_t *ff;
	file_t *fp;
	struct vnode *vn;
	bool full = false;
	fdtab_t *dt;

	if (modif[0] == 'f')
		full = true;

	p = (struct proc *) (uintptr_t) addr;

	fdp = p->p_fd;
	dt = fdp->fd_dt;
	for (i = 0; i < dt->dt_nfiles; i++) {
		if ((ff = dt->dt_ff[i]) == NULL)
			continue;

		fp = ff->ff_file;

		/* Only look at vnodes... */
		if ((fp != NULL) && (fp->f_type == DTYPE_VNODE)) {
			if (fp->f_data != NULL) {
				vn = (struct vnode *) fp->f_data;
				vfs_vnode_print(vn, full, db_printf);

#ifdef LOCKDEBUG
				db_printf("\nv_uobj.vmobjlock lock details:\n");
				lockdebug_lock_print(vn->v_uobj.vmobjlock,
					     db_printf);
				db_printf("\n");
#endif
			}
		}
	}
#endif
}