diff options
author | Jan Kara <jack@suse.cz> | 2010-04-27 18:22:30 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-05-21 13:30:46 -0400 |
commit | f64dd44eb748438783b10b3f7a4968d2656a3c95 (patch) | |
tree | 21d73e0ed7140c8a61331eacd65157cc0983a16d /fs/ocfs2/quota_global.c | |
parent | bc8e5f07392f05c47c8bdeff4f7098db440d065c (diff) |
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 <Joel.Becker@oracle.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ocfs2/quota_global.c')
-rw-r--r-- | fs/ocfs2/quota_global.c | 14 |
1 files changed, 14 insertions, 0 deletions
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 @@ | |||
25 | #include "dlmglue.h" | 25 | #include "dlmglue.h" |
26 | #include "uptodate.h" | 26 | #include "uptodate.h" |
27 | #include "super.h" | 27 | #include "super.h" |
28 | #include "buffer_head_io.h" | ||
28 | #include "quota.h" | 29 | #include "quota.h" |
29 | 30 | ||
30 | static struct workqueue_struct *ocfs2_quota_wq = NULL; | 31 | static struct workqueue_struct *ocfs2_quota_wq = NULL; |
@@ -137,6 +138,19 @@ int ocfs2_read_quota_block(struct inode *inode, u64 v_block, | |||
137 | return rc; | 138 | return rc; |
138 | } | 139 | } |
139 | 140 | ||
141 | int ocfs2_read_quota_phys_block(struct inode *inode, u64 p_block, | ||
142 | struct buffer_head **bhp) | ||
143 | { | ||
144 | int rc; | ||
145 | |||
146 | *bhp = NULL; | ||
147 | rc = ocfs2_read_blocks(INODE_CACHE(inode), p_block, 1, bhp, 0, | ||
148 | ocfs2_validate_quota_block); | ||
149 | if (rc) | ||
150 | mlog_errno(rc); | ||
151 | return rc; | ||
152 | } | ||
153 | |||
140 | static int ocfs2_get_quota_block(struct inode *inode, int block, | 154 | static int ocfs2_get_quota_block(struct inode *inode, int block, |
141 | struct buffer_head **bh) | 155 | struct buffer_head **bh) |
142 | { | 156 | { |