aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_itable.c
diff options
context:
space:
mode:
authorDavid Chinner <david@fromorbit.com>2008-10-30 01:11:59 -0400
committerLachlan McIlroy <lachlan@sgi.com>2008-10-30 01:11:59 -0400
commit07c8f67587724b417f60bffb32c448dd94647b54 (patch)
tree01f6cf39be93dd5515481d09d282c503e05ef79f /fs/xfs/xfs_itable.c
parente946217e4fdaa67681bbabfa8e6b18641921f750 (diff)
[XFS] Make use of the init-once slab optimisation.
To avoid having to initialise some fields of the XFS inode on every allocation, we can use the slab init-once feature to initialise them. All we have to guarantee is that when we free the inode, all it's entries are in the initial state. Add asserts where possible to ensure debug kernels check this initial state before freeing and after allocation. SGI-PV: 981498 SGI-Modid: xfs-linux-melb:xfs-kern:31925a Signed-off-by: David Chinner <david@fromorbit.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org>
Diffstat (limited to 'fs/xfs/xfs_itable.c')
-rw-r--r--fs/xfs/xfs_itable.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
index cf6754a3c5b3..4f4c93941067 100644
--- a/fs/xfs/xfs_itable.c
+++ b/fs/xfs/xfs_itable.c
@@ -594,21 +594,21 @@ xfs_bulkstat(
594 /* 594 /*
595 * Get the inode cluster buffer 595 * Get the inode cluster buffer
596 */ 596 */
597 ASSERT(xfs_inode_zone != NULL);
598 ip = kmem_zone_zalloc(xfs_inode_zone,
599 KM_SLEEP);
600 ip->i_ino = ino;
601 ip->i_mount = mp;
602 spin_lock_init(&ip->i_flags_lock);
603 if (bp) 597 if (bp)
604 xfs_buf_relse(bp); 598 xfs_buf_relse(bp);
599 ip = xfs_inode_alloc(mp, ino);
600 if (!ip) {
601 bp = NULL;
602 rval = ENOMEM;
603 break;
604 }
605 error = xfs_itobp(mp, NULL, ip, 605 error = xfs_itobp(mp, NULL, ip,
606 &dip, &bp, bno, 606 &dip, &bp, bno,
607 XFS_IMAP_BULKSTAT, 607 XFS_IMAP_BULKSTAT,
608 XFS_BUF_LOCK); 608 XFS_BUF_LOCK);
609 if (!error) 609 if (!error)
610 clustidx = ip->i_boffset / mp->m_sb.sb_inodesize; 610 clustidx = ip->i_boffset / mp->m_sb.sb_inodesize;
611 kmem_zone_free(xfs_inode_zone, ip); 611 xfs_idestroy(ip);
612 if (XFS_TEST_ERROR(error != 0, 612 if (XFS_TEST_ERROR(error != 0,
613 mp, XFS_ERRTAG_BULKSTAT_READ_CHUNK, 613 mp, XFS_ERRTAG_BULKSTAT_READ_CHUNK,
614 XFS_RANDOM_BULKSTAT_READ_CHUNK)) { 614 XFS_RANDOM_BULKSTAT_READ_CHUNK)) {