Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/lfs Call lfs_orphan in lfs_rename while we're still ...



details:   https://anonhg.NetBSD.org/src/rev/e7d5dc17914c
branches:  trunk
changeset: 745135:e7d5dc17914c
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Feb 23 08:41:07 2020 +0000

description:
Call lfs_orphan in lfs_rename while we're still in the dirop.

diffstat:

 sys/ufs/lfs/lfs_rename.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 1257e7137386 -r e7d5dc17914c sys/ufs/lfs/lfs_rename.c
--- a/sys/ufs/lfs/lfs_rename.c  Sun Feb 23 08:40:58 2020 +0000
+++ b/sys/ufs/lfs/lfs_rename.c  Sun Feb 23 08:41:07 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_rename.c,v 1.22 2017/06/10 05:29:36 maya Exp $     */
+/*     $NetBSD: lfs_rename.c,v 1.23 2020/02/23 08:41:07 riastradh Exp $        */
 /*  from NetBSD: ufs_rename.c,v 1.12 2015/03/27 17:27:56 riastradh Exp  */
 
 /*-
@@ -89,7 +89,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_rename.c,v 1.22 2017/06/10 05:29:36 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_rename.c,v 1.23 2020/02/23 08:41:07 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1061,6 +1061,9 @@
            fdvp, fcnp, fde, fvp,
            tdvp, tcnp, tde, tvp);
 
+       if (tvp && VTOI(tvp)->i_nlink == 0)
+               lfs_orphan(VTOI(tvp)->i_lfs, VTOI(tvp)->i_number);
+
        UNMARK_VNODE(fdvp);
        UNMARK_VNODE(fvp);
        UNMARK_VNODE(tdvp);



Home | Main Index | Thread Index | Old Index