Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/lfs mp->mnt_wapbl and mp->mnt_wapbl_replay are alway...



details:   https://anonhg.NetBSD.org/src/rev/03d4479f9cd8
branches:  trunk
changeset: 787260:03d4479f9cd8
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sat Jun 08 21:40:27 2013 +0000

description:
mp->mnt_wapbl and mp->mnt_wapbl_replay are always NULL in here.

diffstat:

 sys/ufs/lfs/ulfs_inode.c  |  31 +----------------------
 sys/ufs/lfs/ulfs_quota1.c |  10 +------
 sys/ufs/lfs/ulfs_vnops.c  |  53 ++--------------------------------------
 sys/ufs/lfs/ulfs_wapbl.h  |  61 ++++++----------------------------------------
 4 files changed, 16 insertions(+), 139 deletions(-)

diffs (258 lines):

diff -r e90d60c7c624 -r 03d4479f9cd8 sys/ufs/lfs/ulfs_inode.c
--- a/sys/ufs/lfs/ulfs_inode.c  Sat Jun 08 21:15:29 2013 +0000
+++ b/sys/ufs/lfs/ulfs_inode.c  Sat Jun 08 21:40:27 2013 +0000
@@ -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 @@
                        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);
                }
diff -r e90d60c7c624 -r 03d4479f9cd8 sys/ufs/lfs/ulfs_quota1.c
--- a/sys/ufs/lfs/ulfs_quota1.c Sat Jun 08 21:15:29 2013 +0000
+++ b/sys/ufs/lfs/ulfs_quota1.c Sat Jun 08 21:40:27 2013 +0000
@@ -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 @@
                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);
diff -r e90d60c7c624 -r 03d4479f9cd8 sys/ufs/lfs/ulfs_vnops.c
--- a/sys/ufs/lfs/ulfs_vnops.c  Sat Jun 08 21:15:29 2013 +0000
+++ b/sys/ufs/lfs/ulfs_vnops.c  Sat Jun 08 21:40:27 2013 +0000
@@ -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 @@
                        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 @@
        struct buf      *bp;
        struct vnode    *vp;
        struct inode    *ip;
-       struct mount    *mp;
        int             error;
 
        bp = ap->a_bp;
@@ -1500,26 +1472,7 @@
        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;
 }
 
 /*
diff -r e90d60c7c624 -r 03d4479f9cd8 sys/ufs/lfs/ulfs_wapbl.h
--- a/sys/ufs/lfs/ulfs_wapbl.h  Sat Jun 08 21:15:29 2013 +0000
+++ b/sys/ufs/lfs/ulfs_wapbl.h  Sat Jun 08 21:40:27 2013 +0000
@@ -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 @@
 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_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_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_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



Home | Main Index | Thread Index | Old Index