Deleted Added
full compact
mfs_vfsops.c (1.16) mfs_vfsops.c (1.17)
1/* $OpenBSD: mfs_vfsops.c,v 1.16 2002/01/23 01:40:59 art Exp $ */
1/* $OpenBSD: mfs_vfsops.c,v 1.17 2002/02/18 09:23:26 ericj Exp $ */
2/* $NetBSD: mfs_vfsops.c,v 1.10 1996/02/09 22:31:28 christos Exp $ */
3
4/*
5 * Copyright (c) 1989, 1990, 1993, 1994
6 * The Regents of the University of California. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

--- 244 unchanged lines hidden (view full) ---

254 struct mount *mp;
255 int flags;
256 struct proc *p;
257{
258 register struct vnode *vp = VFSTOUFS(mp)->um_devvp;
259 register struct mfsnode *mfsp = VTOMFS(vp);
260 register struct buf *bp;
261 register caddr_t base;
2/* $NetBSD: mfs_vfsops.c,v 1.10 1996/02/09 22:31:28 christos Exp $ */
3
4/*
5 * Copyright (c) 1989, 1990, 1993, 1994
6 * The Regents of the University of California. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

--- 244 unchanged lines hidden (view full) ---

254 struct mount *mp;
255 int flags;
256 struct proc *p;
257{
258 register struct vnode *vp = VFSTOUFS(mp)->um_devvp;
259 register struct mfsnode *mfsp = VTOMFS(vp);
260 register struct buf *bp;
261 register caddr_t base;
262 int sleepreturn = 0;
262
263 base = mfsp->mfs_baseoff;
264 while (mfsp->mfs_buflist != (struct buf *)-1) {
265#define DOIO() \
266 while ((bp = mfsp->mfs_buflist) != NULL) { \
267 mfsp->mfs_buflist = bp->b_actf; \
268 mfs_doio(bp, base); \
269 wakeup((caddr_t)bp); \
270 }
271 DOIO();
272 /*
273 * If a non-ignored signal is received, try to unmount.
274 * If that fails, clear the signal (it has been "processed"),
275 * otherwise we will loop here, as tsleep will always return
276 * EINTR/ERESTART.
277 */
263
264 base = mfsp->mfs_baseoff;
265 while (mfsp->mfs_buflist != (struct buf *)-1) {
266#define DOIO() \
267 while ((bp = mfsp->mfs_buflist) != NULL) { \
268 mfsp->mfs_buflist = bp->b_actf; \
269 mfs_doio(bp, base); \
270 wakeup((caddr_t)bp); \
271 }
272 DOIO();
273 /*
274 * If a non-ignored signal is received, try to unmount.
275 * If that fails, clear the signal (it has been "processed"),
276 * otherwise we will loop here, as tsleep will always return
277 * EINTR/ERESTART.
278 */
278 if (tsleep((caddr_t)vp, mfs_pri, "mfsidl", 0)) {
279 if (sleepreturn != 0) {
279 if (vfs_busy(mp, LK_NOWAIT, NULL, p) ||
280 dounmount(mp, 0, p))
281 CLRSIG(p, CURSIG(p));
280 if (vfs_busy(mp, LK_NOWAIT, NULL, p) ||
281 dounmount(mp, 0, p))
282 CLRSIG(p, CURSIG(p));
283 sleepreturn = 0;
284 continue;
282 }
285 }
286 sleepreturn = tsleep((caddr_t)vp, mfs_pri, "mfsidl", 0);
283 }
284 return (0);
285}
286
287/*
288 * Get file system statistics.
289 */
290int

--- 38 unchanged lines hidden ---
287 }
288 return (0);
289}
290
291/*
292 * Get file system statistics.
293 */
294int

--- 38 unchanged lines hidden ---