diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/incore.h | 13 | ||||
-rw-r--r-- | fs/gfs2/lops.c | 10 | ||||
-rw-r--r-- | fs/gfs2/trans.c | 20 |
3 files changed, 22 insertions, 21 deletions
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 388dc1bd736f..8aa5780862be 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h | |||
@@ -114,7 +114,13 @@ struct gfs2_bufdata { | |||
114 | struct buffer_head *bd_bh; | 114 | struct buffer_head *bd_bh; |
115 | struct gfs2_glock *bd_gl; | 115 | struct gfs2_glock *bd_gl; |
116 | 116 | ||
117 | struct list_head bd_list_tr; | 117 | union { |
118 | struct list_head list_tr; | ||
119 | u64 blkno; | ||
120 | } u; | ||
121 | #define bd_list_tr u.list_tr | ||
122 | #define bd_blkno u.blkno | ||
123 | |||
118 | struct gfs2_log_element bd_le; | 124 | struct gfs2_log_element bd_le; |
119 | 125 | ||
120 | struct gfs2_ail *bd_ail; | 126 | struct gfs2_ail *bd_ail; |
@@ -298,11 +304,6 @@ struct gfs2_file { | |||
298 | struct gfs2_holder f_fl_gh; | 304 | struct gfs2_holder f_fl_gh; |
299 | }; | 305 | }; |
300 | 306 | ||
301 | struct gfs2_revoke { | ||
302 | struct gfs2_log_element rv_le; | ||
303 | u64 rv_blkno; | ||
304 | }; | ||
305 | |||
306 | struct gfs2_revoke_replay { | 307 | struct gfs2_revoke_replay { |
307 | struct list_head rr_list; | 308 | struct list_head rr_list; |
308 | u64 rr_blkno; | 309 | u64 rr_blkno; |
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 7e2d4e692b50..cf6fe3631554 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c | |||
@@ -357,7 +357,7 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp) | |||
357 | struct buffer_head *bh; | 357 | struct buffer_head *bh; |
358 | unsigned int offset; | 358 | unsigned int offset; |
359 | struct list_head *head = &sdp->sd_log_le_revoke; | 359 | struct list_head *head = &sdp->sd_log_le_revoke; |
360 | struct gfs2_revoke *rv; | 360 | struct gfs2_bufdata *bd; |
361 | 361 | ||
362 | if (!sdp->sd_log_num_revoke) | 362 | if (!sdp->sd_log_num_revoke) |
363 | return; | 363 | return; |
@@ -376,8 +376,8 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp) | |||
376 | offset = sizeof(struct gfs2_log_descriptor); | 376 | offset = sizeof(struct gfs2_log_descriptor); |
377 | 377 | ||
378 | while (!list_empty(head)) { | 378 | while (!list_empty(head)) { |
379 | rv = list_entry(head->next, struct gfs2_revoke, rv_le.le_list); | 379 | bd = list_entry(head->next, struct gfs2_bufdata, bd_le.le_list); |
380 | list_del_init(&rv->rv_le.le_list); | 380 | list_del_init(&bd->bd_le.le_list); |
381 | sdp->sd_log_num_revoke--; | 381 | sdp->sd_log_num_revoke--; |
382 | 382 | ||
383 | if (offset + sizeof(u64) > sdp->sd_sb.sb_bsize) { | 383 | if (offset + sizeof(u64) > sdp->sd_sb.sb_bsize) { |
@@ -392,8 +392,8 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp) | |||
392 | offset = sizeof(struct gfs2_meta_header); | 392 | offset = sizeof(struct gfs2_meta_header); |
393 | } | 393 | } |
394 | 394 | ||
395 | *(__be64 *)(bh->b_data + offset) = cpu_to_be64(rv->rv_blkno); | 395 | *(__be64 *)(bh->b_data + offset) = cpu_to_be64(bd->bd_blkno); |
396 | kfree(rv); | 396 | kfree(bd); |
397 | 397 | ||
398 | offset += sizeof(u64); | 398 | offset += sizeof(u64); |
399 | } | 399 | } |
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c index f8dabf8446bb..eadf96e00510 100644 --- a/fs/gfs2/trans.c +++ b/fs/gfs2/trans.c | |||
@@ -144,23 +144,23 @@ void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta) | |||
144 | 144 | ||
145 | void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, u64 blkno) | 145 | void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, u64 blkno) |
146 | { | 146 | { |
147 | struct gfs2_revoke *rv = kmalloc(sizeof(struct gfs2_revoke), | 147 | struct gfs2_bufdata *bd = kmalloc(sizeof(struct gfs2_bufdata), |
148 | GFP_NOFS | __GFP_NOFAIL); | 148 | GFP_NOFS | __GFP_NOFAIL); |
149 | lops_init_le(&rv->rv_le, &gfs2_revoke_lops); | 149 | lops_init_le(&bd->bd_le, &gfs2_revoke_lops); |
150 | rv->rv_blkno = blkno; | 150 | bd->bd_blkno = blkno; |
151 | lops_add(sdp, &rv->rv_le); | 151 | lops_add(sdp, &bd->bd_le); |
152 | } | 152 | } |
153 | 153 | ||
154 | void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno) | 154 | void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno) |
155 | { | 155 | { |
156 | struct gfs2_revoke *rv; | 156 | struct gfs2_bufdata *bd; |
157 | int found = 0; | 157 | int found = 0; |
158 | 158 | ||
159 | gfs2_log_lock(sdp); | 159 | gfs2_log_lock(sdp); |
160 | 160 | ||
161 | list_for_each_entry(rv, &sdp->sd_log_le_revoke, rv_le.le_list) { | 161 | list_for_each_entry(bd, &sdp->sd_log_le_revoke, bd_le.le_list) { |
162 | if (rv->rv_blkno == blkno) { | 162 | if (bd->bd_blkno == blkno) { |
163 | list_del(&rv->rv_le.le_list); | 163 | list_del(&bd->bd_le.le_list); |
164 | gfs2_assert_withdraw(sdp, sdp->sd_log_num_revoke); | 164 | gfs2_assert_withdraw(sdp, sdp->sd_log_num_revoke); |
165 | sdp->sd_log_num_revoke--; | 165 | sdp->sd_log_num_revoke--; |
166 | found = 1; | 166 | found = 1; |
@@ -172,7 +172,7 @@ void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno) | |||
172 | 172 | ||
173 | if (found) { | 173 | if (found) { |
174 | struct gfs2_trans *tr = current->journal_info; | 174 | struct gfs2_trans *tr = current->journal_info; |
175 | kfree(rv); | 175 | kfree(bd); |
176 | tr->tr_num_revoke_rm++; | 176 | tr->tr_num_revoke_rm++; |
177 | } | 177 | } |
178 | } | 178 | } |