diff options
author | julian <julian@FreeBSD.org> | 1998-07-10 00:10:20 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1998-07-10 00:10:20 +0000 |
commit | 3032208d427abf6412386a421807120d9f6e9c33 (patch) | |
tree | 67ae7ec1777d51d4a0c9de6d06db9565e0abfb3d /sys/ufs | |
parent | 39b76225e43bce15a82afcacad02d6138d79a246 (diff) | |
download | FreeBSD-src-3032208d427abf6412386a421807120d9f6e9c33.zip FreeBSD-src-3032208d427abf6412386a421807120d9f6e9c33.tar.gz |
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.
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index eb6d6b0..423d19d 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; |