Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/ufs/ufs/ufs_dirhash.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/ufs/ufs/ufs_dirhash.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.7 retrieving revision 1.8 diff -u -p -r1.7 -r1.8 --- src/sys/ufs/ufs/ufs_dirhash.c 2005/12/11 12:25:28 1.7 +++ src/sys/ufs/ufs/ufs_dirhash.c 2006/01/13 00:50:25 1.8 @@ -1,4 +1,4 @@ -/* $NetBSD: ufs_dirhash.c,v 1.7 2005/12/11 12:25:28 christos Exp $ */ +/* $NetBSD: ufs_dirhash.c,v 1.8 2006/01/13 00:50:25 yamt Exp $ */ /* * Copyright (c) 2001, 2002 Ian Dowse. All rights reserved. @@ -194,6 +194,10 @@ ufsdirhash_build(struct inode *ip) bmask = VFSTOUFS(vp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; pos = 0; while (pos < ip->i_size) { + if ((curcpu()->ci_schedstate.spc_flags & SPCF_SHOULDYIELD) + != 0) { + preempt(1); + } /* If necessary, get the next directory block. */ if ((pos & bmask) == 0) { if (bp != NULL)