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.