diff options
author | David Chinner <dgc@sgi.com> | 2008-05-19 21:30:15 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-05-23 01:26:15 -0400 |
commit | c8f5f12e46f079a954d4f7163ba59dadee08ca26 (patch) | |
tree | af2f74b28429313db0a13a71b0be8d0351e53e5d /fs/xfs/xfs_inode.c | |
parent | 49383b0e98ad1f69ff4c816eb1961f703df12318 (diff) |
[XFS] Fix inode list allocation size in writeback.
We only need to allocate space for the number of inodes in the cluster
when writing back inodes, not every byte in the inode cluster. This
reduces the amount of memory needing to be allocated to 256 bytes instead
of 64k.
SGI-PV: 981949
SGI-Modid: xfs-linux-melb:xfs-kern:31182a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r-- | fs/xfs/xfs_inode.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 739ea45a9d10..e569bf5d6cf0 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -2974,6 +2974,7 @@ xfs_iflush_cluster( | |||
2974 | xfs_mount_t *mp = ip->i_mount; | 2974 | xfs_mount_t *mp = ip->i_mount; |
2975 | xfs_perag_t *pag = xfs_get_perag(mp, ip->i_ino); | 2975 | xfs_perag_t *pag = xfs_get_perag(mp, ip->i_ino); |
2976 | unsigned long first_index, mask; | 2976 | unsigned long first_index, mask; |
2977 | unsigned long inodes_per_cluster; | ||
2977 | int ilist_size; | 2978 | int ilist_size; |
2978 | xfs_inode_t **ilist; | 2979 | xfs_inode_t **ilist; |
2979 | xfs_inode_t *iq; | 2980 | xfs_inode_t *iq; |
@@ -2985,7 +2986,8 @@ xfs_iflush_cluster( | |||
2985 | ASSERT(pag->pagi_inodeok); | 2986 | ASSERT(pag->pagi_inodeok); |
2986 | ASSERT(pag->pag_ici_init); | 2987 | ASSERT(pag->pag_ici_init); |
2987 | 2988 | ||
2988 | ilist_size = XFS_INODE_CLUSTER_SIZE(mp) * sizeof(xfs_inode_t *); | 2989 | inodes_per_cluster = XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog; |
2990 | ilist_size = inodes_per_cluster * sizeof(xfs_inode_t *); | ||
2989 | ilist = kmem_alloc(ilist_size, KM_MAYFAIL|KM_NOFS); | 2991 | ilist = kmem_alloc(ilist_size, KM_MAYFAIL|KM_NOFS); |
2990 | if (!ilist) | 2992 | if (!ilist) |
2991 | return 0; | 2993 | return 0; |
@@ -2995,8 +2997,7 @@ xfs_iflush_cluster( | |||
2995 | read_lock(&pag->pag_ici_lock); | 2997 | read_lock(&pag->pag_ici_lock); |
2996 | /* really need a gang lookup range call here */ | 2998 | /* really need a gang lookup range call here */ |
2997 | nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, (void**)ilist, | 2999 | nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, (void**)ilist, |
2998 | first_index, | 3000 | first_index, inodes_per_cluster); |
2999 | XFS_INODE_CLUSTER_SIZE(mp)); | ||
3000 | if (nr_found == 0) | 3001 | if (nr_found == 0) |
3001 | goto out_free; | 3002 | goto out_free; |
3002 | 3003 | ||