Fri Jul 29 22:18:57 2011 UTC ()
In ufs_rename, declare oldparent and newparent ino_t, not int.

XXX There should be an automatic test for this somewhere.

ok dholland


(riastradh)
diff -r1.200 -r1.201 src/sys/ufs/ufs/ufs_vnops.c

cvs diff -r1.200 -r1.201 src/sys/ufs/ufs/ufs_vnops.c (expand / switch to unified diff)

--- src/sys/ufs/ufs/ufs_vnops.c 2011/07/18 06:45:47 1.200
+++ src/sys/ufs/ufs/ufs_vnops.c 2011/07/29 22:18:56 1.201
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ufs_vnops.c,v 1.200 2011/07/18 06:45:47 dholland Exp $ */ 1/* $NetBSD: ufs_vnops.c,v 1.201 2011/07/29 22:18:56 riastradh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Wasabi Systems, Inc. 8 * by Wasabi Systems, Inc.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -56,27 +56,27 @@ @@ -56,27 +56,27 @@
56 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 56 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
57 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 57 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
58 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 58 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
59 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 59 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
60 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 60 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
61 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 61 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
62 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 62 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63 * SUCH DAMAGE. 63 * SUCH DAMAGE.
64 * 64 *
65 * @(#)ufs_vnops.c 8.28 (Berkeley) 7/31/95 65 * @(#)ufs_vnops.c 8.28 (Berkeley) 7/31/95
66 */ 66 */
67 67
68#include <sys/cdefs.h> 68#include <sys/cdefs.h>
69__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.200 2011/07/18 06:45:47 dholland Exp $"); 69__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.201 2011/07/29 22:18:56 riastradh Exp $");
70 70
71#if defined(_KERNEL_OPT) 71#if defined(_KERNEL_OPT)
72#include "opt_ffs.h" 72#include "opt_ffs.h"
73#include "opt_quota.h" 73#include "opt_quota.h"
74#endif 74#endif
75 75
76#include <sys/param.h> 76#include <sys/param.h>
77#include <sys/systm.h> 77#include <sys/systm.h>
78#include <sys/namei.h> 78#include <sys/namei.h>
79#include <sys/resourcevar.h> 79#include <sys/resourcevar.h>
80#include <sys/kernel.h> 80#include <sys/kernel.h>
81#include <sys/file.h> 81#include <sys/file.h>
82#include <sys/stat.h> 82#include <sys/stat.h>
@@ -1307,37 +1307,39 @@ ufs_rename(void *v) @@ -1307,37 +1307,39 @@ ufs_rename(void *v)
1307 struct vop_rename_args /* { 1307 struct vop_rename_args /* {
1308 struct vnode *a_fdvp; 1308 struct vnode *a_fdvp;
1309 struct vnode *a_fvp; 1309 struct vnode *a_fvp;
1310 struct componentname *a_fcnp; 1310 struct componentname *a_fcnp;
1311 struct vnode *a_tdvp; 1311 struct vnode *a_tdvp;
1312 struct vnode *a_tvp; 1312 struct vnode *a_tvp;
1313 struct componentname *a_tcnp; 1313 struct componentname *a_tcnp;
1314 } */ *ap = v; 1314 } */ *ap = v;
1315 struct vnode *tvp, *tdvp, *fvp, *fdvp; 1315 struct vnode *tvp, *tdvp, *fvp, *fdvp;
1316 struct componentname *tcnp, *fcnp; 1316 struct componentname *tcnp, *fcnp;
1317 struct inode *ip, *txp, *fxp, *tdp, *fdp; 1317 struct inode *ip, *txp, *fxp, *tdp, *fdp;
1318 struct mount *mp; 1318 struct mount *mp;
1319 struct direct *newdir; 1319 struct direct *newdir;
1320 int doingdirectory, oldparent, newparent, error; 1320 int doingdirectory, error;
 1321 ino_t oldparent, newparent;
1321 1322
1322 struct ufs_lookup_results from_ulr, to_ulr; 1323 struct ufs_lookup_results from_ulr, to_ulr;
1323 1324
1324 tvp = ap->a_tvp; 1325 tvp = ap->a_tvp;
1325 tdvp = ap->a_tdvp; 1326 tdvp = ap->a_tdvp;
1326 fvp = ap->a_fvp; 1327 fvp = ap->a_fvp;
1327 fdvp = ap->a_fdvp; 1328 fdvp = ap->a_fdvp;
1328 tcnp = ap->a_tcnp; 1329 tcnp = ap->a_tcnp;
1329 fcnp = ap->a_fcnp; 1330 fcnp = ap->a_fcnp;
1330 doingdirectory = oldparent = newparent = error = 0; 1331 doingdirectory = error = 0;
 1332 oldparent = newparent = 0;
1331 1333
1332 /* save the supplemental lookup results as they currently exist */ 1334 /* save the supplemental lookup results as they currently exist */
1333 from_ulr = VTOI(fdvp)->i_crap; 1335 from_ulr = VTOI(fdvp)->i_crap;
1334 to_ulr = VTOI(tdvp)->i_crap; 1336 to_ulr = VTOI(tdvp)->i_crap;
1335 UFS_CHECK_CRAPCOUNTER(VTOI(fdvp)); 1337 UFS_CHECK_CRAPCOUNTER(VTOI(fdvp));
1336 UFS_CHECK_CRAPCOUNTER(VTOI(tdvp)); 1338 UFS_CHECK_CRAPCOUNTER(VTOI(tdvp));
1337 1339
1338 /* 1340 /*
1339 * Owing to VFS oddities we are currently called with tdvp/tvp 1341 * Owing to VFS oddities we are currently called with tdvp/tvp
1340 * locked and not fdvp/fvp. In a sane world we'd be passed 1342 * locked and not fdvp/fvp. In a sane world we'd be passed
1341 * tdvp and fdvp only, unlocked, and two name strings. Pretend 1343 * tdvp and fdvp only, unlocked, and two name strings. Pretend
1342 * we have a sane world and unlock tdvp and tvp. 1344 * we have a sane world and unlock tdvp and tvp.
1343 */ 1345 */