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
[-- Attachment #1 --] On Fri, Jul 29, 2011 at 01:15:59AM +0200, Robert Millan wrote: > Please consider this patch, it implements Linux-like /proc/swaps for linprocfs. > > E.g. > > $ cat /proc/swaps > Filename Type Size Used Priority > /dev/zvol/dimoni/swap unknown 2097152 0 -1 > > -- > 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 = sp->sw_vp->v_rdev->si_name; else devname = "[file]"; This could be another function that returns swap information by index. [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk4x8kUACgkQC3+MBN1Mb4hLSQCfaZs58R1WxyV3tmZ59T0N6Z+k DeIAn22z6GLMtJGi3qP6zXo3Op4iL1Wz =Kq/Y -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110728233533.GB17489>
