Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/lfs Skip unlinked inodes.



details:   https://anonhg.NetBSD.org/src/rev/3d4c5b2a12fa
branches:  trunk
changeset: 974841:3d4c5b2a12fa
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Aug 13 17:26:43 2020 +0000

description:
Skip unlinked inodes.

They no longer matter on disk so we don't need to write anything out
for them.

diffstat:

 sys/ufs/lfs/lfs_segment.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 6c626ecc8143 -r 3d4c5b2a12fa sys/ufs/lfs/lfs_segment.c
--- a/sys/ufs/lfs/lfs_segment.c Thu Aug 13 16:45:58 2020 +0000
+++ b/sys/ufs/lfs/lfs_segment.c Thu Aug 13 17:26:43 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_segment.c,v 1.286 2020/02/23 15:46:42 ad Exp $     */
+/*     $NetBSD: lfs_segment.c,v 1.287 2020/08/13 17:26:43 riastradh Exp $      */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.286 2020/02/23 15:46:42 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.287 2020/08/13 17:26:43 riastradh Exp $");
 
 #ifdef DEBUG
 # define vndebug(vp, str) do {                                         \
@@ -487,7 +487,7 @@
        KASSERT(mutex_owned(vp->v_interlock));
 
        ip = VTOI(vp);
-       if (ip == NULL || vp->v_type == VNON)
+       if (ip == NULL || vp->v_type == VNON || ip->i_nlink <= 0)
                return false;
        if ((op == VN_DIROP && !(vp->v_uflag & VU_DIROP)) ||
            (op != VN_DIROP && op != VN_CLEAN && (vp->v_uflag & VU_DIROP))) {



Home | Main Index | Thread Index | Old Index