diff options
author | Dave Chinner <dchinner@redhat.com> | 2010-09-24 04:40:15 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2010-10-18 16:07:52 -0400 |
commit | 65d0f20533c503b50bd5e7e86434512af7761eea (patch) | |
tree | 0e04d6898fc0c729886067a3daf79b10a7a19992 /fs/xfs/xfs_mount.c | |
parent | 69d6cc76cff3573ceefda178b75e20878866fdc3 (diff) |
xfs: split inode AG walking into separate code for reclaim
The reclaim walk requires different locking and has a slightly
different walk algorithm, so separate it out so that it can be
optimised separately.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_mount.c')
-rw-r--r-- | fs/xfs/xfs_mount.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 912101d280bf..d66e87c7c3a6 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -219,6 +219,32 @@ xfs_perag_get(struct xfs_mount *mp, xfs_agnumber_t agno) | |||
219 | return pag; | 219 | return pag; |
220 | } | 220 | } |
221 | 221 | ||
222 | /* | ||
223 | * search from @first to find the next perag with the given tag set. | ||
224 | */ | ||
225 | struct xfs_perag * | ||
226 | xfs_perag_get_tag( | ||
227 | struct xfs_mount *mp, | ||
228 | xfs_agnumber_t first, | ||
229 | int tag) | ||
230 | { | ||
231 | struct xfs_perag *pag; | ||
232 | int found; | ||
233 | int ref; | ||
234 | |||
235 | rcu_read_lock(); | ||
236 | found = radix_tree_gang_lookup_tag(&mp->m_perag_tree, | ||
237 | (void **)&pag, first, 1, tag); | ||
238 | if (found <= 0) { | ||
239 | rcu_read_unlock(); | ||
240 | return NULL; | ||
241 | } | ||
242 | ref = atomic_inc_return(&pag->pag_ref); | ||
243 | rcu_read_unlock(); | ||
244 | trace_xfs_perag_get_tag(mp, pag->pag_agno, ref, _RET_IP_); | ||
245 | return pag; | ||
246 | } | ||
247 | |||
222 | void | 248 | void |
223 | xfs_perag_put(struct xfs_perag *pag) | 249 | xfs_perag_put(struct xfs_perag *pag) |
224 | { | 250 | { |