xfs: remove transaction types
authorChristoph Hellwig <hch@lst.de>
Tue, 5 Apr 2016 23:20:36 +0000 (09:20 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 5 Apr 2016 23:20:36 +0000 (09:20 +1000)
These aren't used for CIL-style logging and can be dropped.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/libxfs/xfs_log_format.h
fs/xfs/libxfs/xfs_shared.h
fs/xfs/xfs_log.c
fs/xfs/xfs_log.h
fs/xfs/xfs_log_cil.c
fs/xfs/xfs_log_priv.h
fs/xfs/xfs_trace.h
fs/xfs/xfs_trans.c

index d54a8018b079dd3f0c078e5fdf56cf48a151a545..e8f49c029ff05098ddc91eeeffe5ba7102eff77f 100644 (file)
@@ -211,6 +211,11 @@ typedef struct xfs_trans_header {
 
 #define        XFS_TRANS_HEADER_MAGIC  0x5452414e      /* TRAN */
 
+/*
+ * The only type valid for th_type in CIL-enabled file system logs:
+ */
+#define XFS_TRANS_CHECKPOINT   40
+
 /*
  * Log item types.
  */
index 7d4ab6439081bdb0eef14d8f085ca3521ad50d97..16002b5ec4eb82c2988fc6f559f0e3ed995ec1e9 100644 (file)
@@ -55,103 +55,6 @@ extern const struct xfs_buf_ops xfs_sb_quiet_buf_ops;
 extern const struct xfs_buf_ops xfs_symlink_buf_ops;
 extern const struct xfs_buf_ops xfs_rtbuf_ops;
 
-/*
- * Transaction types.  Used to distinguish types of buffers. These never reach
- * the log.
- */
-#define XFS_TRANS_SETATTR_NOT_SIZE     1
-#define XFS_TRANS_SETATTR_SIZE         2
-#define XFS_TRANS_INACTIVE             3
-#define XFS_TRANS_CREATE               4
-#define XFS_TRANS_CREATE_TRUNC         5
-#define XFS_TRANS_TRUNCATE_FILE                6
-#define XFS_TRANS_REMOVE               7
-#define XFS_TRANS_LINK                 8
-#define XFS_TRANS_RENAME               9
-#define XFS_TRANS_MKDIR                        10
-#define XFS_TRANS_RMDIR                        11
-#define XFS_TRANS_SYMLINK              12
-#define XFS_TRANS_SET_DMATTRS          13
-#define XFS_TRANS_GROWFS               14
-#define XFS_TRANS_STRAT_WRITE          15
-#define XFS_TRANS_DIOSTRAT             16
-/* 17 was XFS_TRANS_WRITE_SYNC */
-#define        XFS_TRANS_WRITEID               18
-#define        XFS_TRANS_ADDAFORK              19
-#define        XFS_TRANS_ATTRINVAL             20
-#define        XFS_TRANS_ATRUNCATE             21
-#define        XFS_TRANS_ATTR_SET              22
-#define        XFS_TRANS_ATTR_RM               23
-#define        XFS_TRANS_ATTR_FLAG             24
-#define        XFS_TRANS_CLEAR_AGI_BUCKET      25
-#define XFS_TRANS_SB_CHANGE            26
-/*
- * Dummy entries since we use the transaction type to index into the
- * trans_type[] in xlog_recover_print_trans_head()
- */
-#define XFS_TRANS_DUMMY1               27
-#define XFS_TRANS_DUMMY2               28
-#define XFS_TRANS_QM_QUOTAOFF          29
-#define XFS_TRANS_QM_DQALLOC           30
-#define XFS_TRANS_QM_SETQLIM           31
-#define XFS_TRANS_QM_DQCLUSTER         32
-#define XFS_TRANS_QM_QINOCREATE                33
-#define XFS_TRANS_QM_QUOTAOFF_END      34
-#define XFS_TRANS_FSYNC_TS             35
-#define        XFS_TRANS_GROWFSRT_ALLOC        36
-#define        XFS_TRANS_GROWFSRT_ZERO         37
-#define        XFS_TRANS_GROWFSRT_FREE         38
-#define        XFS_TRANS_SWAPEXT               39
-#define        XFS_TRANS_CHECKPOINT            40
-#define        XFS_TRANS_ICREATE               41
-#define        XFS_TRANS_CREATE_TMPFILE        42
-#define        XFS_TRANS_TYPE_MAX              43
-/* new transaction types need to be reflected in xfs_logprint(8) */
-
-#define XFS_TRANS_TYPES \
-       { XFS_TRANS_SETATTR_NOT_SIZE,   "SETATTR_NOT_SIZE" }, \
-       { XFS_TRANS_SETATTR_SIZE,       "SETATTR_SIZE" }, \
-       { XFS_TRANS_INACTIVE,           "INACTIVE" }, \
-       { XFS_TRANS_CREATE,             "CREATE" }, \
-       { XFS_TRANS_CREATE_TRUNC,       "CREATE_TRUNC" }, \
-       { XFS_TRANS_TRUNCATE_FILE,      "TRUNCATE_FILE" }, \
-       { XFS_TRANS_REMOVE,             "REMOVE" }, \
-       { XFS_TRANS_LINK,               "LINK" }, \
-       { XFS_TRANS_RENAME,             "RENAME" }, \
-       { XFS_TRANS_MKDIR,              "MKDIR" }, \
-       { XFS_TRANS_RMDIR,              "RMDIR" }, \
-       { XFS_TRANS_SYMLINK,            "SYMLINK" }, \
-       { XFS_TRANS_SET_DMATTRS,        "SET_DMATTRS" }, \
-       { XFS_TRANS_GROWFS,             "GROWFS" }, \
-       { XFS_TRANS_STRAT_WRITE,        "STRAT_WRITE" }, \
-       { XFS_TRANS_DIOSTRAT,           "DIOSTRAT" }, \
-       { XFS_TRANS_WRITEID,            "WRITEID" }, \
-       { XFS_TRANS_ADDAFORK,           "ADDAFORK" }, \
-       { XFS_TRANS_ATTRINVAL,          "ATTRINVAL" }, \
-       { XFS_TRANS_ATRUNCATE,          "ATRUNCATE" }, \
-       { XFS_TRANS_ATTR_SET,           "ATTR_SET" }, \
-       { XFS_TRANS_ATTR_RM,            "ATTR_RM" }, \
-       { XFS_TRANS_ATTR_FLAG,          "ATTR_FLAG" }, \
-       { XFS_TRANS_CLEAR_AGI_BUCKET,   "CLEAR_AGI_BUCKET" }, \
-       { XFS_TRANS_SB_CHANGE,          "SBCHANGE" }, \
-       { XFS_TRANS_DUMMY1,             "DUMMY1" }, \
-       { XFS_TRANS_DUMMY2,             "DUMMY2" }, \
-       { XFS_TRANS_QM_QUOTAOFF,        "QM_QUOTAOFF" }, \
-       { XFS_TRANS_QM_DQALLOC,         "QM_DQALLOC" }, \
-       { XFS_TRANS_QM_SETQLIM,         "QM_SETQLIM" }, \
-       { XFS_TRANS_QM_DQCLUSTER,       "QM_DQCLUSTER" }, \
-       { XFS_TRANS_QM_QINOCREATE,      "QM_QINOCREATE" }, \
-       { XFS_TRANS_QM_QUOTAOFF_END,    "QM_QOFF_END" }, \
-       { XFS_TRANS_FSYNC_TS,           "FSYNC_TS" }, \
-       { XFS_TRANS_GROWFSRT_ALLOC,     "GROWFSRT_ALLOC" }, \
-       { XFS_TRANS_GROWFSRT_ZERO,      "GROWFSRT_ZERO" }, \
-       { XFS_TRANS_GROWFSRT_FREE,      "GROWFSRT_FREE" }, \
-       { XFS_TRANS_SWAPEXT,            "SWAPEXT" }, \
-       { XFS_TRANS_CHECKPOINT,         "CHECKPOINT" }, \
-       { XFS_TRANS_ICREATE,            "ICREATE" }, \
-       { XFS_TRANS_CREATE_TMPFILE,     "CREATE_TMPFILE" }, \
-       { XLOG_UNMOUNT_REC_TYPE,        "UNMOUNT" }
-
 /*
  * This structure is used to track log items associated with
  * a transaction.  It points to the log item and keeps some
index b49ccf5c1d7564402c39671c4e67b7cf92ab8082..268f7d65cfd421b8b22cb610b77ee7b17df95459 100644 (file)
@@ -435,8 +435,7 @@ xfs_log_reserve(
        int                     cnt,
        struct xlog_ticket      **ticp,
        __uint8_t               client,
-       bool                    permanent,
-       uint                    t_type)
+       bool                    permanent)
 {
        struct xlog             *log = mp->m_log;
        struct xlog_ticket      *tic;
@@ -456,7 +455,6 @@ xfs_log_reserve(
        if (!tic)
                return -ENOMEM;
 
-       tic->t_trans_type = t_type;
        *ticp = tic;
 
        xlog_grant_push_ail(log, tic->t_cnt ? tic->t_unit_res * tic->t_cnt
@@ -823,8 +821,7 @@ xfs_log_unmount_write(xfs_mount_t *mp)
        } while (iclog != first_iclog);
 #endif
        if (! (XLOG_FORCED_SHUTDOWN(log))) {
-               error = xfs_log_reserve(mp, 600, 1, &tic,
-                                       XFS_LOG, 0, XLOG_UNMOUNT_REC_TYPE);
+               error = xfs_log_reserve(mp, 600, 1, &tic, XFS_LOG, 0);
                if (!error) {
                        /* the data section must be 32 bit size aligned */
                        struct {
@@ -2032,58 +2029,8 @@ xlog_print_tic_res(
            REG_TYPE_STR(ICREATE, "inode create")
        };
 #undef REG_TYPE_STR
-#define TRANS_TYPE_STR(type)   [XFS_TRANS_##type] = #type
-       static char *trans_type_str[XFS_TRANS_TYPE_MAX] = {
-           TRANS_TYPE_STR(SETATTR_NOT_SIZE),
-           TRANS_TYPE_STR(SETATTR_SIZE),
-           TRANS_TYPE_STR(INACTIVE),
-           TRANS_TYPE_STR(CREATE),
-           TRANS_TYPE_STR(CREATE_TRUNC),
-           TRANS_TYPE_STR(TRUNCATE_FILE),
-           TRANS_TYPE_STR(REMOVE),
-           TRANS_TYPE_STR(LINK),
-           TRANS_TYPE_STR(RENAME),
-           TRANS_TYPE_STR(MKDIR),
-           TRANS_TYPE_STR(RMDIR),
-           TRANS_TYPE_STR(SYMLINK),
-           TRANS_TYPE_STR(SET_DMATTRS),
-           TRANS_TYPE_STR(GROWFS),
-           TRANS_TYPE_STR(STRAT_WRITE),
-           TRANS_TYPE_STR(DIOSTRAT),
-           TRANS_TYPE_STR(WRITEID),
-           TRANS_TYPE_STR(ADDAFORK),
-           TRANS_TYPE_STR(ATTRINVAL),
-           TRANS_TYPE_STR(ATRUNCATE),
-           TRANS_TYPE_STR(ATTR_SET),
-           TRANS_TYPE_STR(ATTR_RM),
-           TRANS_TYPE_STR(ATTR_FLAG),
-           TRANS_TYPE_STR(CLEAR_AGI_BUCKET),
-           TRANS_TYPE_STR(SB_CHANGE),
-           TRANS_TYPE_STR(DUMMY1),
-           TRANS_TYPE_STR(DUMMY2),
-           TRANS_TYPE_STR(QM_QUOTAOFF),
-           TRANS_TYPE_STR(QM_DQALLOC),
-           TRANS_TYPE_STR(QM_SETQLIM),
-           TRANS_TYPE_STR(QM_DQCLUSTER),
-           TRANS_TYPE_STR(QM_QINOCREATE),
-           TRANS_TYPE_STR(QM_QUOTAOFF_END),
-           TRANS_TYPE_STR(FSYNC_TS),
-           TRANS_TYPE_STR(GROWFSRT_ALLOC),
-           TRANS_TYPE_STR(GROWFSRT_ZERO),
-           TRANS_TYPE_STR(GROWFSRT_FREE),
-           TRANS_TYPE_STR(SWAPEXT),
-           TRANS_TYPE_STR(CHECKPOINT),
-           TRANS_TYPE_STR(ICREATE),
-           TRANS_TYPE_STR(CREATE_TMPFILE)
-       };
-#undef TRANS_TYPE_STR
 
        xfs_warn(mp, "xlog_write: reservation summary:");
-       xfs_warn(mp, "  trans type  = %s (%u)",
-                ((ticket->t_trans_type <= 0 ||
-                  ticket->t_trans_type > XFS_TRANS_TYPE_MAX) ?
-                 "bad-trans-type" : trans_type_str[ticket->t_trans_type]),
-                ticket->t_trans_type);
        xfs_warn(mp, "  unit res    = %d bytes",
                 ticket->t_unit_res);
        xfs_warn(mp, "  current res = %d bytes",
@@ -3709,7 +3656,6 @@ xlog_ticket_alloc(
        tic->t_tid              = prandom_u32();
        tic->t_clientid         = client;
        tic->t_flags            = XLOG_TIC_INITED;
-       tic->t_trans_type       = 0;
        if (permanent)
                tic->t_flags |= XLOG_TIC_PERM_RESERV;
 
index aa533a7d50f2186f051b09c7dcfd78b431571d15..80ba0c047090165cb6353bcf32ae560fe82ef418 100644 (file)
@@ -161,8 +161,7 @@ int   xfs_log_reserve(struct xfs_mount *mp,
                          int              count,
                          struct xlog_ticket **ticket,
                          __uint8_t        clientid,
-                         bool             permanent,
-                         uint             t_type);
+                         bool             permanent);
 int      xfs_log_regrant(struct xfs_mount *mp, struct xlog_ticket *tic);
 int      xfs_log_unmount_write(struct xfs_mount *mp);
 void      xfs_log_unmount(struct xfs_mount *mp);
index 4e7649351f5a25ab062396818861c9d7c2ee0d61..5e54e7955ea638a7c8fbbd885080fbf0005282f7 100644 (file)
@@ -51,7 +51,6 @@ xlog_cil_ticket_alloc(
 
        tic = xlog_ticket_alloc(log, 0, 1, XFS_TRANSACTION, 0,
                                KM_SLEEP|KM_NOFS);
-       tic->t_trans_type = XFS_TRANS_CHECKPOINT;
 
        /*
         * set the current reservation to zero so we know to steal the basic
index ed8896310c00b64ff768a207a81e9f58b7836fc5..765f084759b5d5be555de8f71ec7556d55782f01 100644 (file)
@@ -175,7 +175,6 @@ typedef struct xlog_ticket {
        char               t_cnt;        /* current count                : 1  */
        char               t_clientid;   /* who does this belong to;     : 1  */
        char               t_flags;      /* properties of reservation    : 1  */
-       uint               t_trans_type; /* transaction type             : 4  */
 
         /* reservation array fields */
        uint               t_res_num;                    /* num in array : 4 */
index c8d58426008ed7ef49096097904ed13653a8cfe9..f08129444280b55ef3736807d0fc7634a514550f 100644 (file)
@@ -944,7 +944,6 @@ DECLARE_EVENT_CLASS(xfs_loggrant_class,
        TP_ARGS(log, tic),
        TP_STRUCT__entry(
                __field(dev_t, dev)
-               __field(unsigned, trans_type)
                __field(char, ocnt)
                __field(char, cnt)
                __field(int, curr_res)
@@ -962,7 +961,6 @@ DECLARE_EVENT_CLASS(xfs_loggrant_class,
        ),
        TP_fast_assign(
                __entry->dev = log->l_mp->m_super->s_dev;
-               __entry->trans_type = tic->t_trans_type;
                __entry->ocnt = tic->t_ocnt;
                __entry->cnt = tic->t_cnt;
                __entry->curr_res = tic->t_curr_res;
@@ -980,14 +978,13 @@ DECLARE_EVENT_CLASS(xfs_loggrant_class,
                __entry->curr_block = log->l_curr_block;
                __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
        ),
-       TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u "
+       TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
                  "t_unit_res %u t_flags %s reserveq %s "
                  "writeq %s grant_reserve_cycle %d "
                  "grant_reserve_bytes %d grant_write_cycle %d "
                  "grant_write_bytes %d curr_cycle %d curr_block %d "
                  "tail_cycle %d tail_block %d",
                  MAJOR(__entry->dev), MINOR(__entry->dev),
-                 __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES),
                  __entry->ocnt,
                  __entry->cnt,
                  __entry->curr_res,
index b3669efb2a0a05519b83573a5679c2b5d78af377..5f3d33d16e6706b9db55cb3919c35feea29408ca 100644 (file)
@@ -177,7 +177,7 @@ xfs_trans_reserve(
                                                resp->tr_logres,
                                                resp->tr_logcount,
                                                &tp->t_ticket, XFS_TRANSACTION,
-                                               permanent, 0);
+                                               permanent);
                }
 
                if (error)
This page took 0.035452 seconds and 5 git commands to generate.