aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/log.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2007-09-03 06:01:33 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2007-10-10 03:56:12 -0400
commit1ad38c437fa33f85ba4b6a85ea8c5478ee72d5bd (patch)
tree11a5fc7993ba9ae343fc72f03f9a11f312fd6128 /fs/gfs2/log.c
parent0820ab517e1b100ee3f9584ec27f93309689ebe7 (diff)
[GFS2] Clean up gfs2_trans_add_revoke()
The following alters gfs2_trans_add_revoke() to take a struct gfs2_bufdata as an argument. This eliminates the memory allocation which was previously required by making use of the already existing struct gfs2_bufdata. It makes some sanity checks to ensure that the gfs2_bufdata has been removed from all the lists before its recycled as a revoke structure. This saves one memory allocation and one free per revoke structure. Also as a result, and to simplify the locking, since there is no longer any blocking code in gfs2_trans_add_revoke() we must hold the log lock whenever this function is called. This reduces the amount of times we take and unlock the log lock. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/log.c')
-rw-r--r--fs/gfs2/log.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 20fa528d457d..4d04e6f19706 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -71,8 +71,8 @@ unsigned int gfs2_struct2blk(struct gfs2_sbd *sdp, unsigned int nstruct,
71void gfs2_remove_from_ail(struct address_space *mapping, struct gfs2_bufdata *bd) 71void gfs2_remove_from_ail(struct address_space *mapping, struct gfs2_bufdata *bd)
72{ 72{
73 bd->bd_ail = NULL; 73 bd->bd_ail = NULL;
74 list_del(&bd->bd_ail_st_list); 74 list_del_init(&bd->bd_ail_st_list);
75 list_del(&bd->bd_ail_gl_list); 75 list_del_init(&bd->bd_ail_gl_list);
76 atomic_dec(&bd->bd_gl->gl_ail_count); 76 atomic_dec(&bd->bd_gl->gl_ail_count);
77 if (mapping) 77 if (mapping)
78 gfs2_meta_cache_flush(GFS2_I(mapping->host)); 78 gfs2_meta_cache_flush(GFS2_I(mapping->host));