diff options
Diffstat (limited to 'fs/ocfs2/quota_global.c')
-rw-r--r-- | fs/ocfs2/quota_global.c | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c index a73f64166481..279aef68025b 100644 --- a/fs/ocfs2/quota_global.c +++ b/fs/ocfs2/quota_global.c | |||
@@ -11,7 +11,6 @@ | |||
11 | #include <linux/writeback.h> | 11 | #include <linux/writeback.h> |
12 | #include <linux/workqueue.h> | 12 | #include <linux/workqueue.h> |
13 | 13 | ||
14 | #define MLOG_MASK_PREFIX ML_QUOTA | ||
15 | #include <cluster/masklog.h> | 14 | #include <cluster/masklog.h> |
16 | 15 | ||
17 | #include "ocfs2_fs.h" | 16 | #include "ocfs2_fs.h" |
@@ -27,6 +26,7 @@ | |||
27 | #include "super.h" | 26 | #include "super.h" |
28 | #include "buffer_head_io.h" | 27 | #include "buffer_head_io.h" |
29 | #include "quota.h" | 28 | #include "quota.h" |
29 | #include "ocfs2_trace.h" | ||
30 | 30 | ||
31 | /* | 31 | /* |
32 | * Locking of quotas with OCFS2 is rather complex. Here are rules that | 32 | * Locking of quotas with OCFS2 is rather complex. Here are rules that |
@@ -130,8 +130,7 @@ int ocfs2_validate_quota_block(struct super_block *sb, struct buffer_head *bh) | |||
130 | struct ocfs2_disk_dqtrailer *dqt = | 130 | struct ocfs2_disk_dqtrailer *dqt = |
131 | ocfs2_block_dqtrailer(sb->s_blocksize, bh->b_data); | 131 | ocfs2_block_dqtrailer(sb->s_blocksize, bh->b_data); |
132 | 132 | ||
133 | mlog(0, "Validating quota block %llu\n", | 133 | trace_ocfs2_validate_quota_block((unsigned long long)bh->b_blocknr); |
134 | (unsigned long long)bh->b_blocknr); | ||
135 | 134 | ||
136 | BUG_ON(!buffer_uptodate(bh)); | 135 | BUG_ON(!buffer_uptodate(bh)); |
137 | 136 | ||
@@ -341,8 +340,6 @@ int ocfs2_global_read_info(struct super_block *sb, int type) | |||
341 | u64 pcount; | 340 | u64 pcount; |
342 | int status; | 341 | int status; |
343 | 342 | ||
344 | mlog_entry_void(); | ||
345 | |||
346 | /* Read global header */ | 343 | /* Read global header */ |
347 | gqinode = ocfs2_get_system_file_inode(OCFS2_SB(sb), ino[type], | 344 | gqinode = ocfs2_get_system_file_inode(OCFS2_SB(sb), ino[type], |
348 | OCFS2_INVALID_SLOT); | 345 | OCFS2_INVALID_SLOT); |
@@ -402,7 +399,8 @@ int ocfs2_global_read_info(struct super_block *sb, int type) | |||
402 | msecs_to_jiffies(oinfo->dqi_syncms)); | 399 | msecs_to_jiffies(oinfo->dqi_syncms)); |
403 | 400 | ||
404 | out_err: | 401 | out_err: |
405 | mlog_exit(status); | 402 | if (status) |
403 | mlog_errno(status); | ||
406 | return status; | 404 | return status; |
407 | out_unlock: | 405 | out_unlock: |
408 | ocfs2_unlock_global_qf(oinfo, 0); | 406 | ocfs2_unlock_global_qf(oinfo, 0); |
@@ -508,9 +506,10 @@ int __ocfs2_sync_dquot(struct dquot *dquot, int freeing) | |||
508 | olditime = dquot->dq_dqb.dqb_itime; | 506 | olditime = dquot->dq_dqb.dqb_itime; |
509 | oldbtime = dquot->dq_dqb.dqb_btime; | 507 | oldbtime = dquot->dq_dqb.dqb_btime; |
510 | ocfs2_global_disk2memdqb(dquot, &dqblk); | 508 | ocfs2_global_disk2memdqb(dquot, &dqblk); |
511 | mlog(0, "Syncing global dquot %u space %lld+%lld, inodes %lld+%lld\n", | 509 | trace_ocfs2_sync_dquot(dquot->dq_id, dquot->dq_dqb.dqb_curspace, |
512 | dquot->dq_id, dquot->dq_dqb.dqb_curspace, (long long)spacechange, | 510 | (long long)spacechange, |
513 | dquot->dq_dqb.dqb_curinodes, (long long)inodechange); | 511 | dquot->dq_dqb.dqb_curinodes, |
512 | (long long)inodechange); | ||
514 | if (!test_bit(DQ_LASTSET_B + QIF_SPACE_B, &dquot->dq_flags)) | 513 | if (!test_bit(DQ_LASTSET_B + QIF_SPACE_B, &dquot->dq_flags)) |
515 | dquot->dq_dqb.dqb_curspace += spacechange; | 514 | dquot->dq_dqb.dqb_curspace += spacechange; |
516 | if (!test_bit(DQ_LASTSET_B + QIF_INODES_B, &dquot->dq_flags)) | 515 | if (!test_bit(DQ_LASTSET_B + QIF_INODES_B, &dquot->dq_flags)) |
@@ -594,8 +593,8 @@ static int ocfs2_sync_dquot_helper(struct dquot *dquot, unsigned long type) | |||
594 | struct ocfs2_super *osb = OCFS2_SB(sb); | 593 | struct ocfs2_super *osb = OCFS2_SB(sb); |
595 | int status = 0; | 594 | int status = 0; |
596 | 595 | ||
597 | mlog_entry("id=%u qtype=%u type=%lu device=%s\n", dquot->dq_id, | 596 | trace_ocfs2_sync_dquot_helper(dquot->dq_id, dquot->dq_type, |
598 | dquot->dq_type, type, sb->s_id); | 597 | type, sb->s_id); |
599 | if (type != dquot->dq_type) | 598 | if (type != dquot->dq_type) |
600 | goto out; | 599 | goto out; |
601 | status = ocfs2_lock_global_qf(oinfo, 1); | 600 | status = ocfs2_lock_global_qf(oinfo, 1); |
@@ -621,7 +620,6 @@ static int ocfs2_sync_dquot_helper(struct dquot *dquot, unsigned long type) | |||
621 | out_ilock: | 620 | out_ilock: |
622 | ocfs2_unlock_global_qf(oinfo, 1); | 621 | ocfs2_unlock_global_qf(oinfo, 1); |
623 | out: | 622 | out: |
624 | mlog_exit(status); | ||
625 | return status; | 623 | return status; |
626 | } | 624 | } |
627 | 625 | ||
@@ -647,7 +645,7 @@ static int ocfs2_write_dquot(struct dquot *dquot) | |||
647 | struct ocfs2_super *osb = OCFS2_SB(dquot->dq_sb); | 645 | struct ocfs2_super *osb = OCFS2_SB(dquot->dq_sb); |
648 | int status = 0; | 646 | int status = 0; |
649 | 647 | ||
650 | mlog_entry("id=%u, type=%d", dquot->dq_id, dquot->dq_type); | 648 | trace_ocfs2_write_dquot(dquot->dq_id, dquot->dq_type); |
651 | 649 | ||
652 | handle = ocfs2_start_trans(osb, OCFS2_QWRITE_CREDITS); | 650 | handle = ocfs2_start_trans(osb, OCFS2_QWRITE_CREDITS); |
653 | if (IS_ERR(handle)) { | 651 | if (IS_ERR(handle)) { |
@@ -660,7 +658,6 @@ static int ocfs2_write_dquot(struct dquot *dquot) | |||
660 | mutex_unlock(&sb_dqopt(dquot->dq_sb)->dqio_mutex); | 658 | mutex_unlock(&sb_dqopt(dquot->dq_sb)->dqio_mutex); |
661 | ocfs2_commit_trans(osb, handle); | 659 | ocfs2_commit_trans(osb, handle); |
662 | out: | 660 | out: |
663 | mlog_exit(status); | ||
664 | return status; | 661 | return status; |
665 | } | 662 | } |
666 | 663 | ||
@@ -686,7 +683,7 @@ static int ocfs2_release_dquot(struct dquot *dquot) | |||
686 | struct ocfs2_super *osb = OCFS2_SB(dquot->dq_sb); | 683 | struct ocfs2_super *osb = OCFS2_SB(dquot->dq_sb); |
687 | int status = 0; | 684 | int status = 0; |
688 | 685 | ||
689 | mlog_entry("id=%u, type=%d", dquot->dq_id, dquot->dq_type); | 686 | trace_ocfs2_release_dquot(dquot->dq_id, dquot->dq_type); |
690 | 687 | ||
691 | mutex_lock(&dquot->dq_lock); | 688 | mutex_lock(&dquot->dq_lock); |
692 | /* Check whether we are not racing with some other dqget() */ | 689 | /* Check whether we are not racing with some other dqget() */ |
@@ -722,7 +719,8 @@ out_ilock: | |||
722 | ocfs2_unlock_global_qf(oinfo, 1); | 719 | ocfs2_unlock_global_qf(oinfo, 1); |
723 | out: | 720 | out: |
724 | mutex_unlock(&dquot->dq_lock); | 721 | mutex_unlock(&dquot->dq_lock); |
725 | mlog_exit(status); | 722 | if (status) |
723 | mlog_errno(status); | ||
726 | return status; | 724 | return status; |
727 | } | 725 | } |
728 | 726 | ||
@@ -743,7 +741,7 @@ static int ocfs2_acquire_dquot(struct dquot *dquot) | |||
743 | int need_alloc = ocfs2_global_qinit_alloc(sb, type); | 741 | int need_alloc = ocfs2_global_qinit_alloc(sb, type); |
744 | handle_t *handle; | 742 | handle_t *handle; |
745 | 743 | ||
746 | mlog_entry("id=%u, type=%d", dquot->dq_id, type); | 744 | trace_ocfs2_acquire_dquot(dquot->dq_id, type); |
747 | mutex_lock(&dquot->dq_lock); | 745 | mutex_lock(&dquot->dq_lock); |
748 | /* | 746 | /* |
749 | * We need an exclusive lock, because we're going to update use count | 747 | * We need an exclusive lock, because we're going to update use count |
@@ -809,7 +807,8 @@ out_dq: | |||
809 | set_bit(DQ_ACTIVE_B, &dquot->dq_flags); | 807 | set_bit(DQ_ACTIVE_B, &dquot->dq_flags); |
810 | out: | 808 | out: |
811 | mutex_unlock(&dquot->dq_lock); | 809 | mutex_unlock(&dquot->dq_lock); |
812 | mlog_exit(status); | 810 | if (status) |
811 | mlog_errno(status); | ||
813 | return status; | 812 | return status; |
814 | } | 813 | } |
815 | 814 | ||
@@ -829,7 +828,7 @@ static int ocfs2_mark_dquot_dirty(struct dquot *dquot) | |||
829 | handle_t *handle; | 828 | handle_t *handle; |
830 | struct ocfs2_super *osb = OCFS2_SB(sb); | 829 | struct ocfs2_super *osb = OCFS2_SB(sb); |
831 | 830 | ||
832 | mlog_entry("id=%u, type=%d", dquot->dq_id, type); | 831 | trace_ocfs2_mark_dquot_dirty(dquot->dq_id, type); |
833 | 832 | ||
834 | /* In case user set some limits, sync dquot immediately to global | 833 | /* In case user set some limits, sync dquot immediately to global |
835 | * quota file so that information propagates quicker */ | 834 | * quota file so that information propagates quicker */ |
@@ -866,7 +865,8 @@ out_dlock: | |||
866 | out_ilock: | 865 | out_ilock: |
867 | ocfs2_unlock_global_qf(oinfo, 1); | 866 | ocfs2_unlock_global_qf(oinfo, 1); |
868 | out: | 867 | out: |
869 | mlog_exit(status); | 868 | if (status) |
869 | mlog_errno(status); | ||
870 | return status; | 870 | return status; |
871 | } | 871 | } |
872 | 872 | ||
@@ -877,8 +877,6 @@ static int ocfs2_write_info(struct super_block *sb, int type) | |||
877 | int status = 0; | 877 | int status = 0; |
878 | struct ocfs2_mem_dqinfo *oinfo = sb_dqinfo(sb, type)->dqi_priv; | 878 | struct ocfs2_mem_dqinfo *oinfo = sb_dqinfo(sb, type)->dqi_priv; |
879 | 879 | ||
880 | mlog_entry_void(); | ||
881 | |||
882 | status = ocfs2_lock_global_qf(oinfo, 1); | 880 | status = ocfs2_lock_global_qf(oinfo, 1); |
883 | if (status < 0) | 881 | if (status < 0) |
884 | goto out; | 882 | goto out; |
@@ -893,7 +891,8 @@ static int ocfs2_write_info(struct super_block *sb, int type) | |||
893 | out_ilock: | 891 | out_ilock: |
894 | ocfs2_unlock_global_qf(oinfo, 1); | 892 | ocfs2_unlock_global_qf(oinfo, 1); |
895 | out: | 893 | out: |
896 | mlog_exit(status); | 894 | if (status) |
895 | mlog_errno(status); | ||
897 | return status; | 896 | return status; |
898 | } | 897 | } |
899 | 898 | ||