diff options
Diffstat (limited to 'fs/gfs2/lops.c')
-rw-r--r-- | fs/gfs2/lops.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 6c33d7b6e0c4..17c5b5d7dc88 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/gfs2_ondisk.h> | 16 | #include <linux/gfs2_ondisk.h> |
17 | #include <linux/bio.h> | 17 | #include <linux/bio.h> |
18 | #include <linux/fs.h> | 18 | #include <linux/fs.h> |
19 | #include <linux/list_sort.h> | ||
19 | 20 | ||
20 | #include "gfs2.h" | 21 | #include "gfs2.h" |
21 | #include "incore.h" | 22 | #include "incore.h" |
@@ -401,6 +402,20 @@ static void gfs2_check_magic(struct buffer_head *bh) | |||
401 | kunmap_atomic(kaddr); | 402 | kunmap_atomic(kaddr); |
402 | } | 403 | } |
403 | 404 | ||
405 | static int blocknr_cmp(void *priv, struct list_head *a, struct list_head *b) | ||
406 | { | ||
407 | struct gfs2_bufdata *bda, *bdb; | ||
408 | |||
409 | bda = list_entry(a, struct gfs2_bufdata, bd_list); | ||
410 | bdb = list_entry(b, struct gfs2_bufdata, bd_list); | ||
411 | |||
412 | if (bda->bd_bh->b_blocknr < bdb->bd_bh->b_blocknr) | ||
413 | return -1; | ||
414 | if (bda->bd_bh->b_blocknr > bdb->bd_bh->b_blocknr) | ||
415 | return 1; | ||
416 | return 0; | ||
417 | } | ||
418 | |||
404 | static void gfs2_before_commit(struct gfs2_sbd *sdp, unsigned int limit, | 419 | static void gfs2_before_commit(struct gfs2_sbd *sdp, unsigned int limit, |
405 | unsigned int total, struct list_head *blist, | 420 | unsigned int total, struct list_head *blist, |
406 | bool is_databuf) | 421 | bool is_databuf) |
@@ -413,6 +428,7 @@ static void gfs2_before_commit(struct gfs2_sbd *sdp, unsigned int limit, | |||
413 | __be64 *ptr; | 428 | __be64 *ptr; |
414 | 429 | ||
415 | gfs2_log_lock(sdp); | 430 | gfs2_log_lock(sdp); |
431 | list_sort(NULL, blist, blocknr_cmp); | ||
416 | bd1 = bd2 = list_prepare_entry(bd1, blist, bd_list); | 432 | bd1 = bd2 = list_prepare_entry(bd1, blist, bd_list); |
417 | while(total) { | 433 | while(total) { |
418 | num = total; | 434 | num = total; |
@@ -590,6 +606,7 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp) | |||
590 | struct page *page; | 606 | struct page *page; |
591 | unsigned int length; | 607 | unsigned int length; |
592 | 608 | ||
609 | gfs2_write_revokes(sdp); | ||
593 | if (!sdp->sd_log_num_revoke) | 610 | if (!sdp->sd_log_num_revoke) |
594 | return; | 611 | return; |
595 | 612 | ||
@@ -836,10 +853,6 @@ const struct gfs2_log_operations gfs2_revoke_lops = { | |||
836 | .lo_name = "revoke", | 853 | .lo_name = "revoke", |
837 | }; | 854 | }; |
838 | 855 | ||
839 | const struct gfs2_log_operations gfs2_rg_lops = { | ||
840 | .lo_name = "rg", | ||
841 | }; | ||
842 | |||
843 | const struct gfs2_log_operations gfs2_databuf_lops = { | 856 | const struct gfs2_log_operations gfs2_databuf_lops = { |
844 | .lo_before_commit = databuf_lo_before_commit, | 857 | .lo_before_commit = databuf_lo_before_commit, |
845 | .lo_after_commit = databuf_lo_after_commit, | 858 | .lo_after_commit = databuf_lo_after_commit, |
@@ -851,7 +864,6 @@ const struct gfs2_log_operations gfs2_databuf_lops = { | |||
851 | const struct gfs2_log_operations *gfs2_log_ops[] = { | 864 | const struct gfs2_log_operations *gfs2_log_ops[] = { |
852 | &gfs2_databuf_lops, | 865 | &gfs2_databuf_lops, |
853 | &gfs2_buf_lops, | 866 | &gfs2_buf_lops, |
854 | &gfs2_rg_lops, | ||
855 | &gfs2_revoke_lops, | 867 | &gfs2_revoke_lops, |
856 | NULL, | 868 | NULL, |
857 | }; | 869 | }; |