Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: [PATCH] Linux-like /proc/swaps for linprocfs

0 views
Skip to first unread message

Kostik Belousov

unread,
Jul 28, 2011, 7:35:33 PM7/28/11
to
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.

0 new messages