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

Robert Millan rmh at debian.org
Fri Jul 29 23:06:50 UTC 2011


Hi Kostik,

2011/7/29 Kostik Belousov <kostikbel at gmail.com>:
> 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.

Here's a patch with the changes you requested.

-- 
Robert Millan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 006_proc_swaps.diff
Type: text/x-patch
Size: 3473 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20110729/1ac3f86f/006_proc_swaps.bin


More information about the freebsd-hackers mailing list