Module Name: src Committed By: dholland Date: Sat Jun 8 21:40:27 UTC 2013
Modified Files: src/sys/ufs/lfs: ulfs_inode.c ulfs_quota1.c ulfs_vnops.c ulfs_wapbl.h Log Message: mp->mnt_wapbl and mp->mnt_wapbl_replay are always NULL in here. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/ufs/lfs/ulfs_inode.c cvs rdiff -u -r1.4 -r1.5 src/sys/ufs/lfs/ulfs_quota1.c cvs rdiff -u -r1.10 -r1.11 src/sys/ufs/lfs/ulfs_vnops.c cvs rdiff -u -r1.2 -r1.3 src/sys/ufs/lfs/ulfs_wapbl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/ufs/lfs/ulfs_inode.c diff -u src/sys/ufs/lfs/ulfs_inode.c:1.5 src/sys/ufs/lfs/ulfs_inode.c:1.6 --- src/sys/ufs/lfs/ulfs_inode.c:1.5 Thu Jun 6 00:49:28 2013 +++ src/sys/ufs/lfs/ulfs_inode.c Sat Jun 8 21:40:27 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ulfs_inode.c,v 1.5 2013/06/06 00:49:28 dholland Exp $ */ +/* $NetBSD: ulfs_inode.c,v 1.6 2013/06/08 21:40:27 dholland Exp $ */ /* from NetBSD: ufs_inode.c,v 1.89 2013/01/22 09:39:18 dholland Exp */ /* @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ulfs_inode.c,v 1.5 2013/06/06 00:49:28 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ulfs_inode.c,v 1.6 2013/06/08 21:40:27 dholland Exp $"); #if defined(_KERNEL_OPT) #include "opt_lfs.h" @@ -108,33 +108,6 @@ ulfs_inactive(void *v) goto out; logged = 1; if (ip->i_size != 0) { - /* - * When journaling, only truncate one indirect block - * at a time - */ - if (vp->v_mount->mnt_wapbl) { - uint64_t incr = MNINDIR(ip->i_ump) << - vp->v_mount->mnt_fs_bshift; /* Power of 2 */ - uint64_t base = ULFS_NDADDR << - vp->v_mount->mnt_fs_bshift; - while (!error && ip->i_size > base + incr) { - /* - * round down to next full indirect - * block boundary. - */ - uint64_t nsize = base + - ((ip->i_size - base - 1) & - ~(incr - 1)); - error = ULFS_TRUNCATE(vp, nsize, 0, - NOCRED); - if (error) - break; - ULFS_WAPBL_END(vp->v_mount); - error = ULFS_WAPBL_BEGIN(vp->v_mount); - if (error) - goto out; - } - } if (!error) error = ULFS_TRUNCATE(vp, (off_t)0, 0, NOCRED); } Index: src/sys/ufs/lfs/ulfs_quota1.c diff -u src/sys/ufs/lfs/ulfs_quota1.c:1.4 src/sys/ufs/lfs/ulfs_quota1.c:1.5 --- src/sys/ufs/lfs/ulfs_quota1.c:1.4 Thu Jun 6 00:49:28 2013 +++ src/sys/ufs/lfs/ulfs_quota1.c Sat Jun 8 21:40:27 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ulfs_quota1.c,v 1.4 2013/06/06 00:49:28 dholland Exp $ */ +/* $NetBSD: ulfs_quota1.c,v 1.5 2013/06/08 21:40:27 dholland Exp $ */ /* from NetBSD: ufs_quota1.c,v 1.18 2012/02/02 03:00:48 matt Exp */ /* @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ulfs_quota1.c,v 1.4 2013/06/06 00:49:28 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ulfs_quota1.c,v 1.5 2013/06/08 21:40:27 dholland Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -317,12 +317,6 @@ lfsquota1_handle_cmd_quotaon(struct lwp return (EBUSY); } - if (mp->mnt_wapbl != NULL) { - printf("%s: quota v1 cannot be used with -o log\n", - mp->mnt_stat.f_mntonname); - return (EOPNOTSUPP); - } - vpp = &ump->um_quotas[type]; pb = pathbuf_create(fname); Index: src/sys/ufs/lfs/ulfs_vnops.c diff -u src/sys/ufs/lfs/ulfs_vnops.c:1.10 src/sys/ufs/lfs/ulfs_vnops.c:1.11 --- src/sys/ufs/lfs/ulfs_vnops.c:1.10 Sat Jun 8 20:43:35 2013 +++ src/sys/ufs/lfs/ulfs_vnops.c Sat Jun 8 21:40:27 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ulfs_vnops.c,v 1.10 2013/06/08 20:43:35 dholland Exp $ */ +/* $NetBSD: ulfs_vnops.c,v 1.11 2013/06/08 21:40:27 dholland Exp $ */ /* from NetBSD: ufs_vnops.c,v 1.213 2013/06/08 05:47:02 kardel Exp */ /*- @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ulfs_vnops.c,v 1.10 2013/06/08 20:43:35 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ulfs_vnops.c,v 1.11 2013/06/08 21:40:27 dholland Exp $"); #if defined(_KERNEL_OPT) #include "opt_lfs.h" @@ -577,33 +577,6 @@ ulfs_setattr(void *v) error = ULFS_WAPBL_BEGIN(vp->v_mount); if (error) goto out; - /* - * When journaling, only truncate one indirect block - * at a time. - */ - if (vp->v_mount->mnt_wapbl) { - uint64_t incr = MNINDIR(ip->i_ump) << - vp->v_mount->mnt_fs_bshift; /* Power of 2 */ - uint64_t base = ULFS_NDADDR << - vp->v_mount->mnt_fs_bshift; - while (!error && ip->i_size > base + incr && - ip->i_size > vap->va_size + incr) { - /* - * round down to next full indirect - * block boundary. - */ - uint64_t nsize = base + - ((ip->i_size - base - 1) & - ~(incr - 1)); - error = ULFS_TRUNCATE(vp, nsize, 0, - cred); - if (error == 0) { - ULFS_WAPBL_END(vp->v_mount); - error = - ULFS_WAPBL_BEGIN(vp->v_mount); - } - } - } if (!error) error = ULFS_TRUNCATE(vp, vap->va_size, 0, cred); ULFS_WAPBL_END(vp->v_mount); @@ -1470,7 +1443,6 @@ ulfs_strategy(void *v) struct buf *bp; struct vnode *vp; struct inode *ip; - struct mount *mp; int error; bp = ap->a_bp; @@ -1500,26 +1472,7 @@ ulfs_strategy(void *v) if (error) return error; - if (!BUF_ISREAD(bp)) - return 0; - - mp = wapbl_vptomp(vp); - if (mp == NULL || mp->mnt_wapbl_replay == NULL || - !WAPBL_REPLAY_ISOPEN(mp) || - !WAPBL_REPLAY_CAN_READ(mp, bp->b_blkno, bp->b_bcount)) - return 0; - - error = biowait(bp); - if (error) - return error; - - error = WAPBL_REPLAY_READ(mp, bp->b_data, bp->b_blkno, bp->b_bcount); - if (error) { - mutex_enter(&bufcache_lock); - SET(bp->b_cflags, BC_INVAL); - mutex_exit(&bufcache_lock); - } - return error; + return 0; } /* Index: src/sys/ufs/lfs/ulfs_wapbl.h diff -u src/sys/ufs/lfs/ulfs_wapbl.h:1.2 src/sys/ufs/lfs/ulfs_wapbl.h:1.3 --- src/sys/ufs/lfs/ulfs_wapbl.h:1.2 Thu Jun 6 00:48:04 2013 +++ src/sys/ufs/lfs/ulfs_wapbl.h Sat Jun 8 21:40:27 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ulfs_wapbl.h,v 1.2 2013/06/06 00:48:04 dholland Exp $ */ +/* $NetBSD: ulfs_wapbl.h,v 1.3 2013/06/08 21:40:27 dholland Exp $ */ /* from NetBSD: ufs_wapbl.h,v 1.7 2011/09/19 11:18:01 gdt Exp */ /*- @@ -99,69 +99,26 @@ static __inline int ulfs_wapbl_begin2(struct mount *mp, struct vnode *vp1, struct vnode *vp2, const char *file, int line) { - if (mp->mnt_wapbl) { - int error; - - if (vp1) - vref(vp1); - if (vp2) - vref(vp2); - error = wapbl_begin(mp->mnt_wapbl, file, line); - if (error) - return error; -#ifdef WAPBL_DEBUG_INODES - if (mp->mnt_wapbl->wl_lock.lk_exclusivecount == 1) - ulfs_wapbl_verify_inodes(mp, "wapbl_begin"); -#endif - } return 0; } static __inline void ulfs_wapbl_end2(struct mount *mp, struct vnode *vp1, struct vnode *vp2) { - if (mp->mnt_wapbl) { -#ifdef WAPBL_DEBUG_INODES - if (mp->mnt_wapbl->wl_lock.lk_exclusivecount == 1) - ulfs_wapbl_verify_inodes(mp, "wapbl_end"); -#endif - wapbl_end(mp->mnt_wapbl); - if (vp2) - vrele(vp2); - if (vp1) - vrele(vp1); - } } -#define ULFS_WAPBL_BEGIN(mp) \ - ulfs_wapbl_begin2(mp, NULL, NULL, __FUNCTION__, __LINE__) -#define ULFS_WAPBL_BEGIN1(mp, v1) \ - ulfs_wapbl_begin2(mp, v1, NULL, __FUNCTION__, __LINE__) -#define ULFS_WAPBL_END(mp) ulfs_wapbl_end2(mp, NULL, NULL) -#define ULFS_WAPBL_END1(mp, v1) ulfs_wapbl_end2(mp, v1, NULL) - -#define ULFS_WAPBL_UPDATE(vp, access, modify, flags) \ - if ((vp)->v_mount->mnt_wapbl) { \ - ULFS_UPDATE(vp, access, modify, flags); \ - } - -#ifdef ULFS_WAPBL_DEBUG_JLOCK -#define ULFS_WAPBL_JLOCK_ASSERT(mp) \ - if (mp->mnt_wapbl) wapbl_jlock_assert(mp->mnt_wapbl) -#define ULFS_WAPBL_JUNLOCK_ASSERT(mp) \ - if (mp->mnt_wapbl) wapbl_junlock_assert(mp->mnt_wapbl) -#else +#define ULFS_WAPBL_BEGIN(mp) 0 +#define ULFS_WAPBL_BEGIN1(mp, v1) 0 +#define ULFS_WAPBL_END(mp) do { } while (0) +#define ULFS_WAPBL_END1(mp, v1) +#define ULFS_WAPBL_UPDATE(vp, access, modify, flags) do { } while (0) + #define ULFS_WAPBL_JLOCK_ASSERT(mp) #define ULFS_WAPBL_JUNLOCK_ASSERT(mp) -#endif -#define ULFS_WAPBL_REGISTER_INODE(mp, ino, mode) \ - if (mp->mnt_wapbl) wapbl_register_inode(mp->mnt_wapbl, ino, mode) -#define ULFS_WAPBL_UNREGISTER_INODE(mp, ino, mode) \ - if (mp->mnt_wapbl) wapbl_unregister_inode(mp->mnt_wapbl, ino, mode) - -#define ULFS_WAPBL_REGISTER_DEALLOCATION(mp, blk, len) \ - if (mp->mnt_wapbl) wapbl_register_deallocation(mp->mnt_wapbl, blk, len) +#define ULFS_WAPBL_REGISTER_INODE(mp, ino, mode) do { } while (0) +#define ULFS_WAPBL_UNREGISTER_INODE(mp, ino, mode) do { } while (0) +#define ULFS_WAPBL_REGISTER_DEALLOCATION(mp, blk, len) #else /* ! WAPBL */ #define ULFS_WAPBL_BEGIN(mp) 0