aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/super.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2007-12-11 19:49:21 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2008-01-25 03:11:46 -0500
commitda6dd40d59fa9617ed697b90114e197036901632 (patch)
tree49e869021ed1f911bf3cdf185e9c4ce75c67f42a /fs/gfs2/super.c
parente9e1ef2b6ee401d7c1e1eb38052857b4b206d172 (diff)
[GFS2] Journal extent mapping
This patch saves a little time when gfs2 writes to the journals by keeping a mapping between logical and physical blocks on disk. That's better than constantly looking up indirect pointers in buffers, when the journals are several levels of indirection (which they typically are). Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r--fs/gfs2/super.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 2e74792ee487..22e09660d648 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. 3 * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
4 * 4 *
5 * This copyrighted material is made available to anyone wishing to use, 5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions 6 * modify, copy, or redistribute it subject to the terms and conditions
@@ -416,8 +416,9 @@ int gfs2_jindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ji_gh)
416 416
417void gfs2_jindex_free(struct gfs2_sbd *sdp) 417void gfs2_jindex_free(struct gfs2_sbd *sdp)
418{ 418{
419 struct list_head list; 419 struct list_head list, *head;
420 struct gfs2_jdesc *jd; 420 struct gfs2_jdesc *jd;
421 struct gfs2_journal_extent *jext;
421 422
422 spin_lock(&sdp->sd_jindex_spin); 423 spin_lock(&sdp->sd_jindex_spin);
423 list_add(&list, &sdp->sd_jindex_list); 424 list_add(&list, &sdp->sd_jindex_list);
@@ -427,6 +428,14 @@ void gfs2_jindex_free(struct gfs2_sbd *sdp)
427 428
428 while (!list_empty(&list)) { 429 while (!list_empty(&list)) {
429 jd = list_entry(list.next, struct gfs2_jdesc, jd_list); 430 jd = list_entry(list.next, struct gfs2_jdesc, jd_list);
431 head = &jd->extent_list;
432 while (!list_empty(head)) {
433 jext = list_entry(head->next,
434 struct gfs2_journal_extent,
435 extent_list);
436 list_del(&jext->extent_list);
437 kfree(jext);
438 }
430 list_del(&jd->jd_list); 439 list_del(&jd->jd_list);
431 iput(jd->jd_inode); 440 iput(jd->jd_inode);
432 kfree(jd); 441 kfree(jd);