/*
 * Copyright (C) 2000-2002 ASANO Masahiro
 */

#include "def.h"

#define __KERNEL__
#include <linux/fs.h>
#include <linux/namespace.h>

void
prhead_namespace()
{
	mprintf(SPTR" CNT "SPTR " "SPTR"\n", "ADDR", "ROOT", "MNT_LIST");
}

addr_t
print_namespace(addr)
	addr_t addr;
{
	struct namespace ns;

	memread(addr, sizeof(struct namespace), &ns, "namespace");
	mprintf(FPTR " %3x " FPTR " ", addr, ATOMIC_READ(ns.count), ns.root);
	if (ns.list.next && (addr_t)ns.list.next != addr + OFFSET(struct namespace, list)) {
		mprintf(FPTR, (addr_t)ns.list.next - OFFSET(struct vfsmount, mnt_list));
	} else {
		mprintf(SPTR, "-");
	}
	mprintf("\n");
	return (addr_t)ns.list.next;
}
