summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2018-08-01 10:20:32 -0400
committerDarrick J. Wong <darrick.wong@oracle.com>2018-08-03 02:05:14 -0400
commit7dbddbaccd189e63c39c9e22c728c4548b9893bb (patch)
treedd353e41e01ed0ebcbe25a8fc2050d1a017d16a5
parenta8198666fb755e129c2fe92819774256ec26c79c (diff)
xfs: drop dop param from xfs_defer_op_type ->finish_item() callback
The dfops infrastructure ->finish_item() callback passes the transaction and dfops as separate parameters. Since dfops is always part of a transaction, the latter parameter is no longer necessary. Remove it from the various callbacks. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c2
-rw-r--r--fs/xfs/libxfs/xfs_bmap.h6
-rw-r--r--fs/xfs/libxfs/xfs_defer.c2
-rw-r--r--fs/xfs/libxfs/xfs_defer.h4
-rw-r--r--fs/xfs/libxfs/xfs_refcount.c2
-rw-r--r--fs/xfs/libxfs/xfs_refcount.h7
-rw-r--r--fs/xfs/xfs_bmap_item.c5
-rw-r--r--fs/xfs/xfs_refcount_item.c4
-rw-r--r--fs/xfs/xfs_trans.h10
-rw-r--r--fs/xfs/xfs_trans_bmap.c6
-rw-r--r--fs/xfs/xfs_trans_extfree.c2
-rw-r--r--fs/xfs/xfs_trans_refcount.c6
-rw-r--r--fs/xfs/xfs_trans_rmap.c1
13 files changed, 23 insertions, 34 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 5cd490dc891a..d20f541b7061 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -6045,7 +6045,6 @@ xfs_bmap_unmap_extent(
6045int 6045int
6046xfs_bmap_finish_one( 6046xfs_bmap_finish_one(
6047 struct xfs_trans *tp, 6047 struct xfs_trans *tp,
6048 struct xfs_defer_ops *dfops,
6049 struct xfs_inode *ip, 6048 struct xfs_inode *ip,
6050 enum xfs_bmap_intent_type type, 6049 enum xfs_bmap_intent_type type,
6051 int whichfork, 6050 int whichfork,
@@ -6072,7 +6071,6 @@ xfs_bmap_finish_one(
6072 6071
6073 switch (type) { 6072 switch (type) {
6074 case XFS_BMAP_MAP: 6073 case XFS_BMAP_MAP:
6075 ASSERT(dfops == tp->t_dfops);
6076 error = xfs_bmapi_remap(tp, ip, startoff, *blockcount, 6074 error = xfs_bmapi_remap(tp, ip, startoff, *blockcount,
6077 startblock, 0); 6075 startblock, 0);
6078 *blockcount = 0; 6076 *blockcount = 0;
diff --git a/fs/xfs/libxfs/xfs_bmap.h b/fs/xfs/libxfs/xfs_bmap.h
index 2e8555c1229a..9165a878edcd 100644
--- a/fs/xfs/libxfs/xfs_bmap.h
+++ b/fs/xfs/libxfs/xfs_bmap.h
@@ -252,9 +252,9 @@ struct xfs_bmap_intent {
252 struct xfs_bmbt_irec bi_bmap; 252 struct xfs_bmbt_irec bi_bmap;
253}; 253};
254 254
255int xfs_bmap_finish_one(struct xfs_trans *tp, struct xfs_defer_ops *dfops, 255int xfs_bmap_finish_one(struct xfs_trans *tp, struct xfs_inode *ip,
256 struct xfs_inode *ip, enum xfs_bmap_intent_type type, 256 enum xfs_bmap_intent_type type, int whichfork,
257 int whichfork, xfs_fileoff_t startoff, xfs_fsblock_t startblock, 257 xfs_fileoff_t startoff, xfs_fsblock_t startblock,
258 xfs_filblks_t *blockcount, xfs_exntst_t state); 258 xfs_filblks_t *blockcount, xfs_exntst_t state);
259int xfs_bmap_map_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops, 259int xfs_bmap_map_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops,
260 struct xfs_inode *ip, struct xfs_bmbt_irec *imap); 260 struct xfs_inode *ip, struct xfs_bmbt_irec *imap);
diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c
index 1e7073252a5e..66ef9341813b 100644
--- a/fs/xfs/libxfs/xfs_defer.c
+++ b/fs/xfs/libxfs/xfs_defer.c
@@ -371,7 +371,7 @@ xfs_defer_finish_noroll(
371 list_for_each_safe(li, n, &dfp->dfp_work) { 371 list_for_each_safe(li, n, &dfp->dfp_work) {
372 list_del(li); 372 list_del(li);
373 dfp->dfp_count--; 373 dfp->dfp_count--;
374 error = dfp->dfp_type->finish_item(*tp, dop, li, 374 error = dfp->dfp_type->finish_item(*tp, li,
375 dfp->dfp_done, &state); 375 dfp->dfp_done, &state);
376 if (error == -EAGAIN) { 376 if (error == -EAGAIN) {
377 /* 377 /*
diff --git a/fs/xfs/libxfs/xfs_defer.h b/fs/xfs/libxfs/xfs_defer.h
index bf1e9f78561e..0de7504e5651 100644
--- a/fs/xfs/libxfs/xfs_defer.h
+++ b/fs/xfs/libxfs/xfs_defer.h
@@ -50,8 +50,8 @@ struct xfs_defer_op_type {
50 unsigned int max_items; 50 unsigned int max_items;
51 void (*abort_intent)(void *); 51 void (*abort_intent)(void *);
52 void *(*create_done)(struct xfs_trans *, void *, unsigned int); 52 void *(*create_done)(struct xfs_trans *, void *, unsigned int);
53 int (*finish_item)(struct xfs_trans *, struct xfs_defer_ops *, 53 int (*finish_item)(struct xfs_trans *, struct list_head *, void *,
54 struct list_head *, void *, void **); 54 void **);
55 void (*finish_cleanup)(struct xfs_trans *, void *, int); 55 void (*finish_cleanup)(struct xfs_trans *, void *, int);
56 void (*cancel_item)(struct list_head *); 56 void (*cancel_item)(struct list_head *);
57 int (*diff_items)(void *, struct list_head *, struct list_head *); 57 int (*diff_items)(void *, struct list_head *, struct list_head *);
diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c
index 4cbc2efb099e..86f297ca90cd 100644
--- a/fs/xfs/libxfs/xfs_refcount.c
+++ b/fs/xfs/libxfs/xfs_refcount.c
@@ -1082,7 +1082,6 @@ xfs_refcount_finish_one_cleanup(
1082int 1082int
1083xfs_refcount_finish_one( 1083xfs_refcount_finish_one(
1084 struct xfs_trans *tp, 1084 struct xfs_trans *tp,
1085 struct xfs_defer_ops *dfops,
1086 enum xfs_refcount_intent_type type, 1085 enum xfs_refcount_intent_type type,
1087 xfs_fsblock_t startblock, 1086 xfs_fsblock_t startblock,
1088 xfs_extlen_t blockcount, 1087 xfs_extlen_t blockcount,
@@ -1091,6 +1090,7 @@ xfs_refcount_finish_one(
1091 struct xfs_btree_cur **pcur) 1090 struct xfs_btree_cur **pcur)
1092{ 1091{
1093 struct xfs_mount *mp = tp->t_mountp; 1092 struct xfs_mount *mp = tp->t_mountp;
1093 struct xfs_defer_ops *dfops = tp->t_dfops;
1094 struct xfs_btree_cur *rcur; 1094 struct xfs_btree_cur *rcur;
1095 struct xfs_buf *agbp = NULL; 1095 struct xfs_buf *agbp = NULL;
1096 int error = 0; 1096 int error = 0;
diff --git a/fs/xfs/libxfs/xfs_refcount.h b/fs/xfs/libxfs/xfs_refcount.h
index 5fef74412727..3b72c6dbf6ad 100644
--- a/fs/xfs/libxfs/xfs_refcount.h
+++ b/fs/xfs/libxfs/xfs_refcount.h
@@ -37,10 +37,9 @@ extern int xfs_refcount_decrease_extent(struct xfs_mount *mp,
37extern void xfs_refcount_finish_one_cleanup(struct xfs_trans *tp, 37extern void xfs_refcount_finish_one_cleanup(struct xfs_trans *tp,
38 struct xfs_btree_cur *rcur, int error); 38 struct xfs_btree_cur *rcur, int error);
39extern int xfs_refcount_finish_one(struct xfs_trans *tp, 39extern int xfs_refcount_finish_one(struct xfs_trans *tp,
40 struct xfs_defer_ops *dfops, enum xfs_refcount_intent_type type, 40 enum xfs_refcount_intent_type type, xfs_fsblock_t startblock,
41 xfs_fsblock_t startblock, xfs_extlen_t blockcount, 41 xfs_extlen_t blockcount, xfs_fsblock_t *new_fsb,
42 xfs_fsblock_t *new_fsb, xfs_extlen_t *new_len, 42 xfs_extlen_t *new_len, struct xfs_btree_cur **pcur);
43 struct xfs_btree_cur **pcur);
44 43
45extern int xfs_refcount_find_shared(struct xfs_btree_cur *cur, 44extern int xfs_refcount_find_shared(struct xfs_btree_cur *cur,
46 xfs_agblock_t agbno, xfs_extlen_t aglen, xfs_agblock_t *fbno, 45 xfs_agblock_t agbno, xfs_extlen_t aglen, xfs_agblock_t *fbno,
diff --git a/fs/xfs/xfs_bmap_item.c b/fs/xfs/xfs_bmap_item.c
index b8a6be036cd7..e828e0b51814 100644
--- a/fs/xfs/xfs_bmap_item.c
+++ b/fs/xfs/xfs_bmap_item.c
@@ -475,9 +475,8 @@ xfs_bui_recover(
475 xfs_trans_ijoin(tp, ip, 0); 475 xfs_trans_ijoin(tp, ip, 0);
476 476
477 count = bmap->me_len; 477 count = bmap->me_len;
478 error = xfs_trans_log_finish_bmap_update(tp, budp, tp->t_dfops, type, 478 error = xfs_trans_log_finish_bmap_update(tp, budp, type, ip, whichfork,
479 ip, whichfork, bmap->me_startoff, 479 bmap->me_startoff, bmap->me_startblock, &count, state);
480 bmap->me_startblock, &count, state);
481 if (error) 480 if (error)
482 goto err_inode; 481 goto err_inode;
483 482
diff --git a/fs/xfs/xfs_refcount_item.c b/fs/xfs/xfs_refcount_item.c
index 4a417daae781..43c4ac374cba 100644
--- a/fs/xfs/xfs_refcount_item.c
+++ b/fs/xfs/xfs_refcount_item.c
@@ -479,8 +479,8 @@ xfs_cui_recover(
479 new_len = refc->pe_len; 479 new_len = refc->pe_len;
480 } else 480 } else
481 error = xfs_trans_log_finish_refcount_update(tp, cudp, 481 error = xfs_trans_log_finish_refcount_update(tp, cudp,
482 tp->t_dfops, type, refc->pe_startblock, 482 type, refc->pe_startblock, refc->pe_len,
483 refc->pe_len, &new_fsb, &new_len, &rcur); 483 &new_fsb, &new_len, &rcur);
484 if (error) 484 if (error)
485 goto abort_error; 485 goto abort_error;
486 486
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h
index 8665d45b82c6..299656dbf324 100644
--- a/fs/xfs/xfs_trans.h
+++ b/fs/xfs/xfs_trans.h
@@ -268,7 +268,7 @@ void xfs_refcount_update_init_defer_op(void);
268struct xfs_cud_log_item *xfs_trans_get_cud(struct xfs_trans *tp, 268struct xfs_cud_log_item *xfs_trans_get_cud(struct xfs_trans *tp,
269 struct xfs_cui_log_item *cuip); 269 struct xfs_cui_log_item *cuip);
270int xfs_trans_log_finish_refcount_update(struct xfs_trans *tp, 270int xfs_trans_log_finish_refcount_update(struct xfs_trans *tp,
271 struct xfs_cud_log_item *cudp, struct xfs_defer_ops *dfops, 271 struct xfs_cud_log_item *cudp,
272 enum xfs_refcount_intent_type type, xfs_fsblock_t startblock, 272 enum xfs_refcount_intent_type type, xfs_fsblock_t startblock,
273 xfs_extlen_t blockcount, xfs_fsblock_t *new_fsb, 273 xfs_extlen_t blockcount, xfs_fsblock_t *new_fsb,
274 xfs_extlen_t *new_len, struct xfs_btree_cur **pcur); 274 xfs_extlen_t *new_len, struct xfs_btree_cur **pcur);
@@ -280,9 +280,9 @@ void xfs_bmap_update_init_defer_op(void);
280struct xfs_bud_log_item *xfs_trans_get_bud(struct xfs_trans *tp, 280struct xfs_bud_log_item *xfs_trans_get_bud(struct xfs_trans *tp,
281 struct xfs_bui_log_item *buip); 281 struct xfs_bui_log_item *buip);
282int xfs_trans_log_finish_bmap_update(struct xfs_trans *tp, 282int xfs_trans_log_finish_bmap_update(struct xfs_trans *tp,
283 struct xfs_bud_log_item *rudp, struct xfs_defer_ops *dfops, 283 struct xfs_bud_log_item *rudp, enum xfs_bmap_intent_type type,
284 enum xfs_bmap_intent_type type, struct xfs_inode *ip, 284 struct xfs_inode *ip, int whichfork, xfs_fileoff_t startoff,
285 int whichfork, xfs_fileoff_t startoff, xfs_fsblock_t startblock, 285 xfs_fsblock_t startblock, xfs_filblks_t *blockcount,
286 xfs_filblks_t *blockcount, xfs_exntst_t state); 286 xfs_exntst_t state);
287 287
288#endif /* __XFS_TRANS_H__ */ 288#endif /* __XFS_TRANS_H__ */
diff --git a/fs/xfs/xfs_trans_bmap.c b/fs/xfs/xfs_trans_bmap.c
index a15a5cd867f9..741c558b2179 100644
--- a/fs/xfs/xfs_trans_bmap.c
+++ b/fs/xfs/xfs_trans_bmap.c
@@ -43,7 +43,6 @@ int
43xfs_trans_log_finish_bmap_update( 43xfs_trans_log_finish_bmap_update(
44 struct xfs_trans *tp, 44 struct xfs_trans *tp,
45 struct xfs_bud_log_item *budp, 45 struct xfs_bud_log_item *budp,
46 struct xfs_defer_ops *dop,
47 enum xfs_bmap_intent_type type, 46 enum xfs_bmap_intent_type type,
48 struct xfs_inode *ip, 47 struct xfs_inode *ip,
49 int whichfork, 48 int whichfork,
@@ -54,7 +53,7 @@ xfs_trans_log_finish_bmap_update(
54{ 53{
55 int error; 54 int error;
56 55
57 error = xfs_bmap_finish_one(tp, dop, ip, type, whichfork, startoff, 56 error = xfs_bmap_finish_one(tp, ip, type, whichfork, startoff,
58 startblock, blockcount, state); 57 startblock, blockcount, state);
59 58
60 /* 59 /*
@@ -176,7 +175,6 @@ xfs_bmap_update_create_done(
176STATIC int 175STATIC int
177xfs_bmap_update_finish_item( 176xfs_bmap_update_finish_item(
178 struct xfs_trans *tp, 177 struct xfs_trans *tp,
179 struct xfs_defer_ops *dop,
180 struct list_head *item, 178 struct list_head *item,
181 void *done_item, 179 void *done_item,
182 void **state) 180 void **state)
@@ -187,7 +185,7 @@ xfs_bmap_update_finish_item(
187 185
188 bmap = container_of(item, struct xfs_bmap_intent, bi_list); 186 bmap = container_of(item, struct xfs_bmap_intent, bi_list);
189 count = bmap->bi_bmap.br_blockcount; 187 count = bmap->bi_bmap.br_blockcount;
190 error = xfs_trans_log_finish_bmap_update(tp, done_item, dop, 188 error = xfs_trans_log_finish_bmap_update(tp, done_item,
191 bmap->bi_type, 189 bmap->bi_type,
192 bmap->bi_owner, bmap->bi_whichfork, 190 bmap->bi_owner, bmap->bi_whichfork,
193 bmap->bi_bmap.br_startoff, 191 bmap->bi_bmap.br_startoff,
diff --git a/fs/xfs/xfs_trans_extfree.c b/fs/xfs/xfs_trans_extfree.c
index bd66c76f55e6..855c0b651fd4 100644
--- a/fs/xfs/xfs_trans_extfree.c
+++ b/fs/xfs/xfs_trans_extfree.c
@@ -171,7 +171,6 @@ xfs_extent_free_create_done(
171STATIC int 171STATIC int
172xfs_extent_free_finish_item( 172xfs_extent_free_finish_item(
173 struct xfs_trans *tp, 173 struct xfs_trans *tp,
174 struct xfs_defer_ops *dop,
175 struct list_head *item, 174 struct list_head *item,
176 void *done_item, 175 void *done_item,
177 void **state) 176 void **state)
@@ -226,7 +225,6 @@ static const struct xfs_defer_op_type xfs_extent_free_defer_type = {
226STATIC int 225STATIC int
227xfs_agfl_free_finish_item( 226xfs_agfl_free_finish_item(
228 struct xfs_trans *tp, 227 struct xfs_trans *tp,
229 struct xfs_defer_ops *dop,
230 struct list_head *item, 228 struct list_head *item,
231 void *done_item, 229 void *done_item,
232 void **state) 230 void **state)
diff --git a/fs/xfs/xfs_trans_refcount.c b/fs/xfs/xfs_trans_refcount.c
index 46dd4fca8aa7..523c55663954 100644
--- a/fs/xfs/xfs_trans_refcount.c
+++ b/fs/xfs/xfs_trans_refcount.c
@@ -42,7 +42,6 @@ int
42xfs_trans_log_finish_refcount_update( 42xfs_trans_log_finish_refcount_update(
43 struct xfs_trans *tp, 43 struct xfs_trans *tp,
44 struct xfs_cud_log_item *cudp, 44 struct xfs_cud_log_item *cudp,
45 struct xfs_defer_ops *dop,
46 enum xfs_refcount_intent_type type, 45 enum xfs_refcount_intent_type type,
47 xfs_fsblock_t startblock, 46 xfs_fsblock_t startblock,
48 xfs_extlen_t blockcount, 47 xfs_extlen_t blockcount,
@@ -52,7 +51,7 @@ xfs_trans_log_finish_refcount_update(
52{ 51{
53 int error; 52 int error;
54 53
55 error = xfs_refcount_finish_one(tp, dop, type, startblock, 54 error = xfs_refcount_finish_one(tp, type, startblock,
56 blockcount, new_fsb, new_len, pcur); 55 blockcount, new_fsb, new_len, pcur);
57 56
58 /* 57 /*
@@ -169,7 +168,6 @@ xfs_refcount_update_create_done(
169STATIC int 168STATIC int
170xfs_refcount_update_finish_item( 169xfs_refcount_update_finish_item(
171 struct xfs_trans *tp, 170 struct xfs_trans *tp,
172 struct xfs_defer_ops *dop,
173 struct list_head *item, 171 struct list_head *item,
174 void *done_item, 172 void *done_item,
175 void **state) 173 void **state)
@@ -180,7 +178,7 @@ xfs_refcount_update_finish_item(
180 int error; 178 int error;
181 179
182 refc = container_of(item, struct xfs_refcount_intent, ri_list); 180 refc = container_of(item, struct xfs_refcount_intent, ri_list);
183 error = xfs_trans_log_finish_refcount_update(tp, done_item, dop, 181 error = xfs_trans_log_finish_refcount_update(tp, done_item,
184 refc->ri_type, 182 refc->ri_type,
185 refc->ri_startblock, 183 refc->ri_startblock,
186 refc->ri_blockcount, 184 refc->ri_blockcount,
diff --git a/fs/xfs/xfs_trans_rmap.c b/fs/xfs/xfs_trans_rmap.c
index 726d8e2c0558..05b00e40251f 100644
--- a/fs/xfs/xfs_trans_rmap.c
+++ b/fs/xfs/xfs_trans_rmap.c
@@ -193,7 +193,6 @@ xfs_rmap_update_create_done(
193STATIC int 193STATIC int
194xfs_rmap_update_finish_item( 194xfs_rmap_update_finish_item(
195 struct xfs_trans *tp, 195 struct xfs_trans *tp,
196 struct xfs_defer_ops *dop,
197 struct list_head *item, 196 struct list_head *item,
198 void *done_item, 197 void *done_item,
199 void **state) 198 void **state)