Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ffs Take the link count from the inode.



details:   https://anonhg.NetBSD.org/src/rev/b6f5c554cc34
branches:  trunk
changeset: 365242:b6f5c554cc34
user:      hannken <hannken%NetBSD.org@localhost>
date:      Sat Apr 16 07:59:46 2022 +0000

description:
Take the link count from the inode.

diffstat:

 sys/ufs/ffs/ffs_snapshot.c |  11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diffs (60 lines):

diff -r 5b39b8daca0c -r b6f5c554cc34 sys/ufs/ffs/ffs_snapshot.c
--- a/sys/ufs/ffs/ffs_snapshot.c        Sat Apr 16 07:59:02 2022 +0000
+++ b/sys/ufs/ffs/ffs_snapshot.c        Sat Apr 16 07:59:46 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_snapshot.c,v 1.153 2021/12/05 07:51:26 msaitoh Exp $       */
+/*     $NetBSD: ffs_snapshot.c,v 1.154 2022/04/16 07:59:46 hannken Exp $       */
 
 /*
  * Copyright 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.153 2021/12/05 07:51:26 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.154 2022/04/16 07:59:46 hannken Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -613,7 +613,6 @@
 
 struct snapshot_expunge_ctx {
        struct vnode *logvp;
-       struct lwp *l;
        struct vnode *vp;
        struct fs *copy_fs;
 };
@@ -621,7 +620,6 @@
 static bool
 snapshot_expunge_selector(void *cl, struct vnode *xvp)
 {
-       struct vattr vat;
        struct snapshot_expunge_ctx *c = cl;
        struct inode *xp;
 
@@ -639,8 +637,7 @@
        if (xvp == c->logvp)
                return true;
 
-       if (VOP_GETATTR(xvp, &vat, c->l->l_cred) == 0 &&
-           vat.va_nlink > 0)
+       if (xp->i_nlink > 0)
                return false;
 
        if (ffs_checkfreefile(c->copy_fs, c->vp, xp->i_number))
@@ -664,7 +661,6 @@
        daddr_t blkno, *blkp;
        struct fs *fs = VFSTOUFS(mp)->um_fs;
        struct inode *xp;
-       struct lwp *l = curlwp;
        struct vnode *logvp = NULL, *xvp;
        struct vnode_iterator *marker;
        struct snapshot_expunge_ctx ctx;
@@ -688,7 +684,6 @@
 
        vfs_vnode_iterator_init(mp, &marker);
        ctx.logvp = logvp;
-       ctx.l = l;
        ctx.vp = vp;
        ctx.copy_fs = copy_fs;
        while ((xvp = vfs_vnode_iterator_next(marker, snapshot_expunge_selector,



Home | Main Index | Thread Index | Old Index