summaryrefslogtreecommitdiff
path: root/ufs
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-04-18 19:06:20 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-04-18 19:06:20 +0000
commit8e31a78127d5249ad82056116b8cb4750c69ddcb (patch)
treefb07dbda3857e87f15110e7003161a70bdd7447a /ufs
parent8287543a9d96736b0c5f23a81a332da3f7e23a1c (diff)
(ffs_realloccg): If we are allocating a new block, don't actually free
the old one here.
Diffstat (limited to 'ufs')
-rw-r--r--ufs/alloc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ufs/alloc.c b/ufs/alloc.c
index 8f6a5baf..4cbac331 100644
--- a/ufs/alloc.c
+++ b/ufs/alloc.c
@@ -1,5 +1,5 @@
/* Disk allocation routines
- Copyright (C) 1993, 1994, 1995 Free Software Foundation
+ Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation
This file is part of the GNU Hurd.
@@ -308,7 +308,10 @@ ffs_realloccg(register struct node *np,
bp->b_blkno = fsbtodb(fs, bno);
(void) vnode_pager_uncache(ITOV(ip));
#endif
- ffs_blkfree(np, bprev, (long)osize);
+/* Commented out here for Hurd; we don't want to free this until we've
+ saved the old contents. Callers are responsible for freeing the
+ block when they are done with it. */
+/* ffs_blkfree(np, bprev, (long)osize); */
if (nsize < request)
ffs_blkfree(np, bno + numfrags(fs, nsize),
(long)(request - nsize));
@@ -563,7 +566,7 @@ diskfs_alloc_node (struct node *dir,
spin_unlock (&alloclock);
if (ino == 0)
goto noinodes;
- error = iget (ino, &np);
+ error = diskfs_cached_lookup (ino, &np);
assert ("duplicate allocation" && !np->dn_stat.st_mode);
assert (!np->istranslated);
if (np->dn_stat.st_blocks) {