Reduce internals of WAPBL exposed to the rest of the system.

This commit is contained in:
joerg 2008-11-10 20:12:13 +00:00
parent 5787d39971
commit 3fbdfc8af9
5 changed files with 42 additions and 24 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: wapbl.c,v 1.2 2008/07/31 05:38:04 simonb Exp $ */
/* $NetBSD: wapbl.c,v 1.3 2008/11/10 20:12:13 joerg Exp $ */
/*-
* Copyright (c) 2005,2008 The NetBSD Foundation, Inc.
@ -31,9 +31,10 @@
/* This file contains fsck support for wapbl
*/
#define WAPBL_INTERNAL
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wapbl.c,v 1.2 2008/07/31 05:38:04 simonb Exp $");
__KERNEL_RCSID(0, "$NetBSD: wapbl.c,v 1.3 2008/11/10 20:12:13 joerg Exp $");
#include <sys/stat.h>
#include <sys/time.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_wapbl.c,v 1.3 2008/08/11 02:45:27 yamt Exp $ */
/* $NetBSD: vfs_wapbl.c,v 1.4 2008/11/10 20:12:13 joerg Exp $ */
/*-
* Copyright (c) 2003,2008 The NetBSD Foundation, Inc.
@ -32,8 +32,11 @@
/*
* This implements file system independent write ahead filesystem logging.
*/
#define WAPBL_INTERNAL
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.3 2008/08/11 02:45:27 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.4 2008/11/10 20:12:13 joerg Exp $");
#include <sys/param.h>
@ -220,6 +223,12 @@ static struct wapbl_ino *wapbl_inodetrk_get(struct wapbl *wl, ino_t ino);
static size_t wapbl_transaction_len(struct wapbl *wl);
static __inline size_t wapbl_transaction_inodes_len(struct wapbl *wl);
#ifdef DEBUG
int wapbl_replay_verify(struct wapbl_replay *, struct vnode *);
#endif
static int wapbl_replay_isopen1(struct wapbl_replay *);
/*
* This is useful for debugging. If set, the log will
* only be truncated when necessary.
@ -2358,9 +2367,10 @@ void
wapbl_replay_stop(struct wapbl_replay *wr)
{
WAPBL_PRINTF(WAPBL_PRINT_REPLAY, ("wapbl_replay_stop called\n"));
if (!wapbl_replay_isopen(wr))
return;
KDASSERT(wapbl_replay_isopen(wr));
WAPBL_PRINTF(WAPBL_PRINT_REPLAY, ("wapbl_replay_stop called\n"));
wapbl_free(wr->wr_scratch);
wr->wr_scratch = 0;
@ -2382,12 +2392,14 @@ wapbl_replay_free(struct wapbl_replay *wr)
wapbl_free(wr);
}
#ifdef _KERNEL
int
wapbl_replay_isopen1(struct wapbl_replay *wr)
{
return wapbl_replay_isopen(wr);
}
#endif
static int
wapbl_replay_prescan(struct wapbl_replay *wr)

View File

@ -1,4 +1,4 @@
/* $NetBSD: wapbl.h,v 1.2 2008/07/31 05:38:06 simonb Exp $ */
/* $NetBSD: wapbl.h,v 1.3 2008/11/10 20:12:13 joerg Exp $ */
/*-
* Copyright (c) 2003,2008 The NetBSD Foundation, Inc.
@ -338,6 +338,7 @@ wapbl_vphaswapbl(struct vnode *vp)
/****************************************************************/
/* Replay support */
#ifdef WAPBL_INTERNAL
struct wapbl_replay {
struct vnode *wr_logvp;
struct vnode *wr_devvp;
@ -361,21 +362,24 @@ struct wapbl_replay {
#define wapbl_replay_isopen(wr) ((wr)->wr_scratch != 0)
int wapbl_replay_isopen1(struct wapbl_replay *);
int wapbl_replay_start(struct wapbl_replay **, struct vnode *,
daddr_t, size_t, size_t);
void wapbl_replay_stop(struct wapbl_replay *);
void wapbl_replay_free(struct wapbl_replay *);
int wapbl_replay_verify(struct wapbl_replay *, struct vnode *);
int wapbl_replay_write(struct wapbl_replay *, struct vnode *);
int wapbl_replay_read(struct wapbl_replay *, void *, daddr_t, long);
/****************************************************************/
/* Supply this to provide i/o support */
int wapbl_write(void *, size_t, struct vnode *, daddr_t);
int wapbl_read(void *, size_t, struct vnode *, daddr_t);
/****************************************************************/
#else
struct wapbl_replay;
#endif /* WAPBL_INTERNAL */
/****************************************************************/
int wapbl_replay_start(struct wapbl_replay **, struct vnode *,
daddr_t, size_t, size_t);
void wapbl_replay_stop(struct wapbl_replay *);
void wapbl_replay_free(struct wapbl_replay *);
int wapbl_replay_write(struct wapbl_replay *, struct vnode *);
int wapbl_replay_read(struct wapbl_replay *, void *, daddr_t, long);
/****************************************************************/
#endif /* !_SYS_WAPBL_H */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_vfsops.c,v 1.239 2008/10/30 17:03:09 joerg Exp $ */
/* $NetBSD: ffs_vfsops.c,v 1.240 2008/11/10 20:12:13 joerg Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.239 2008/10/30 17:03:09 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.240 2008/11/10 20:12:13 joerg Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@ -1325,8 +1325,7 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l)
out:
#ifdef WAPBL
if (mp->mnt_wapbl_replay) {
if (wapbl_replay_isopen(mp->mnt_wapbl_replay))
wapbl_replay_stop(mp->mnt_wapbl_replay);
wapbl_replay_stop(mp->mnt_wapbl_replay);
wapbl_replay_free(mp->mnt_wapbl_replay);
mp->mnt_wapbl_replay = 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_wapbl.c,v 1.6 2008/09/08 03:16:43 joerg Exp $ */
/* $NetBSD: ffs_wapbl.c,v 1.7 2008/11/10 20:12:13 joerg Exp $ */
/*-
* Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc.
@ -30,7 +30,9 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ffs_wapbl.c,v 1.6 2008/09/08 03:16:43 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: ffs_wapbl.c,v 1.7 2008/11/10 20:12:13 joerg Exp $");
#define WAPBL_INTERNAL
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"