Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jul 2011 02:35:33 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Robert Millan <rmh@debian.org>
Cc:        freebsd-hackers@freebsd.org, freebsd-emulation@freebsd.org
Subject:   Re: [PATCH] Linux-like /proc/swaps for linprocfs
Message-ID:  <20110728233533.GB17489@deviant.kiev.zoral.com.ua>
In-Reply-To: <CAOfDtXN9sctWJZ4G=oCubQo0Si1BUYz0nyE=qhqmn2skZHOhEw@mail.gmail.com>
References:  <CAOfDtXN9sctWJZ4G=oCubQo0Si1BUYz0nyE=qhqmn2skZHOhEw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--DVQ8A37yL26ZH/UD
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Jul 29, 2011 at 01:15:59AM +0200, Robert Millan wrote:
> Please consider this patch, it implements Linux-like /proc/swaps for linp=
rocfs.
>=20
> E.g.
>=20
> $ cat /proc/swaps
> Filename                                Type            Size    Used    P=
riority
> /dev/zvol/dimoni/swap                   unknown         2097152 0       -1
>=20
> --=20
> Robert Millan


The patch is too hackish, IMHO.
I would prefer to have an exported kernel function that fills xswdev
by index, used both by vm_swap_info and linprocfs.

For the device name, you would use sw_vp->v_rdev->si_name, see, for
instance, the following fragment in the swapoff_all():
		if (vn_isdisk(sp->sw_vp, NULL))
			devname =3D sp->sw_vp->v_rdev->si_name;
		else
			devname =3D "[file]";
This could be another function that returns swap information by index.

--DVQ8A37yL26ZH/UD
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iEYEARECAAYFAk4x8kUACgkQC3+MBN1Mb4hLSQCfaZs58R1WxyV3tmZ59T0N6Z+k
DeIAn22z6GLMtJGi3qP6zXo3Op4iL1Wz
=Kq/Y
-----END PGP SIGNATURE-----

--DVQ8A37yL26ZH/UD--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110728233533.GB17489>