diff options
author | Jan Kara <jack@suse.cz> | 2010-04-28 13:04:29 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-05-21 13:30:46 -0400 |
commit | ae4f6ef13417deaa49471c0e903914a3ef3be258 (patch) | |
tree | b8ba5499a8ad69678a232ece4d64d18447063054 /fs/ocfs2/quota_local.c | |
parent | f64dd44eb748438783b10b3f7a4968d2656a3c95 (diff) |
ocfs2: Avoid unnecessary block mapping when refreshing quota info
The position of global quota file info does not change. So we do not have
to do logical -> physical block translation every time we reread it from
disk. Thus we can also avoid taking ip_alloc_sem.
Acked-by: Joel Becker <Joel.Becker@oracle.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ocfs2/quota_local.c')
-rw-r--r-- | fs/ocfs2/quota_local.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c index a88f1d1ec2b4..962e8380852b 100644 --- a/fs/ocfs2/quota_local.c +++ b/fs/ocfs2/quota_local.c | |||
@@ -671,7 +671,7 @@ static int ocfs2_local_read_info(struct super_block *sb, int type) | |||
671 | INIT_LIST_HEAD(&oinfo->dqi_chunk); | 671 | INIT_LIST_HEAD(&oinfo->dqi_chunk); |
672 | oinfo->dqi_rec = NULL; | 672 | oinfo->dqi_rec = NULL; |
673 | oinfo->dqi_lqi_bh = NULL; | 673 | oinfo->dqi_lqi_bh = NULL; |
674 | oinfo->dqi_ibh = NULL; | 674 | oinfo->dqi_libh = NULL; |
675 | 675 | ||
676 | status = ocfs2_global_read_info(sb, type); | 676 | status = ocfs2_global_read_info(sb, type); |
677 | if (status < 0) | 677 | if (status < 0) |
@@ -697,7 +697,7 @@ static int ocfs2_local_read_info(struct super_block *sb, int type) | |||
697 | info->dqi_flags = le32_to_cpu(ldinfo->dqi_flags); | 697 | info->dqi_flags = le32_to_cpu(ldinfo->dqi_flags); |
698 | oinfo->dqi_chunks = le32_to_cpu(ldinfo->dqi_chunks); | 698 | oinfo->dqi_chunks = le32_to_cpu(ldinfo->dqi_chunks); |
699 | oinfo->dqi_blocks = le32_to_cpu(ldinfo->dqi_blocks); | 699 | oinfo->dqi_blocks = le32_to_cpu(ldinfo->dqi_blocks); |
700 | oinfo->dqi_ibh = bh; | 700 | oinfo->dqi_libh = bh; |
701 | 701 | ||
702 | /* We crashed when using local quota file? */ | 702 | /* We crashed when using local quota file? */ |
703 | if (!(info->dqi_flags & OLQF_CLEAN)) { | 703 | if (!(info->dqi_flags & OLQF_CLEAN)) { |
@@ -759,7 +759,7 @@ static int ocfs2_local_write_info(struct super_block *sb, int type) | |||
759 | { | 759 | { |
760 | struct mem_dqinfo *info = sb_dqinfo(sb, type); | 760 | struct mem_dqinfo *info = sb_dqinfo(sb, type); |
761 | struct buffer_head *bh = ((struct ocfs2_mem_dqinfo *)info->dqi_priv) | 761 | struct buffer_head *bh = ((struct ocfs2_mem_dqinfo *)info->dqi_priv) |
762 | ->dqi_ibh; | 762 | ->dqi_libh; |
763 | int status; | 763 | int status; |
764 | 764 | ||
765 | status = ocfs2_modify_bh(sb_dqopt(sb)->files[type], bh, olq_update_info, | 765 | status = ocfs2_modify_bh(sb_dqopt(sb)->files[type], bh, olq_update_info, |
@@ -820,7 +820,7 @@ static int ocfs2_local_free_info(struct super_block *sb, int type) | |||
820 | /* Mark local file as clean */ | 820 | /* Mark local file as clean */ |
821 | info->dqi_flags |= OLQF_CLEAN; | 821 | info->dqi_flags |= OLQF_CLEAN; |
822 | status = ocfs2_modify_bh(sb_dqopt(sb)->files[type], | 822 | status = ocfs2_modify_bh(sb_dqopt(sb)->files[type], |
823 | oinfo->dqi_ibh, | 823 | oinfo->dqi_libh, |
824 | olq_update_info, | 824 | olq_update_info, |
825 | info); | 825 | info); |
826 | if (status < 0) { | 826 | if (status < 0) { |
@@ -830,7 +830,7 @@ static int ocfs2_local_free_info(struct super_block *sb, int type) | |||
830 | 830 | ||
831 | out: | 831 | out: |
832 | ocfs2_inode_unlock(sb_dqopt(sb)->files[type], 1); | 832 | ocfs2_inode_unlock(sb_dqopt(sb)->files[type], 1); |
833 | brelse(oinfo->dqi_ibh); | 833 | brelse(oinfo->dqi_libh); |
834 | brelse(oinfo->dqi_lqi_bh); | 834 | brelse(oinfo->dqi_lqi_bh); |
835 | kfree(oinfo); | 835 | kfree(oinfo); |
836 | return 0; | 836 | return 0; |