summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1996-01-16 13:09:33 +0000
committerDavid Greenman <dg@FreeBSD.org>1996-01-16 13:09:33 +0000
commit9314eadda6197d0c47aaee5e8cd1b6971b67cafa (patch)
tree566ee8abcd9cc8ab018a36aee58eb089ba16f745
parenteaba91132dd25fac9fdd414be8339072105d9425 (diff)
Notes
-rw-r--r--sys/kern/vfs_syscalls.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index b95c9eec8d36..1a3714eb23fa 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id: vfs_syscalls.c,v 1.25.4.2 1995/09/18 05:30:19 davidg Exp $
+ * $Id: vfs_syscalls.c,v 1.25.4.3 1995/10/26 09:17:19 davidg Exp $
*/
#include <sys/param.h>
@@ -457,7 +457,10 @@ getfsstat(p, uap, retval)
maxcount = uap->bufsize / sizeof(struct statfs);
sfsp = (caddr_t)uap->buf;
for (count = 0, mp = mountlist.tqh_first; mp != NULL; mp = nmp) {
- nmp = mp->mnt_list.tqe_next;
+ if (vfs_busy(mp)) {
+ nmp = mp->mnt_list.tqe_next;
+ continue;
+ }
if (sfsp && count < maxcount &&
((mp->mnt_flag & MNT_MLOCK) == 0)) {
sp = &mp->mnt_stat;
@@ -467,15 +470,22 @@ getfsstat(p, uap, retval)
*/
if (((uap->flags & MNT_NOWAIT) == 0 ||
(uap->flags & MNT_WAIT)) &&
- (error = VFS_STATFS(mp, sp, p)))
+ (error = VFS_STATFS(mp, sp, p))) {
+ nmp = mp->mnt_list.tqe_next;
+ vfs_unbusy(mp);
continue;
+ }
sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
error = copyout((caddr_t)sp, sfsp, sizeof(*sp));
- if (error)
+ if (error) {
+ vfs_unbusy(mp);
return (error);
+ }
sfsp += sizeof(*sp);
}
count++;
+ nmp = mp->mnt_list.tqe_next;
+ vfs_unbusy(mp);
}
if (sfsp && count > maxcount)
*retval = maxcount;