diff options
Diffstat (limited to 'sys/compat/common/vfs_syscalls_25.c')
-rw-r--r-- | sys/compat/common/vfs_syscalls_25.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/compat/common/vfs_syscalls_25.c b/sys/compat/common/vfs_syscalls_25.c index 333724e87e7..5f4d658ca67 100644 --- a/sys/compat/common/vfs_syscalls_25.c +++ b/sys/compat/common/vfs_syscalls_25.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls_25.c,v 1.8 2006/03/05 21:48:54 miod Exp $ */ +/* $OpenBSD: vfs_syscalls_25.c,v 1.9 2006/04/19 11:55:55 pedro Exp $ */ /* * Copyright (c) 1989, 1993 @@ -178,10 +178,10 @@ compat_25_sys_getfsstat(p, v, retval) maxcount = SCARG(uap, bufsize) / sizeof(struct ostatfs); sfsp = (caddr_t)SCARG(uap, buf); count = 0; - simple_lock(&mountlist_slock); + for (mp = CIRCLEQ_FIRST(&mountlist); mp != CIRCLEQ_END(&mountlist); mp = nmp) { - if (vfs_busy(mp, LK_NOWAIT, &mountlist_slock)) { + if (vfs_busy(mp, LK_NOWAIT, NULL)) { nmp = CIRCLEQ_NEXT(mp, mnt_list); continue; } @@ -194,7 +194,6 @@ compat_25_sys_getfsstat(p, v, retval) (flags == MNT_WAIT || flags == 0) && (error = VFS_STATFS(mp, sp, p))) { - simple_lock(&mountlist_slock); nmp = CIRCLEQ_NEXT(mp, mnt_list); vfs_unbusy(mp); continue; @@ -209,14 +208,14 @@ compat_25_sys_getfsstat(p, v, retval) sfsp += sizeof(osb); } count++; - simple_lock(&mountlist_slock); nmp = CIRCLEQ_NEXT(mp, mnt_list); vfs_unbusy(mp); } - simple_unlock(&mountlist_slock); + if (sfsp && count > maxcount) *retval = maxcount; else *retval = count; + return (0); } |