aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/lops.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2007-09-02 10:39:43 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2007-10-10 03:56:07 -0400
commit82e86087bb774cd54d47db4a7c771b5b29bea9ed (patch)
treec067773861203becfa6c8cf9e4ee449787cf65f6 /fs/gfs2/lops.c
parent8475487befb29eeb038fef374a7433d276336a25 (diff)
[GFS2] Replace revoke structure with bufdata structure
Both the revoke structure and the bufdata structure are quite similar. They are basically small tags which are put on lists. In addition to which the revoke structure is always allocated when there is a bufdata structure which is (or can be) freed. As such it should be possible to reduce the number of frees and allocations by using the same structure for both purposes. This patch is the first step along that path. It replaces existing uses of the revoke structure with the bufdata structure. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/lops.c')
-rw-r--r--fs/gfs2/lops.c10
1 files changed, 5 insertions, 5 deletions
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 }