diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2007-09-03 11:01:33 +0100 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2007-10-10 08:56:12 +0100 |
commit | 1ad38c437fa33f85ba4b6a85ea8c5478ee72d5bd (patch) | |
tree | 11a5fc7993ba9ae343fc72f03f9a11f312fd6128 /fs/gfs2/lops.c | |
parent | 0820ab517e1b100ee3f9584ec27f93309689ebe7 (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/lops.c')
-rw-r--r-- | fs/gfs2/lops.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 4cbef4c23a6b..342c10e12af2 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -343,11 +343,8 @@ static void revoke_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) tr = current->journal_info; tr->tr_touched = 1; tr->tr_num_revoke++; - - gfs2_log_lock(sdp); sdp->sd_log_num_revoke++; list_add(&le->le_list, &sdp->sd_log_le_revoke); - gfs2_log_unlock(sdp); } static void revoke_lo_before_commit(struct gfs2_sbd *sdp) |