diff options
author | kib <kib@FreeBSD.org> | 2016-06-12 11:13:38 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2016-06-12 11:13:38 +0000 |
commit | 480f64e0481af9d3d82f2e2db4c4bd08105333dd (patch) | |
tree | a1b2b324009f0dedf540c12949b80f46945406e0 | |
parent | 5b882020081a138285227631c46a406c08e17bc8 (diff) | |
download | FreeBSD-src-480f64e0481af9d3d82f2e2db4c4bd08105333dd.zip FreeBSD-src-480f64e0481af9d3d82f2e2db4c4bd08105333dd.tar.gz |
swap_dev_info() does not require Giant, so Giant locking around
the loop in linprocfs_doswaps() is useless.
List of the registered filesystems is protected by vfsconf_sx,
not by the Giant. Adjust linprocfs_dofilesystems() correspondingly.
Approved by: re (delphij), des (linprocfs maintainer)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
-rw-r--r-- | sys/compat/linprocfs/linprocfs.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index 2cd665a..56b2ade 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -490,7 +490,6 @@ linprocfs_doswaps(PFS_FILL_ARGS) char devname[SPECNAMELEN + 1]; sbuf_printf(sb, "Filename\t\t\t\tType\t\tSize\tUsed\tPriority\n"); - mtx_lock(&Giant); for (n = 0; ; n++) { if (swap_dev_info(n, &xsw, devname, sizeof(devname)) != 0) break; @@ -504,7 +503,6 @@ linprocfs_doswaps(PFS_FILL_ARGS) sbuf_printf(sb, "/dev/%-34s unknown\t\t%jd\t%jd\t-1\n", devname, total, used); } - mtx_unlock(&Giant); return (0); } @@ -1326,13 +1324,13 @@ linprocfs_dofilesystems(PFS_FILL_ARGS) { struct vfsconf *vfsp; - mtx_lock(&Giant); + vfsconf_slock(); TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) { if (vfsp->vfc_flags & VFCF_SYNTHETIC) sbuf_printf(sb, "nodev"); sbuf_printf(sb, "\t%s\n", vfsp->vfc_name); } - mtx_unlock(&Giant); + vfsconf_sunlock(); return(0); } |