[PATCH 11/18] xfs: reduce min. inode allocation space requirement for sparse inode chunks
Brian Foster
bfoster at redhat.com
Thu Jul 24 09:23:01 CDT 2014
xfs_ialloc_ag_select() iterates through the allocation groups looking
for free inodes or free space to determine whether to allow an inode
allocation to proceed. If no free inodes are available, it assumes that
an AG must have an extent longer than mp->m_ialloc_blks.
Sparse inode chunk support currently allows for allocations as small as
the cluster size. If sparse inodes are supported, use the cluster
alignment as a minimum extent size limit to determine whether an inode
chunk allocation attempt can proceed.
Signed-off-by: Brian Foster <bfoster at redhat.com>
---
fs/xfs/libxfs/xfs_ialloc.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
index 4dd45c2..4e98a21 100644
--- a/fs/xfs/libxfs/xfs_ialloc.c
+++ b/fs/xfs/libxfs/xfs_ialloc.c
@@ -770,9 +770,15 @@ xfs_ialloc_ag_select(
/*
* Is there enough free space for the file plus a block of
- * inodes? (if we need to allocate some)?
+ * inodes? (if we need to allocate some)? If sparse inode chunks
+ * are supported, we only require an extent of length equal to
+ * the cluster size.
*/
- ineed = mp->m_ialloc_blks;
+ if (xfs_sb_version_hassparseinodes(&mp->m_sb))
+ ineed = xfs_ialloc_cluster_alignment(mp);
+ else
+ ineed = mp->m_ialloc_blks;
+
longest = pag->pagf_longest;
if (!longest)
longest = pag->pagf_flcount > 0;
--
1.8.3.1
More information about the xfs
mailing list