xfs
[Top] [All Lists]

[PATCH 3/3] xfs: remove the lid_size field in struct log_item_desc

To: xfs@xxxxxxxxxxx
Subject: [PATCH 3/3] xfs: remove the lid_size field in struct log_item_desc
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 28 Nov 2011 03:25:25 -0500
References: <20111128082522.224645690@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: quilt/0.48-1
Outside the now removed nodelaylog code this field is only used for
asserts and can be safely removed now.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>

---
 fs/xfs/xfs_dquot_item.c |    1 -
 fs/xfs/xfs_inode_item.c |    2 --
 fs/xfs/xfs_log_cil.c    |    9 +++++----
 fs/xfs/xfs_trans.c      |    1 -
 fs/xfs/xfs_trans.h      |    3 +--
 5 files changed, 6 insertions(+), 10 deletions(-)

Index: xfs/fs/xfs/xfs_dquot_item.c
===================================================================
--- xfs.orig/fs/xfs/xfs_dquot_item.c    2011-11-28 09:21:33.172090810 +0100
+++ xfs/fs/xfs/xfs_dquot_item.c 2011-11-28 09:21:40.595383928 +0100
@@ -73,7 +73,6 @@ xfs_qm_dquot_logitem_format(
        logvec->i_len  = sizeof(xfs_disk_dquot_t);
        logvec->i_type = XLOG_REG_TYPE_DQUOT;
 
-       ASSERT(2 == lip->li_desc->lid_size);
        qlip->qli_format.qlf_size = 2;
 
 }
Index: xfs/fs/xfs/xfs_inode_item.c
===================================================================
--- xfs.orig/fs/xfs/xfs_inode_item.c    2011-11-28 09:21:33.182090756 +0100
+++ xfs/fs/xfs/xfs_inode_item.c 2011-11-28 09:21:40.595383928 +0100
@@ -437,7 +437,6 @@ xfs_inode_item_format(
         * Assert that no attribute-related log flags are set.
         */
        if (!XFS_IFORK_Q(ip)) {
-               ASSERT(nvecs == lip->li_desc->lid_size);
                iip->ili_format.ilf_size = nvecs;
                ASSERT(!(iip->ili_format.ilf_fields &
                         (XFS_ILOG_ADATA | XFS_ILOG_ABROOT | XFS_ILOG_AEXT)));
@@ -521,7 +520,6 @@ xfs_inode_item_format(
                break;
        }
 
-       ASSERT(nvecs == lip->li_desc->lid_size);
        iip->ili_format.ilf_size = nvecs;
 }
 
Index: xfs/fs/xfs/xfs_log_cil.c
===================================================================
--- xfs.orig/fs/xfs/xfs_log_cil.c       2011-11-28 09:21:33.195424016 +0100
+++ xfs/fs/xfs/xfs_log_cil.c    2011-11-28 09:21:40.595383928 +0100
@@ -185,23 +185,24 @@ xlog_cil_prepare_log_vecs(
                void    *ptr;
                int     index;
                int     len = 0;
+               uint    niovecs;
 
                /* Skip items which aren't dirty in this transaction. */
                if (!(lidp->lid_flags & XFS_LID_DIRTY))
                        continue;
 
                /* Skip items that do not have any vectors for writing */
-               lidp->lid_size = IOP_SIZE(lidp->lid_item);
-               if (!lidp->lid_size)
+               niovecs = IOP_SIZE(lidp->lid_item);
+               if (!niovecs)
                        continue;
 
                new_lv = kmem_zalloc(sizeof(*new_lv) +
-                               lidp->lid_size * sizeof(struct xfs_log_iovec),
+                               niovecs * sizeof(struct xfs_log_iovec),
                                KM_SLEEP);
 
                /* The allocated iovec region lies beyond the log vector. */
                new_lv->lv_iovecp = (struct xfs_log_iovec *)&new_lv[1];
-               new_lv->lv_niovecs = lidp->lid_size;
+               new_lv->lv_niovecs = niovecs;
                new_lv->lv_item = lidp->lid_item;
 
                /* build the vector array and calculate it's length */
Index: xfs/fs/xfs/xfs_trans.c
===================================================================
--- xfs.orig/fs/xfs/xfs_trans.c 2011-11-28 09:21:33.205423962 +0100
+++ xfs/fs/xfs/xfs_trans.c      2011-11-28 09:21:40.598717244 +0100
@@ -1158,7 +1158,6 @@ xfs_trans_add_item(
 
        lidp->lid_item = lip;
        lidp->lid_flags = 0;
-       lidp->lid_size = 0;
        list_add_tail(&lidp->lid_trans, &tp->t_items);
 
        lip->li_desc = lidp;
Index: xfs/fs/xfs/xfs_trans.h
===================================================================
--- xfs.orig/fs/xfs/xfs_trans.h 2011-11-28 09:21:33.222090538 +0100
+++ xfs/fs/xfs/xfs_trans.h      2011-11-28 09:21:40.598717244 +0100
@@ -163,9 +163,8 @@ typedef struct xfs_trans_header {
  */
 struct xfs_log_item_desc {
        struct xfs_log_item     *lid_item;
-       ushort                  lid_size;
-       unsigned char           lid_flags;
        struct list_head        lid_trans;
+       unsigned char           lid_flags;
 };
 
 #define XFS_LID_DIRTY          0x1

<Prev in Thread] Current Thread [Next in Thread>