SCCS-vsn: sys/ufs/ffs/ffs_vnops.c 7.46
SCCS-vsn: sys/ufs/ffs/ufs_vnops.c 7.46
SCCS-vsn: sys/ufs/lfs/lfs_vnops.c 7.46
SCCS-vsn: sys/ufs/ufs/ufs_vnops.c 7.46
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ffs_vnops.c 7.45 (Berkeley) %G%
+ * @(#)ffs_vnops.c 7.46 (Berkeley) %G%
}
if (error = dirrewrite(dp, ip, tndp))
goto bad;
}
if (error = dirrewrite(dp, ip, tndp))
goto bad;
+ /*
+ * If the target directory is in the same
+ * directory as the source directory,
+ * decrement the link count on the parent
+ * of the target directory.
+ */
+ if (doingdirectory && !newparent) {
+ dp->i_nlink--;
+ dp->i_flag |= ICHG;
+ }
vput(ITOV(dp));
/*
* Adjust the link count of the target to
vput(ITOV(dp));
/*
* Adjust the link count of the target to
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ufs_vnops.c 7.45 (Berkeley) %G%
+ * @(#)ufs_vnops.c 7.46 (Berkeley) %G%
}
if (error = dirrewrite(dp, ip, tndp))
goto bad;
}
if (error = dirrewrite(dp, ip, tndp))
goto bad;
+ /*
+ * If the target directory is in the same
+ * directory as the source directory,
+ * decrement the link count on the parent
+ * of the target directory.
+ */
+ if (doingdirectory && !newparent) {
+ dp->i_nlink--;
+ dp->i_flag |= ICHG;
+ }
vput(ITOV(dp));
/*
* Adjust the link count of the target to
vput(ITOV(dp));
/*
* Adjust the link count of the target to
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)lfs_vnops.c 7.45 (Berkeley) %G%
+ * @(#)lfs_vnops.c 7.46 (Berkeley) %G%
}
if (error = dirrewrite(dp, ip, tndp))
goto bad;
}
if (error = dirrewrite(dp, ip, tndp))
goto bad;
+ /*
+ * If the target directory is in the same
+ * directory as the source directory,
+ * decrement the link count on the parent
+ * of the target directory.
+ */
+ if (doingdirectory && !newparent) {
+ dp->i_nlink--;
+ dp->i_flag |= ICHG;
+ }
vput(ITOV(dp));
/*
* Adjust the link count of the target to
vput(ITOV(dp));
/*
* Adjust the link count of the target to
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ufs_vnops.c 7.45 (Berkeley) %G%
+ * @(#)ufs_vnops.c 7.46 (Berkeley) %G%
}
if (error = dirrewrite(dp, ip, tndp))
goto bad;
}
if (error = dirrewrite(dp, ip, tndp))
goto bad;
+ /*
+ * If the target directory is in the same
+ * directory as the source directory,
+ * decrement the link count on the parent
+ * of the target directory.
+ */
+ if (doingdirectory && !newparent) {
+ dp->i_nlink--;
+ dp->i_flag |= ICHG;
+ }
vput(ITOV(dp));
/*
* Adjust the link count of the target to
vput(ITOV(dp));
/*
* Adjust the link count of the target to