Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/lfs Use accessors for some more indirect block manip...
details: https://anonhg.NetBSD.org/src/rev/88609b1c27d2
branches: trunk
changeset: 340918:88609b1c27d2
user: dholland <dholland%NetBSD.org@localhost>
date: Sat Oct 10 22:33:31 2015 +0000
description:
Use accessors for some more indirect block manipulations.
diffstat:
sys/ufs/lfs/lfs_balloc.c | 17 +++++++----------
sys/ufs/lfs/lfs_segment.c | 17 ++++++++---------
2 files changed, 15 insertions(+), 19 deletions(-)
diffs (91 lines):
diff -r 7efc3bc248bb -r 88609b1c27d2 sys/ufs/lfs/lfs_balloc.c
--- a/sys/ufs/lfs/lfs_balloc.c Sat Oct 10 19:35:15 2015 +0000
+++ b/sys/ufs/lfs/lfs_balloc.c Sat Oct 10 22:33:31 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_balloc.c,v 1.87 2015/09/01 06:08:37 dholland Exp $ */
+/* $NetBSD: lfs_balloc.c,v 1.88 2015/10/10 22:33:31 dholland Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_balloc.c,v 1.87 2015/09/01 06:08:37 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_balloc.c,v 1.88 2015/10/10 22:33:31 dholland Exp $");
#if defined(_KERNEL_OPT)
#include "opt_quota.h"
@@ -271,12 +271,10 @@
* If that is the case mark it UNWRITTEN to keep
* the accounting straight.
*/
- /* XXX ondisk32 */
- if (((int32_t *)ibp->b_data)[indirs[i].in_off] == 0)
- ((int32_t *)ibp->b_data)[indirs[i].in_off] =
- UNWRITTEN;
- /* XXX ondisk32 */
- idaddr = ((int32_t *)ibp->b_data)[indirs[i].in_off];
+ if (lfs_iblock_get(fs, ibp->b_data, indirs[i].in_off) == 0)
+ lfs_iblock_set(fs, ibp->b_data, indirs[i].in_off,
+ UNWRITTEN);
+ idaddr = lfs_iblock_get(fs, ibp->b_data, indirs[i].in_off);
#ifdef DEBUG
if (vp == fs->lfs_ivnode) {
LFS_ENTER_LOG("balloc", __FILE__,
@@ -333,8 +331,7 @@
B_MODIFY, &ibp))
panic("lfs_balloc: bread bno %lld",
(long long)idp->in_lbn);
- /* XXX ondisk32 */
- ((int32_t *)ibp->b_data)[idp->in_off] = UNWRITTEN;
+ lfs_iblock_set(fs, ibp->b_data, idp->in_off, UNWRITTEN);
#ifdef DEBUG
if (vp == fs->lfs_ivnode) {
LFS_ENTER_LOG("balloc", __FILE__,
diff -r 7efc3bc248bb -r 88609b1c27d2 sys/ufs/lfs/lfs_segment.c
--- a/sys/ufs/lfs/lfs_segment.c Sat Oct 10 19:35:15 2015 +0000
+++ b/sys/ufs/lfs/lfs_segment.c Sat Oct 10 22:33:31 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_segment.c,v 1.260 2015/10/03 08:28:16 dholland Exp $ */
+/* $NetBSD: lfs_segment.c,v 1.261 2015/10/10 22:33:31 dholland Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.260 2015/10/03 08:28:16 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.261 2015/10/10 22:33:31 dholland Exp $");
#ifdef DEBUG
# define vndebug(vp, str) do { \
@@ -2035,7 +2035,7 @@
struct vnode *devvp;
char *p = NULL;
struct vnode *vp;
- int32_t *daddrp; /* XXX ondisk32 */
+ unsigned ibindex, iblimit;
int changed;
u_int32_t sum;
size_t sumstart;
@@ -2162,13 +2162,12 @@
newbp->b_bcount);
changed = 0;
- /* XXX ondisk32 */
- for (daddrp = (int32_t *)(newbp->b_data);
- daddrp < (int32_t *)((char *)newbp->b_data +
- newbp->b_bcount); daddrp++) {
- if (*daddrp == UNWRITTEN) {
+ iblimit = newbp->b_bcount / LFS_BLKPTRSIZE(fs);
+ for (ibindex = 0; ibindex < iblimit; ibindex++) {
+ if (lfs_iblock_get(fs, newbp->b_data, ibindex) == UNWRITTEN) {
++changed;
- *daddrp = 0;
+ lfs_iblock_set(fs, newbp->b_data,
+ ibindex, 0);
}
}
/*
Home |
Main Index |
Thread Index |
Old Index