diff options
author | Dave Chinner <david@fromorbit.com> | 2010-01-11 06:47:42 -0500 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2010-01-15 16:33:22 -0500 |
commit | 4196ac08c023c6dab90c3fa460d9c06deaa304c4 (patch) | |
tree | ec73915586a45d0a2d459014560138fd499180d9 /fs/xfs/xfs_filestream.h | |
parent | a862e0fdcb8862aab2538ec2fc2f0dc07a625c59 (diff) |
xfs: Convert filestreams code to use per-ag get/put routines
Use xfs_perag_get() and xfs_perag_put() in the filestreams code.
Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_filestream.h')
-rw-r--r-- | fs/xfs/xfs_filestream.h | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/fs/xfs/xfs_filestream.h b/fs/xfs/xfs_filestream.h index 4aba67c5f64f..58378b2ea033 100644 --- a/fs/xfs/xfs_filestream.h +++ b/fs/xfs/xfs_filestream.h | |||
@@ -79,12 +79,21 @@ extern ktrace_t *xfs_filestreams_trace_buf; | |||
79 | * the cache that reference per-ag array elements that have since been | 79 | * the cache that reference per-ag array elements that have since been |
80 | * reallocated. | 80 | * reallocated. |
81 | */ | 81 | */ |
82 | /* | ||
83 | * xfs_filestream_peek_ag is only used in tracing code | ||
84 | */ | ||
82 | static inline int | 85 | static inline int |
83 | xfs_filestream_peek_ag( | 86 | xfs_filestream_peek_ag( |
84 | xfs_mount_t *mp, | 87 | xfs_mount_t *mp, |
85 | xfs_agnumber_t agno) | 88 | xfs_agnumber_t agno) |
86 | { | 89 | { |
87 | return atomic_read(&mp->m_perag[agno].pagf_fstrms); | 90 | struct xfs_perag *pag; |
91 | int ret; | ||
92 | |||
93 | pag = xfs_perag_get(mp, agno); | ||
94 | ret = atomic_read(&pag->pagf_fstrms); | ||
95 | xfs_perag_put(pag); | ||
96 | return ret; | ||
88 | } | 97 | } |
89 | 98 | ||
90 | static inline int | 99 | static inline int |
@@ -92,7 +101,13 @@ xfs_filestream_get_ag( | |||
92 | xfs_mount_t *mp, | 101 | xfs_mount_t *mp, |
93 | xfs_agnumber_t agno) | 102 | xfs_agnumber_t agno) |
94 | { | 103 | { |
95 | return atomic_inc_return(&mp->m_perag[agno].pagf_fstrms); | 104 | struct xfs_perag *pag; |
105 | int ret; | ||
106 | |||
107 | pag = xfs_perag_get(mp, agno); | ||
108 | ret = atomic_inc_return(&pag->pagf_fstrms); | ||
109 | xfs_perag_put(pag); | ||
110 | return ret; | ||
96 | } | 111 | } |
97 | 112 | ||
98 | static inline int | 113 | static inline int |
@@ -100,7 +115,13 @@ xfs_filestream_put_ag( | |||
100 | xfs_mount_t *mp, | 115 | xfs_mount_t *mp, |
101 | xfs_agnumber_t agno) | 116 | xfs_agnumber_t agno) |
102 | { | 117 | { |
103 | return atomic_dec_return(&mp->m_perag[agno].pagf_fstrms); | 118 | struct xfs_perag *pag; |
119 | int ret; | ||
120 | |||
121 | pag = xfs_perag_get(mp, agno); | ||
122 | ret = atomic_dec_return(&pag->pagf_fstrms); | ||
123 | xfs_perag_put(pag); | ||
124 | return ret; | ||
104 | } | 125 | } |
105 | 126 | ||
106 | /* allocation selection flags */ | 127 | /* allocation selection flags */ |