aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-04-05 19:20:36 -0400
committerDave Chinner <david@fromorbit.com>2016-04-05 19:20:36 -0400
commit710b1e2c2948c1e5d0499def5273ecbc6472342d (patch)
tree824c3a870523ab88faf0d2a5dcfe4ddc4e12c895
parent253f4911f297b83745938b7f2c5649b94730b002 (diff)
xfs: remove transaction types
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>
-rw-r--r--fs/xfs/libxfs/xfs_log_format.h5
-rw-r--r--fs/xfs/libxfs/xfs_shared.h97
-rw-r--r--fs/xfs/xfs_log.c58
-rw-r--r--fs/xfs/xfs_log.h3
-rw-r--r--fs/xfs/xfs_log_cil.c1
-rw-r--r--fs/xfs/xfs_log_priv.h1
-rw-r--r--fs/xfs/xfs_trace.h5
-rw-r--r--fs/xfs/xfs_trans.c2
8 files changed, 10 insertions, 162 deletions
diff --git a/fs/xfs/libxfs/xfs_log_format.h b/fs/xfs/libxfs/xfs_log_format.h
index d54a8018b079..e8f49c029ff0 100644
--- a/fs/xfs/libxfs/xfs_log_format.h
+++ b/fs/xfs/libxfs/xfs_log_format.h
@@ -212,6 +212,11 @@ typedef struct xfs_trans_header {
212#define XFS_TRANS_HEADER_MAGIC 0x5452414e /* TRAN */ 212#define XFS_TRANS_HEADER_MAGIC 0x5452414e /* TRAN */
213 213
214/* 214/*
215 * The only type valid for th_type in CIL-enabled file system logs:
216 */
217#define XFS_TRANS_CHECKPOINT 40
218
219/*
215 * Log item types. 220 * Log item types.
216 */ 221 */
217#define XFS_LI_EFI 0x1236 222#define XFS_LI_EFI 0x1236
diff --git a/fs/xfs/libxfs/xfs_shared.h b/fs/xfs/libxfs/xfs_shared.h
index 7d4ab6439081..16002b5ec4eb 100644
--- a/fs/xfs/libxfs/xfs_shared.h
+++ b/fs/xfs/libxfs/xfs_shared.h
@@ -56,103 +56,6 @@ extern const struct xfs_buf_ops xfs_symlink_buf_ops;
56extern const struct xfs_buf_ops xfs_rtbuf_ops; 56extern const struct xfs_buf_ops xfs_rtbuf_ops;
57 57
58/* 58/*
59 * Transaction types. Used to distinguish types of buffers. These never reach
60 * the log.
61 */
62#define XFS_TRANS_SETATTR_NOT_SIZE 1
63#define XFS_TRANS_SETATTR_SIZE 2
64#define XFS_TRANS_INACTIVE 3
65#define XFS_TRANS_CREATE 4
66#define XFS_TRANS_CREATE_TRUNC 5
67#define XFS_TRANS_TRUNCATE_FILE 6
68#define XFS_TRANS_REMOVE 7
69#define XFS_TRANS_LINK 8
70#define XFS_TRANS_RENAME 9
71#define XFS_TRANS_MKDIR 10
72#define XFS_TRANS_RMDIR 11
73#define XFS_TRANS_SYMLINK 12
74#define XFS_TRANS_SET_DMATTRS 13
75#define XFS_TRANS_GROWFS 14
76#define XFS_TRANS_STRAT_WRITE 15
77#define XFS_TRANS_DIOSTRAT 16
78/* 17 was XFS_TRANS_WRITE_SYNC */
79#define XFS_TRANS_WRITEID 18
80#define XFS_TRANS_ADDAFORK 19
81#define XFS_TRANS_ATTRINVAL 20
82#define XFS_TRANS_ATRUNCATE 21
83#define XFS_TRANS_ATTR_SET 22
84#define XFS_TRANS_ATTR_RM 23
85#define XFS_TRANS_ATTR_FLAG 24
86#define XFS_TRANS_CLEAR_AGI_BUCKET 25
87#define XFS_TRANS_SB_CHANGE 26
88/*
89 * Dummy entries since we use the transaction type to index into the
90 * trans_type[] in xlog_recover_print_trans_head()
91 */
92#define XFS_TRANS_DUMMY1 27
93#define XFS_TRANS_DUMMY2 28
94#define XFS_TRANS_QM_QUOTAOFF 29
95#define XFS_TRANS_QM_DQALLOC 30
96#define XFS_TRANS_QM_SETQLIM 31
97#define XFS_TRANS_QM_DQCLUSTER 32
98#define XFS_TRANS_QM_QINOCREATE 33
99#define XFS_TRANS_QM_QUOTAOFF_END 34
100#define XFS_TRANS_FSYNC_TS 35
101#define XFS_TRANS_GROWFSRT_ALLOC 36
102#define XFS_TRANS_GROWFSRT_ZERO 37
103#define XFS_TRANS_GROWFSRT_FREE 38
104#define XFS_TRANS_SWAPEXT 39
105#define XFS_TRANS_CHECKPOINT 40
106#define XFS_TRANS_ICREATE 41
107#define XFS_TRANS_CREATE_TMPFILE 42
108#define XFS_TRANS_TYPE_MAX 43
109/* new transaction types need to be reflected in xfs_logprint(8) */
110
111#define XFS_TRANS_TYPES \
112 { XFS_TRANS_SETATTR_NOT_SIZE, "SETATTR_NOT_SIZE" }, \
113 { XFS_TRANS_SETATTR_SIZE, "SETATTR_SIZE" }, \
114 { XFS_TRANS_INACTIVE, "INACTIVE" }, \
115 { XFS_TRANS_CREATE, "CREATE" }, \
116 { XFS_TRANS_CREATE_TRUNC, "CREATE_TRUNC" }, \
117 { XFS_TRANS_TRUNCATE_FILE, "TRUNCATE_FILE" }, \
118 { XFS_TRANS_REMOVE, "REMOVE" }, \
119 { XFS_TRANS_LINK, "LINK" }, \
120 { XFS_TRANS_RENAME, "RENAME" }, \
121 { XFS_TRANS_MKDIR, "MKDIR" }, \
122 { XFS_TRANS_RMDIR, "RMDIR" }, \
123 { XFS_TRANS_SYMLINK, "SYMLINK" }, \
124 { XFS_TRANS_SET_DMATTRS, "SET_DMATTRS" }, \
125 { XFS_TRANS_GROWFS, "GROWFS" }, \
126 { XFS_TRANS_STRAT_WRITE, "STRAT_WRITE" }, \
127 { XFS_TRANS_DIOSTRAT, "DIOSTRAT" }, \
128 { XFS_TRANS_WRITEID, "WRITEID" }, \
129 { XFS_TRANS_ADDAFORK, "ADDAFORK" }, \
130 { XFS_TRANS_ATTRINVAL, "ATTRINVAL" }, \
131 { XFS_TRANS_ATRUNCATE, "ATRUNCATE" }, \
132 { XFS_TRANS_ATTR_SET, "ATTR_SET" }, \
133 { XFS_TRANS_ATTR_RM, "ATTR_RM" }, \
134 { XFS_TRANS_ATTR_FLAG, "ATTR_FLAG" }, \
135 { XFS_TRANS_CLEAR_AGI_BUCKET, "CLEAR_AGI_BUCKET" }, \
136 { XFS_TRANS_SB_CHANGE, "SBCHANGE" }, \
137 { XFS_TRANS_DUMMY1, "DUMMY1" }, \
138 { XFS_TRANS_DUMMY2, "DUMMY2" }, \
139 { XFS_TRANS_QM_QUOTAOFF, "QM_QUOTAOFF" }, \
140 { XFS_TRANS_QM_DQALLOC, "QM_DQALLOC" }, \
141 { XFS_TRANS_QM_SETQLIM, "QM_SETQLIM" }, \
142 { XFS_TRANS_QM_DQCLUSTER, "QM_DQCLUSTER" }, \
143 { XFS_TRANS_QM_QINOCREATE, "QM_QINOCREATE" }, \
144 { XFS_TRANS_QM_QUOTAOFF_END, "QM_QOFF_END" }, \
145 { XFS_TRANS_FSYNC_TS, "FSYNC_TS" }, \
146 { XFS_TRANS_GROWFSRT_ALLOC, "GROWFSRT_ALLOC" }, \
147 { XFS_TRANS_GROWFSRT_ZERO, "GROWFSRT_ZERO" }, \
148 { XFS_TRANS_GROWFSRT_FREE, "GROWFSRT_FREE" }, \
149 { XFS_TRANS_SWAPEXT, "SWAPEXT" }, \
150 { XFS_TRANS_CHECKPOINT, "CHECKPOINT" }, \
151 { XFS_TRANS_ICREATE, "ICREATE" }, \
152 { XFS_TRANS_CREATE_TMPFILE, "CREATE_TMPFILE" }, \
153 { XLOG_UNMOUNT_REC_TYPE, "UNMOUNT" }
154
155/*
156 * This structure is used to track log items associated with 59 * This structure is used to track log items associated with
157 * a transaction. It points to the log item and keeps some 60 * a transaction. It points to the log item and keeps some
158 * flags to track the state of the log item. It also tracks 61 * flags to track the state of the log item. It also tracks
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index b49ccf5c1d75..268f7d65cfd4 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -435,8 +435,7 @@ xfs_log_reserve(
435 int cnt, 435 int cnt,
436 struct xlog_ticket **ticp, 436 struct xlog_ticket **ticp,
437 __uint8_t client, 437 __uint8_t client,
438 bool permanent, 438 bool permanent)
439 uint t_type)
440{ 439{
441 struct xlog *log = mp->m_log; 440 struct xlog *log = mp->m_log;
442 struct xlog_ticket *tic; 441 struct xlog_ticket *tic;
@@ -456,7 +455,6 @@ xfs_log_reserve(
456 if (!tic) 455 if (!tic)
457 return -ENOMEM; 456 return -ENOMEM;
458 457
459 tic->t_trans_type = t_type;
460 *ticp = tic; 458 *ticp = tic;
461 459
462 xlog_grant_push_ail(log, tic->t_cnt ? tic->t_unit_res * tic->t_cnt 460 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)
823 } while (iclog != first_iclog); 821 } while (iclog != first_iclog);
824#endif 822#endif
825 if (! (XLOG_FORCED_SHUTDOWN(log))) { 823 if (! (XLOG_FORCED_SHUTDOWN(log))) {
826 error = xfs_log_reserve(mp, 600, 1, &tic, 824 error = xfs_log_reserve(mp, 600, 1, &tic, XFS_LOG, 0);
827 XFS_LOG, 0, XLOG_UNMOUNT_REC_TYPE);
828 if (!error) { 825 if (!error) {
829 /* the data section must be 32 bit size aligned */ 826 /* the data section must be 32 bit size aligned */
830 struct { 827 struct {
@@ -2032,58 +2029,8 @@ xlog_print_tic_res(
2032 REG_TYPE_STR(ICREATE, "inode create") 2029 REG_TYPE_STR(ICREATE, "inode create")
2033 }; 2030 };
2034#undef REG_TYPE_STR 2031#undef REG_TYPE_STR
2035#define TRANS_TYPE_STR(type) [XFS_TRANS_##type] = #type
2036 static char *trans_type_str[XFS_TRANS_TYPE_MAX] = {
2037 TRANS_TYPE_STR(SETATTR_NOT_SIZE),
2038 TRANS_TYPE_STR(SETATTR_SIZE),
2039 TRANS_TYPE_STR(INACTIVE),
2040 TRANS_TYPE_STR(CREATE),
2041 TRANS_TYPE_STR(CREATE_TRUNC),
2042 TRANS_TYPE_STR(TRUNCATE_FILE),
2043 TRANS_TYPE_STR(REMOVE),
2044 TRANS_TYPE_STR(LINK),
2045 TRANS_TYPE_STR(RENAME),
2046 TRANS_TYPE_STR(MKDIR),
2047 TRANS_TYPE_STR(RMDIR),
2048 TRANS_TYPE_STR(SYMLINK),
2049 TRANS_TYPE_STR(SET_DMATTRS),
2050 TRANS_TYPE_STR(GROWFS),
2051 TRANS_TYPE_STR(STRAT_WRITE),
2052 TRANS_TYPE_STR(DIOSTRAT),
2053 TRANS_TYPE_STR(WRITEID),
2054 TRANS_TYPE_STR(ADDAFORK),
2055 TRANS_TYPE_STR(ATTRINVAL),
2056 TRANS_TYPE_STR(ATRUNCATE),
2057 TRANS_TYPE_STR(ATTR_SET),
2058 TRANS_TYPE_STR(ATTR_RM),
2059 TRANS_TYPE_STR(ATTR_FLAG),
2060 TRANS_TYPE_STR(CLEAR_AGI_BUCKET),
2061 TRANS_TYPE_STR(SB_CHANGE),
2062 TRANS_TYPE_STR(DUMMY1),
2063 TRANS_TYPE_STR(DUMMY2),
2064 TRANS_TYPE_STR(QM_QUOTAOFF),
2065 TRANS_TYPE_STR(QM_DQALLOC),
2066 TRANS_TYPE_STR(QM_SETQLIM),
2067 TRANS_TYPE_STR(QM_DQCLUSTER),
2068 TRANS_TYPE_STR(QM_QINOCREATE),
2069 TRANS_TYPE_STR(QM_QUOTAOFF_END),
2070 TRANS_TYPE_STR(FSYNC_TS),
2071 TRANS_TYPE_STR(GROWFSRT_ALLOC),
2072 TRANS_TYPE_STR(GROWFSRT_ZERO),
2073 TRANS_TYPE_STR(GROWFSRT_FREE),
2074 TRANS_TYPE_STR(SWAPEXT),
2075 TRANS_TYPE_STR(CHECKPOINT),
2076 TRANS_TYPE_STR(ICREATE),
2077 TRANS_TYPE_STR(CREATE_TMPFILE)
2078 };
2079#undef TRANS_TYPE_STR
2080 2032
2081 xfs_warn(mp, "xlog_write: reservation summary:"); 2033 xfs_warn(mp, "xlog_write: reservation summary:");
2082 xfs_warn(mp, " trans type = %s (%u)",
2083 ((ticket->t_trans_type <= 0 ||
2084 ticket->t_trans_type > XFS_TRANS_TYPE_MAX) ?
2085 "bad-trans-type" : trans_type_str[ticket->t_trans_type]),
2086 ticket->t_trans_type);
2087 xfs_warn(mp, " unit res = %d bytes", 2034 xfs_warn(mp, " unit res = %d bytes",
2088 ticket->t_unit_res); 2035 ticket->t_unit_res);
2089 xfs_warn(mp, " current res = %d bytes", 2036 xfs_warn(mp, " current res = %d bytes",
@@ -3709,7 +3656,6 @@ xlog_ticket_alloc(
3709 tic->t_tid = prandom_u32(); 3656 tic->t_tid = prandom_u32();
3710 tic->t_clientid = client; 3657 tic->t_clientid = client;
3711 tic->t_flags = XLOG_TIC_INITED; 3658 tic->t_flags = XLOG_TIC_INITED;
3712 tic->t_trans_type = 0;
3713 if (permanent) 3659 if (permanent)
3714 tic->t_flags |= XLOG_TIC_PERM_RESERV; 3660 tic->t_flags |= XLOG_TIC_PERM_RESERV;
3715 3661
diff --git a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h
index aa533a7d50f2..80ba0c047090 100644
--- a/fs/xfs/xfs_log.h
+++ b/fs/xfs/xfs_log.h
@@ -161,8 +161,7 @@ int xfs_log_reserve(struct xfs_mount *mp,
161 int count, 161 int count,
162 struct xlog_ticket **ticket, 162 struct xlog_ticket **ticket,
163 __uint8_t clientid, 163 __uint8_t clientid,
164 bool permanent, 164 bool permanent);
165 uint t_type);
166int xfs_log_regrant(struct xfs_mount *mp, struct xlog_ticket *tic); 165int xfs_log_regrant(struct xfs_mount *mp, struct xlog_ticket *tic);
167int xfs_log_unmount_write(struct xfs_mount *mp); 166int xfs_log_unmount_write(struct xfs_mount *mp);
168void xfs_log_unmount(struct xfs_mount *mp); 167void xfs_log_unmount(struct xfs_mount *mp);
diff --git a/fs/xfs/xfs_log_cil.c b/fs/xfs/xfs_log_cil.c
index 4e7649351f5a..5e54e7955ea6 100644
--- a/fs/xfs/xfs_log_cil.c
+++ b/fs/xfs/xfs_log_cil.c
@@ -51,7 +51,6 @@ xlog_cil_ticket_alloc(
51 51
52 tic = xlog_ticket_alloc(log, 0, 1, XFS_TRANSACTION, 0, 52 tic = xlog_ticket_alloc(log, 0, 1, XFS_TRANSACTION, 0,
53 KM_SLEEP|KM_NOFS); 53 KM_SLEEP|KM_NOFS);
54 tic->t_trans_type = XFS_TRANS_CHECKPOINT;
55 54
56 /* 55 /*
57 * set the current reservation to zero so we know to steal the basic 56 * set the current reservation to zero so we know to steal the basic
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
index ed8896310c00..765f084759b5 100644
--- a/fs/xfs/xfs_log_priv.h
+++ b/fs/xfs/xfs_log_priv.h
@@ -175,7 +175,6 @@ typedef struct xlog_ticket {
175 char t_cnt; /* current count : 1 */ 175 char t_cnt; /* current count : 1 */
176 char t_clientid; /* who does this belong to; : 1 */ 176 char t_clientid; /* who does this belong to; : 1 */
177 char t_flags; /* properties of reservation : 1 */ 177 char t_flags; /* properties of reservation : 1 */
178 uint t_trans_type; /* transaction type : 4 */
179 178
180 /* reservation array fields */ 179 /* reservation array fields */
181 uint t_res_num; /* num in array : 4 */ 180 uint t_res_num; /* num in array : 4 */
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index c8d58426008e..f08129444280 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -944,7 +944,6 @@ DECLARE_EVENT_CLASS(xfs_loggrant_class,
944 TP_ARGS(log, tic), 944 TP_ARGS(log, tic),
945 TP_STRUCT__entry( 945 TP_STRUCT__entry(
946 __field(dev_t, dev) 946 __field(dev_t, dev)
947 __field(unsigned, trans_type)
948 __field(char, ocnt) 947 __field(char, ocnt)
949 __field(char, cnt) 948 __field(char, cnt)
950 __field(int, curr_res) 949 __field(int, curr_res)
@@ -962,7 +961,6 @@ DECLARE_EVENT_CLASS(xfs_loggrant_class,
962 ), 961 ),
963 TP_fast_assign( 962 TP_fast_assign(
964 __entry->dev = log->l_mp->m_super->s_dev; 963 __entry->dev = log->l_mp->m_super->s_dev;
965 __entry->trans_type = tic->t_trans_type;
966 __entry->ocnt = tic->t_ocnt; 964 __entry->ocnt = tic->t_ocnt;
967 __entry->cnt = tic->t_cnt; 965 __entry->cnt = tic->t_cnt;
968 __entry->curr_res = tic->t_curr_res; 966 __entry->curr_res = tic->t_curr_res;
@@ -980,14 +978,13 @@ DECLARE_EVENT_CLASS(xfs_loggrant_class,
980 __entry->curr_block = log->l_curr_block; 978 __entry->curr_block = log->l_curr_block;
981 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn); 979 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
982 ), 980 ),
983 TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u " 981 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
984 "t_unit_res %u t_flags %s reserveq %s " 982 "t_unit_res %u t_flags %s reserveq %s "
985 "writeq %s grant_reserve_cycle %d " 983 "writeq %s grant_reserve_cycle %d "
986 "grant_reserve_bytes %d grant_write_cycle %d " 984 "grant_reserve_bytes %d grant_write_cycle %d "
987 "grant_write_bytes %d curr_cycle %d curr_block %d " 985 "grant_write_bytes %d curr_cycle %d curr_block %d "
988 "tail_cycle %d tail_block %d", 986 "tail_cycle %d tail_block %d",
989 MAJOR(__entry->dev), MINOR(__entry->dev), 987 MAJOR(__entry->dev), MINOR(__entry->dev),
990 __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES),
991 __entry->ocnt, 988 __entry->ocnt,
992 __entry->cnt, 989 __entry->cnt,
993 __entry->curr_res, 990 __entry->curr_res,
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index b3669efb2a0a..5f3d33d16e67 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -177,7 +177,7 @@ xfs_trans_reserve(
177 resp->tr_logres, 177 resp->tr_logres,
178 resp->tr_logcount, 178 resp->tr_logcount,
179 &tp->t_ticket, XFS_TRANSACTION, 179 &tp->t_ticket, XFS_TRANSACTION,
180 permanent, 0); 180 permanent);
181 } 181 }
182 182
183 if (error) 183 if (error)