From f64dd44eb748438783b10b3f7a4968d2656a3c95 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Wed, 28 Apr 2010 00:22:30 +0200 Subject: ocfs2: Do not map blocks from local quota file on each write There is no need to map offset of local dquot structure to on disk block in each quota write. It is enough to map it just once and store the physical block number in quota structure in memory. Moreover this simplifies locking as we do not have to take ip_alloc_sem from quota write path. Acked-by: Joel Becker Signed-off-by: Jan Kara --- fs/ocfs2/quota_global.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'fs/ocfs2/quota_global.c') diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c index 04ae76d8c6ab..f461f9678f9f 100644 --- a/fs/ocfs2/quota_global.c +++ b/fs/ocfs2/quota_global.c @@ -25,6 +25,7 @@ #include "dlmglue.h" #include "uptodate.h" #include "super.h" +#include "buffer_head_io.h" #include "quota.h" static struct workqueue_struct *ocfs2_quota_wq = NULL; @@ -137,6 +138,19 @@ int ocfs2_read_quota_block(struct inode *inode, u64 v_block, return rc; } +int ocfs2_read_quota_phys_block(struct inode *inode, u64 p_block, + struct buffer_head **bhp) +{ + int rc; + + *bhp = NULL; + rc = ocfs2_read_blocks(INODE_CACHE(inode), p_block, 1, bhp, 0, + ocfs2_validate_quota_block); + if (rc) + mlog_errno(rc); + return rc; +} + static int ocfs2_get_quota_block(struct inode *inode, int block, struct buffer_head **bh) { -- cgit v1.2.3