diff options
author | ed <ed@FreeBSD.org> | 2012-02-10 12:35:57 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2012-02-10 12:35:57 +0000 |
commit | 28b4a002d6c95bc9e26ea30871aa91c1cc4b3563 (patch) | |
tree | 38fefd1e5bde255db2d3eab529d481ce373dec71 /sys/vm | |
parent | 7bf1094d6b76324d8ab7decb5dc0d06999a72842 (diff) | |
download | FreeBSD-src-28b4a002d6c95bc9e26ea30871aa91c1cc4b3563.zip FreeBSD-src-28b4a002d6c95bc9e26ea30871aa91c1cc4b3563.tar.gz |
Remove direct access to si_name.
Code should just use the devtoname() function to obtain the name of a
character device. Also add const keywords to pieces of code that need it
to build properly.
MFC after: 2 weeks
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/swap_pager.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 93621a9..be999cc 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2320,7 +2320,7 @@ swapoff_all(void) TAILQ_FOREACH_SAFE(sp, &swtailq, sw_list, spt) { mtx_unlock(&sw_dev_mtx); if (vn_isdisk(sp->sw_vp, NULL)) - devname = sp->sw_vp->v_rdev->si_name; + devname = devtoname(sp->sw_vp->v_rdev); else devname = "[file]"; error = swapoff_one(sp, thread0.td_ucred); @@ -2358,7 +2358,7 @@ int swap_dev_info(int name, struct xswdev *xs, char *devname, size_t len) { struct swdevt *sp; - char *tmp_devname; + const char *tmp_devname; int error, n; n = 0; @@ -2376,7 +2376,7 @@ swap_dev_info(int name, struct xswdev *xs, char *devname, size_t len) xs->xsw_used = sp->sw_used; if (devname != NULL) { if (vn_isdisk(sp->sw_vp, NULL)) - tmp_devname = sp->sw_vp->v_rdev->si_name; + tmp_devname = devtoname(sp->sw_vp->v_rdev); else tmp_devname = "[file]"; strncpy(devname, tmp_devname, len); |