aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>1998-07-10 00:10:20 +0000
committerJulian Elischer <julian@FreeBSD.org>1998-07-10 00:10:20 +0000
commitf763857cffe9dbe1a3486de1191ed10acf2f1138 (patch)
tree3dfc493308d63391927fdb577410050758bc85f3 /sys/ufs
parentb9dd99f2f5645cff49601a09834112809adf6c60 (diff)
downloadsrc-f763857cffe9dbe1a3486de1191ed10acf2f1138.tar.gz
src-f763857cffe9dbe1a3486de1191ed10acf2f1138.zip
Add code missed in the initial Soft updates integration.
Make the unallocated parts of a directry have a know state in case we need it later.
Notes
Notes: svn path=/head/; revision=37539
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ufs/ufs_vnops.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index eb6d6b029a44..423d19d89624 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95
- * $Id: ufs_vnops.c,v 1.93 1998/07/03 22:37:43 bde Exp $
+ * $Id: ufs_vnops.c,v 1.94 1998/07/04 20:45:40 julian Exp $
*/
#include "opt_quota.h"
@@ -1279,6 +1279,7 @@ ufs_mkdir(ap)
struct direct newdir;
struct timeval tv;
int error, dmode;
+ long blkoff;
#ifdef DIAGNOSTIC
if ((cnp->cn_flags & HASBUF) == 0)
@@ -1402,6 +1403,20 @@ ufs_mkdir(ap)
ip->i_flag |= IN_CHANGE | IN_UPDATE;
vnode_pager_setsize(tvp, (u_long)ip->i_size);
bcopy((caddr_t)&dirtemplate, (caddr_t)bp->b_data, sizeof dirtemplate);
+ if (DOINGSOFTDEP(tvp)) {
+ /*
+ * Ensure that the entire newly allocated block is a
+ * valid directory so that future growth within the
+ * block does not have to ensure that the block is
+ * written before the inode.
+ */
+ blkoff = DIRBLKSIZ;
+ while (blkoff < bp->b_bcount) {
+ ((struct direct *)
+ (bp->b_data + blkoff))->d_reclen = DIRBLKSIZ;
+ blkoff += DIRBLKSIZ;
+ }
+ }
if ((error = UFS_UPDATE(tvp, &tv, &tv, !DOINGSOFTDEP(tvp))) != 0) {
(void)VOP_BWRITE(bp);
goto bad;