aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/trans.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2008-02-01 08:16:55 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2008-03-31 05:40:42 -0400
commit5731be53e3d82aedd06e02574f833a57b07a08d2 (patch)
tree8877d9c51ac96a3455d8ac5e3148cd7af62d7c98 /fs/gfs2/trans.c
parentac576cc5bed0dd7759e2b196468c7df93d6aeeee (diff)
[GFS2] Update gfs2_trans_add_unrevoke to accept extents
By adding an extra argument to gfs2_trans_add_unrevoke we can now specify an extent length of blocks to unrevoke. This means that we only need to make one pass through the list for each extent rather than each block. Currently the only extent length which is used is 1, but that will change in the future. Also gfs2_trans_add_unrevoke is removed from gfs2_alloc_meta since its the only difference between this and gfs2_alloc_data which is left. This will allow a future patch to merge these two functions into one (i.e. one call to allocate both data and metadata in a single extent in the future). Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/trans.c')
-rw-r--r--fs/gfs2/trans.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c
index 73e5d92a657c..f677b8a83f0c 100644
--- a/fs/gfs2/trans.c
+++ b/fs/gfs2/trans.c
@@ -146,30 +146,25 @@ void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd)
146 lops_add(sdp, &bd->bd_le); 146 lops_add(sdp, &bd->bd_le);
147} 147}
148 148
149void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno) 149void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len)
150{ 150{
151 struct gfs2_bufdata *bd; 151 struct gfs2_bufdata *bd, *tmp;
152 int found = 0; 152 struct gfs2_trans *tr = current->journal_info;
153 unsigned int n = len;
153 154
154 gfs2_log_lock(sdp); 155 gfs2_log_lock(sdp);
155 156 list_for_each_entry_safe(bd, tmp, &sdp->sd_log_le_revoke, bd_le.le_list) {
156 list_for_each_entry(bd, &sdp->sd_log_le_revoke, bd_le.le_list) { 157 if ((bd->bd_blkno >= blkno) && (bd->bd_blkno < (blkno + len))) {
157 if (bd->bd_blkno == blkno) {
158 list_del_init(&bd->bd_le.le_list); 158 list_del_init(&bd->bd_le.le_list);
159 gfs2_assert_withdraw(sdp, sdp->sd_log_num_revoke); 159 gfs2_assert_withdraw(sdp, sdp->sd_log_num_revoke);
160 sdp->sd_log_num_revoke--; 160 sdp->sd_log_num_revoke--;
161 found = 1; 161 kmem_cache_free(gfs2_bufdata_cachep, bd);
162 break; 162 tr->tr_num_revoke_rm++;
163 if (--n == 0)
164 break;
163 } 165 }
164 } 166 }
165
166 gfs2_log_unlock(sdp); 167 gfs2_log_unlock(sdp);
167
168 if (found) {
169 struct gfs2_trans *tr = current->journal_info;
170 kmem_cache_free(gfs2_bufdata_cachep, bd);
171 tr->tr_num_revoke_rm++;
172 }
173} 168}
174 169
175void gfs2_trans_add_rg(struct gfs2_rgrpd *rgd) 170void gfs2_trans_add_rg(struct gfs2_rgrpd *rgd)