diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/xfs_ag.h | 10 | ||||
-rw-r--r-- | fs/xfs/xfs_alloc.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_mount.c | 3 |
3 files changed, 5 insertions, 12 deletions
diff --git a/fs/xfs/xfs_ag.h b/fs/xfs/xfs_ag.h index 963bc2700bf7..b1a5a1ff88ea 100644 --- a/fs/xfs/xfs_ag.h +++ b/fs/xfs/xfs_ag.h | |||
@@ -187,14 +187,8 @@ typedef struct xfs_perag_busy { | |||
187 | /* | 187 | /* |
188 | * Per-ag incore structure, copies of information in agf and agi, | 188 | * Per-ag incore structure, copies of information in agf and agi, |
189 | * to improve the performance of allocation group selection. | 189 | * to improve the performance of allocation group selection. |
190 | * | ||
191 | * pick sizes which fit in allocation buckets well | ||
192 | */ | 190 | */ |
193 | #if (BITS_PER_LONG == 32) | ||
194 | #define XFS_PAGB_NUM_SLOTS 84 | ||
195 | #elif (BITS_PER_LONG == 64) | ||
196 | #define XFS_PAGB_NUM_SLOTS 128 | 191 | #define XFS_PAGB_NUM_SLOTS 128 |
197 | #endif | ||
198 | 192 | ||
199 | typedef struct xfs_perag { | 193 | typedef struct xfs_perag { |
200 | struct xfs_mount *pag_mount; /* owner filesystem */ | 194 | struct xfs_mount *pag_mount; /* owner filesystem */ |
@@ -212,8 +206,6 @@ typedef struct xfs_perag { | |||
212 | __uint32_t pagf_btreeblks; /* # of blocks held in AGF btrees */ | 206 | __uint32_t pagf_btreeblks; /* # of blocks held in AGF btrees */ |
213 | xfs_agino_t pagi_freecount; /* number of free inodes */ | 207 | xfs_agino_t pagi_freecount; /* number of free inodes */ |
214 | xfs_agino_t pagi_count; /* number of allocated inodes */ | 208 | xfs_agino_t pagi_count; /* number of allocated inodes */ |
215 | int pagb_count; /* pagb slots in use */ | ||
216 | xfs_perag_busy_t *pagb_list; /* unstable blocks */ | ||
217 | 209 | ||
218 | /* | 210 | /* |
219 | * Inode allocation search lookup optimisation. | 211 | * Inode allocation search lookup optimisation. |
@@ -232,6 +224,8 @@ typedef struct xfs_perag { | |||
232 | rwlock_t pag_ici_lock; /* incore inode lock */ | 224 | rwlock_t pag_ici_lock; /* incore inode lock */ |
233 | struct radix_tree_root pag_ici_root; /* incore inode cache root */ | 225 | struct radix_tree_root pag_ici_root; /* incore inode cache root */ |
234 | #endif | 226 | #endif |
227 | int pagb_count; /* pagb slots in use */ | ||
228 | xfs_perag_busy_t pagb_list[XFS_PAGB_NUM_SLOTS]; /* unstable blocks */ | ||
235 | } xfs_perag_t; | 229 | } xfs_perag_t; |
236 | 230 | ||
237 | /* | 231 | /* |
diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c index 4d66bb75579c..8aa181d6dd7d 100644 --- a/fs/xfs/xfs_alloc.c +++ b/fs/xfs/xfs_alloc.c | |||
@@ -2200,8 +2200,8 @@ xfs_alloc_read_agf( | |||
2200 | pag->pagf_levels[XFS_BTNUM_CNTi] = | 2200 | pag->pagf_levels[XFS_BTNUM_CNTi] = |
2201 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNTi]); | 2201 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNTi]); |
2202 | spin_lock_init(&pag->pagb_lock); | 2202 | spin_lock_init(&pag->pagb_lock); |
2203 | pag->pagb_list = kmem_zalloc(XFS_PAGB_NUM_SLOTS * | 2203 | pag->pagb_count = 0; |
2204 | sizeof(xfs_perag_busy_t), KM_SLEEP); | 2204 | memset(pag->pagb_list, 0, sizeof(pag->pagb_list)); |
2205 | pag->pagf_init = 1; | 2205 | pag->pagf_init = 1; |
2206 | } | 2206 | } |
2207 | #ifdef DEBUG | 2207 | #ifdef DEBUG |
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index be643e588067..0df5045abd3b 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -247,10 +247,9 @@ xfs_free_perag( | |||
247 | for (agno = 0; agno < mp->m_sb.sb_agcount; agno++) { | 247 | for (agno = 0; agno < mp->m_sb.sb_agcount; agno++) { |
248 | spin_lock(&mp->m_perag_lock); | 248 | spin_lock(&mp->m_perag_lock); |
249 | pag = radix_tree_delete(&mp->m_perag_tree, agno); | 249 | pag = radix_tree_delete(&mp->m_perag_tree, agno); |
250 | ASSERT(pag); | ||
250 | ASSERT(atomic_read(&pag->pag_ref) == 0); | 251 | ASSERT(atomic_read(&pag->pag_ref) == 0); |
251 | spin_unlock(&mp->m_perag_lock); | 252 | spin_unlock(&mp->m_perag_lock); |
252 | ASSERT(pag); | ||
253 | kmem_free(pag->pagb_list); | ||
254 | kmem_free(pag); | 253 | kmem_free(pag); |
255 | } | 254 | } |
256 | } | 255 | } |