From ba024da80b160ff9468f2131c04195c0d2b8d637 Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Tue, 20 Jun 2023 00:15:25 -0700 Subject: [PATCH] usr.sbin/makefs/hammer2: Remove redundant hammer2_inode_modify() The inode setxxx ioctls don't need hammer2_inode_modify() for intermediate directories. The inode destroy ioctl needs hammer2_inode_modify() at least for a direct parent directory of destroy target. --- usr.sbin/makefs/hammer2.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/usr.sbin/makefs/hammer2.c b/usr.sbin/makefs/hammer2.c index 06c66ee850..f3939f9b05 100644 --- a/usr.sbin/makefs/hammer2.c +++ b/usr.sbin/makefs/hammer2.c @@ -1582,7 +1582,6 @@ hammer2_inode_setcheck(struct m_vnode *dvp, const char *f) ip = VTOI(vp); assert(ip->meta.type == HAMMER2_OBJTYPE_DIRECTORY); - hammer2_inode_modify(ip); dvp = vp; name = p; @@ -1706,7 +1705,6 @@ hammer2_inode_setcomp(struct m_vnode *dvp, const char *f) ip = VTOI(vp); assert(ip->meta.type == HAMMER2_OBJTYPE_DIRECTORY); - hammer2_inode_modify(ip); dvp = vp; name = p; @@ -1779,13 +1777,14 @@ hammer2_destroy_path(struct m_vnode *dvp, const char *f) ip = VTOI(vp); assert(ip->meta.type == HAMMER2_OBJTYPE_DIRECTORY); - /* XXX When does (or why does not) ioctl modify this inode ? */ - hammer2_inode_modify(ip); dvp = vp; name = p; } + /* XXX When does (or why does not) ioctl modify this inode ? */ + hammer2_inode_modify(VTOI(dvp)); + bzero(&destroy, sizeof(destroy)); destroy.cmd = HAMMER2_DELETE_FILE; snprintf(destroy.path, sizeof(destroy.path), "%s", name); -- 2.11.4.GIT