summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorpk <pk@NetBSD.org>2003-08-05 15:45:48 +0000
committerpk <pk@NetBSD.org>2003-08-05 15:45:48 +0000
commit918bf35fadd24fd8ecb376039b4cc1cc2ec6b4f6 (patch)
tree71d2e631d3e226b0b9fc0956b6e674116ae04c06 /sys
parente33c0fa9ebfb66cd75af1315944a6513b4c9b9bb (diff)
Pass the inode flags to set as an argument to ufs_dirrewrite().
Use it to restore the behaviour of not updating the modified time of a directory that moves to a new parent.
Diffstat (limited to 'sys')
-rw-r--r--sys/ufs/ufs/ufs_extern.h4
-rw-r--r--sys/ufs/ufs/ufs_lookup.c9
-rw-r--r--sys/ufs/ufs/ufs_vnops.c8
3 files changed, 11 insertions, 10 deletions
diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h
index d2444ca2b85..138ca42b021 100644
--- a/sys/ufs/ufs/ufs_extern.h
+++ b/sys/ufs/ufs/ufs_extern.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_extern.h,v 1.36 2003/06/29 22:32:45 fvdl Exp $ */
+/* $NetBSD: ufs_extern.h,v 1.37 2003/08/05 15:45:48 pk Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -129,7 +129,7 @@ void ufs_makedirentry __P((struct inode *, struct componentname *,
int ufs_direnter __P((struct vnode *, struct vnode *, struct direct *,
struct componentname *, struct buf *));
int ufs_dirremove __P((struct vnode *, struct inode *, int, int));
-int ufs_dirrewrite __P((struct inode *, struct inode *, ino_t, int, int));
+int ufs_dirrewrite __P((struct inode *, struct inode *, ino_t, int, int, int));
int ufs_dirempty __P((struct inode *, ino_t, struct ucred *));
int ufs_checkpath __P((struct inode *, struct inode *, struct ucred *));
diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c
index 9d4688f8823..2e7bbb9f83a 100644
--- a/sys/ufs/ufs/ufs_lookup.c
+++ b/sys/ufs/ufs/ufs_lookup.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_lookup.c,v 1.48 2003/07/23 13:56:53 yamt Exp $ */
+/* $NetBSD: ufs_lookup.c,v 1.49 2003/08/05 15:45:48 pk Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_lookup.c,v 1.48 2003/07/23 13:56:53 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_lookup.c,v 1.49 2003/08/05 15:45:48 pk Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1041,11 +1041,12 @@ out:
* set up by a call to namei.
*/
int
-ufs_dirrewrite(dp, oip, newinum, newtype, isrmdir)
+ufs_dirrewrite(dp, oip, newinum, newtype, isrmdir, iflags)
struct inode *dp, *oip;
ino_t newinum;
int newtype;
int isrmdir;
+ int iflags;
{
struct buf *bp;
struct direct *ep;
@@ -1069,7 +1070,7 @@ ufs_dirrewrite(dp, oip, newinum, newtype, isrmdir)
oip->i_flag |= IN_CHANGE;
error = VOP_BWRITE(bp);
}
- dp->i_flag |= IN_CHANGE | IN_UPDATE;
+ dp->i_flag |= iflags;
return (error);
}
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 5697062dfa8..1b6a0917d2c 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_vnops.c,v 1.102 2003/06/29 22:32:48 fvdl Exp $ */
+/* $NetBSD: ufs_vnops.c,v 1.103 2003/08/05 15:45:48 pk Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993, 1995
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.102 2003/06/29 22:32:48 fvdl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.103 2003/08/05 15:45:48 pk Exp $");
#ifndef _LKM
#include "opt_quota.h"
@@ -1101,7 +1101,7 @@ ufs_rename(void *v)
}
if ((error = ufs_dirrewrite(dp, xp, ip->i_number,
IFTODT(ip->i_mode), doingdirectory && newparent ?
- newparent : doingdirectory)) != 0)
+ newparent : doingdirectory, IN_CHANGE|IN_UPDATE)) != 0)
goto bad;
if (doingdirectory) {
if (!newparent) {
@@ -1186,7 +1186,7 @@ ufs_rename(void *v)
*/
if (doingdirectory && newparent) {
xp->i_offset = mastertemplate.dot_reclen;
- ufs_dirrewrite(xp, dp, newparent, DT_DIR, 0);
+ ufs_dirrewrite(xp, dp, newparent, DT_DIR, 0, IN_CHANGE);
cache_purge(fdvp);
}
error = ufs_dirremove(fdvp, xp, fcnp->cn_flags, 0);