summaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2005-06-18 18:09:44 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2005-06-18 18:09:44 +0000
commit14a75551ab8adecfa8504f866b3039a514eba589 (patch)
tree97bad1a2e1e4f025760e484fea8d1a14281e6c34 /sys/ufs
parent3082708bb92c9b5a6ab11c44aaa464f490ba02f3 (diff)
Remove remaining whiteout tentacles; OK deraadt@ miod@ weingart@
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_softdep.c45
-rw-r--r--sys/ufs/ufs/dinode.h10
-rw-r--r--sys/ufs/ufs/dir.h3
-rw-r--r--sys/ufs/ufs/ufs_lookup.c58
-rw-r--r--sys/ufs/ufs/ufs_vnops.c8
5 files changed, 15 insertions, 109 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 8cd281c25a7..62ba576934e 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_softdep.c,v 1.57 2005/06/10 17:37:40 pedro Exp $ */
+/* $OpenBSD: ffs_softdep.c,v 1.58 2005/06/18 18:09:43 millert Exp $ */
/*
* Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved.
*
@@ -2444,15 +2444,6 @@ softdep_setup_directory_add(bp, dp, diroffset, newinum, newdirbp)
struct inodedep *inodedep;
struct mkdir *mkdir1, *mkdir2;
- /*
- * Whiteouts have no dependencies.
- */
- if (newinum == WINO) {
- if (newdirbp != NULL)
- bdwrite(newdirbp);
- return;
- }
-
fs = dp->i_fs;
lbn = lblkno(fs, diroffset);
offset = blkoff(fs, diroffset);
@@ -2802,18 +2793,12 @@ softdep_setup_directory_change(bp, dp, ip, newinum, isrmdir)
struct inodedep *inodedep;
offset = blkoff(dp->i_fs, dp->i_offset);
-
- /*
- * Whiteouts do not need diradd dependencies.
- */
- if (newinum != WINO) {
- dap = pool_get(&diradd_pool, PR_WAITOK);
- bzero(dap,sizeof(struct diradd));
- dap->da_list.wk_type = D_DIRADD;
- dap->da_state = DIRCHG | ATTACHED | DEPCOMPLETE;
- dap->da_offset = offset;
- dap->da_newinum = newinum;
- }
+ dap = pool_get(&diradd_pool, PR_WAITOK);
+ bzero(dap,sizeof(struct diradd));
+ dap->da_list.wk_type = D_DIRADD;
+ dap->da_state = DIRCHG | ATTACHED | DEPCOMPLETE;
+ dap->da_offset = offset;
+ dap->da_newinum = newinum;
/*
* Allocate a new dirrem and ACQUIRE_LOCK.
@@ -2836,22 +2821,6 @@ softdep_setup_directory_change(bp, dp, ip, newinum, isrmdir)
dirrem->dm_state |= DIRCHG;
/*
- * Whiteouts have no additional dependencies,
- * so just put the dirrem on the correct list.
- */
- if (newinum == WINO) {
- if ((dirrem->dm_state & COMPLETE) == 0) {
- LIST_INSERT_HEAD(&pagedep->pd_dirremhd, dirrem,
- dm_next);
- } else {
- dirrem->dm_dirinum = pagedep->pd_ino;
- add_to_worklist(&dirrem->dm_list);
- }
- FREE_LOCK(&lk);
- return;
- }
-
- /*
* If the COMPLETE flag is clear, then there were no active
* entries and we want to roll back to the previous inode until
* the new inode is committed to disk. If the COMPLETE flag is
diff --git a/sys/ufs/ufs/dinode.h b/sys/ufs/ufs/dinode.h
index df721d2602c..125d4cba69c 100644
--- a/sys/ufs/ufs/dinode.h
+++ b/sys/ufs/ufs/dinode.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dinode.h,v 1.9 2004/01/20 03:44:06 tedu Exp $ */
+/* $OpenBSD: dinode.h,v 1.10 2005/06/18 18:09:43 millert Exp $ */
/* $NetBSD: dinode.h,v 1.7 1995/06/15 23:22:48 cgd Exp $ */
/*
@@ -49,14 +49,6 @@
#define ROOTINO ((ino_t)2)
/*
- * The Whiteout inode# is a dummy non-zero inode number which will
- * never be allocated to a real file. It is used as a place holder
- * in the directory entry which has been tagged as a DT_W entry.
- * See the comments about ROOTINO above.
- */
-#define WINO ((ino_t)1)
-
-/*
* A dinode contains all the meta-data associated with a UFS file.
* This structure defines the on-disk format of a dinode. Since
* this structure describes an on-disk structure, all its fields
diff --git a/sys/ufs/ufs/dir.h b/sys/ufs/ufs/dir.h
index 0b7560cacd8..b32b93d3951 100644
--- a/sys/ufs/ufs/dir.h
+++ b/sys/ufs/ufs/dir.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dir.h,v 1.9 2003/12/28 17:20:16 tedu Exp $ */
+/* $OpenBSD: dir.h,v 1.10 2005/06/18 18:09:43 millert Exp $ */
/* $NetBSD: dir.h,v 1.8 1996/03/09 19:42:41 scottr Exp $ */
/*
@@ -95,7 +95,6 @@ struct direct {
#define DT_REG 8
#define DT_LNK 10
#define DT_SOCK 12
-#define DT_WHT 14
/*
* Convert between stat structure types and directory types.
diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c
index 206e11534c2..544e1b89d76 100644
--- a/sys/ufs/ufs/ufs_lookup.c
+++ b/sys/ufs/ufs/ufs_lookup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ufs_lookup.c,v 1.29 2005/06/10 17:37:41 pedro Exp $ */
+/* $OpenBSD: ufs_lookup.c,v 1.30 2005/06/18 18:09:43 millert Exp $ */
/* $NetBSD: ufs_lookup.c,v 1.7 1996/02/09 22:36:06 christos Exp $ */
/*
@@ -350,33 +350,6 @@ foundentry:
* reclen in ndp->ni_ufs area, and release
* directory buffer.
*/
- if (vdp->v_mount->mnt_maxsymlinklen > 0 &&
- ep->d_type == DT_WHT) {
- slotstatus = FOUND;
- slotoffset = dp->i_offset;
- slotsize = ep->d_reclen;
- dp->i_reclen = slotsize;
- /*
- * This is used to set dp->i_endoff,
- * which may be used by ufs_direnter2()
- * as a length to truncate the
- * directory to. Therefore, it must
- * point past the end of the last
- * non-empty directory entry. We don't
- * know where that is in this case, so
- * we effectively disable shrinking by
- * using the existing size of the
- * directory.
- *
- * Note that we wouldn't expect to
- * shrink the directory while rewriting
- * an existing entry anyway.
- */
- enduseful = endsearch;
- ap->a_cnp->cn_flags |= ISWHITEOUT;
- numdirpasses--;
- goto notfound;
- }
dp->i_ino = ep->d_ino;
dp->i_reclen = ep->d_reclen;
goto found;
@@ -406,10 +379,7 @@ notfound:
* directory has not been removed, then can consider
* allowing file to be created.
*/
- if ((nameiop == CREATE || nameiop == RENAME ||
- (nameiop == DELETE &&
- (ap->a_cnp->cn_flags & DOWHITEOUT) &&
- (ap->a_cnp->cn_flags & ISWHITEOUT))) &&
+ if ((nameiop == CREATE || nameiop == RENAME) &&
(flags & ISLASTCN) && dp->i_effnlink != 0) {
/*
* Access for write is interpreted as allowing
@@ -903,9 +873,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp)
* Update the pointer fields in the previous entry (if any),
* copy in the new entry, and write out the block.
*/
- if (ep->d_ino == 0 ||
- (ep->d_ino == WINO &&
- bcmp(ep->d_name, dirp->d_name, dirp->d_namlen) == 0)) {
+ if (ep->d_ino == 0) {
if (spacefree + dsize < newentrysize)
panic("ufs_direnter: compact1");
dirp->d_reclen = spacefree + dsize;
@@ -990,19 +958,6 @@ ufs_dirremove(dvp, ip, flags, isrmdir)
dp = VTOI(dvp);
- if (flags & DOWHITEOUT) {
- /*
- * Whiteout entry: set d_ino to WINO.
- */
- error = UFS_BUFATOFF(dp, (off_t)dp->i_offset, (char **)&ep,
- &bp);
- if (error)
- return (error);
- ep->d_ino = WINO;
- ep->d_type = DT_WHT;
- goto out;
- }
-
if ((error = UFS_BUFATOFF(dp,
(off_t)(dp->i_offset - dp->i_count), (char **)&ep, &bp)) != 0)
return (error);
@@ -1033,7 +988,6 @@ ufs_dirremove(dvp, ip, flags, isrmdir)
((dp->i_offset - dp->i_count) & (DIRBLKSIZ - 1)),
dp->i_offset & ~(DIRBLKSIZ - 1));
#endif
-out:
if (DOINGSOFTDEP(dvp)) {
if (ip) {
ip->i_effnlink--;
@@ -1052,9 +1006,7 @@ out:
ip->i_ffs_nlink--;
ip->i_flag |= IN_CHANGE;
}
- if (flags & DOWHITEOUT)
- error = bwrite(bp);
- else if (DOINGASYNC(dvp) && dp->i_count != 0) {
+ if (DOINGASYNC(dvp) && dp->i_count != 0) {
bdwrite(bp);
error = 0;
} else
@@ -1142,7 +1094,7 @@ ufs_dirempty(ip, parentino, cred)
if (dp->d_reclen == 0)
return (0);
/* skip empty entries */
- if (dp->d_ino == 0 || dp->d_ino == WINO)
+ if (dp->d_ino == 0)
continue;
/* accept only "." and ".." */
# if (BYTE_ORDER == LITTLE_ENDIAN)
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index d1596699ad2..32d477f80df 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ufs_vnops.c,v 1.64 2005/06/10 17:37:41 pedro Exp $ */
+/* $OpenBSD: ufs_vnops.c,v 1.65 2005/06/18 18:09:43 millert Exp $ */
/* $NetBSD: ufs_vnops.c,v 1.18 1996/05/11 18:28:04 mycroft Exp $ */
/*
@@ -1251,9 +1251,6 @@ ufs_mkdir(v)
if (DOINGSOFTDEP(tvp))
softdep_change_linkcnt(ip, 0);
- if (cnp->cn_flags & ISWHITEOUT)
- ip->i_ffs_flags |= UF_OPAQUE;
-
/*
* Bump link count in parent directory to reflect work done below.
* Should be done before reference is create so cleanup is
@@ -2088,9 +2085,6 @@ ufs_makeinode(mode, dvp, vpp, cnp)
suser_ucred(cnp->cn_cred))
ip->i_ffs_mode &= ~ISGID;
- if (cnp->cn_flags & ISWHITEOUT)
- ip->i_ffs_flags |= UF_OPAQUE;
-
/*
* Make sure inode goes to disk before directory entry.
*/