diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-10-30 01:57:51 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@sgi.com> | 2008-10-30 01:57:51 -0400 |
commit | d4b3a4b7dd62f2e111d4d0afa9ef3f9b6cd955c0 (patch) | |
tree | cd0b5a46d81fa9d9b0253c489f64ad698e3a0fa9 /fs/xfs/xfs_ialloc_btree.c | |
parent | 4b22a57188d87e873346b73c227607715be96399 (diff) |
[XFS] move xfs_bmbt_killroot to common code
xfs_bmbt_killroot is a mostly generic implementation of moving from a real
block based root to an inode based root. So move it to xfs_btree.c where
it can use all the nice infrastructure there and make it pointer size
agnostic
The new name for it is xfs_btree_kill_iroot, following the old naming but
making it clear we're dealing with the root in inode case here, and to
avoid confusion with xfs_btree_new_root which is used for the not inode
rooted case. I've also added a comment describing what it does and why
it's named the way it is.
SGI-PV: 985583
SGI-Modid: xfs-linux-melb:xfs-kern:32203a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Bill O'Donnell <billodo@sgi.com>
Signed-off-by: David Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_ialloc_btree.c')
-rw-r--r-- | fs/xfs/xfs_ialloc_btree.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/xfs/xfs_ialloc_btree.c b/fs/xfs/xfs_ialloc_btree.c index 8f66e2720566..90f1d4ee7720 100644 --- a/fs/xfs/xfs_ialloc_btree.c +++ b/fs/xfs/xfs_ialloc_btree.c | |||
@@ -754,6 +754,22 @@ xfs_inobt_alloc_block( | |||
754 | return 0; | 754 | return 0; |
755 | } | 755 | } |
756 | 756 | ||
757 | STATIC int | ||
758 | xfs_inobt_free_block( | ||
759 | struct xfs_btree_cur *cur, | ||
760 | struct xfs_buf *bp) | ||
761 | { | ||
762 | xfs_fsblock_t fsbno; | ||
763 | int error; | ||
764 | |||
765 | fsbno = XFS_DADDR_TO_FSB(cur->bc_mp, XFS_BUF_ADDR(bp)); | ||
766 | error = xfs_free_extent(cur->bc_tp, fsbno, 1); | ||
767 | if (error) | ||
768 | return error; | ||
769 | |||
770 | xfs_trans_binval(cur->bc_tp, bp); | ||
771 | return error; | ||
772 | } | ||
757 | 773 | ||
758 | STATIC int | 774 | STATIC int |
759 | xfs_inobt_get_maxrecs( | 775 | xfs_inobt_get_maxrecs( |
@@ -886,6 +902,7 @@ static const struct xfs_btree_ops xfs_inobt_ops = { | |||
886 | .dup_cursor = xfs_inobt_dup_cursor, | 902 | .dup_cursor = xfs_inobt_dup_cursor, |
887 | .set_root = xfs_inobt_set_root, | 903 | .set_root = xfs_inobt_set_root, |
888 | .alloc_block = xfs_inobt_alloc_block, | 904 | .alloc_block = xfs_inobt_alloc_block, |
905 | .free_block = xfs_inobt_free_block, | ||
889 | .get_maxrecs = xfs_inobt_get_maxrecs, | 906 | .get_maxrecs = xfs_inobt_get_maxrecs, |
890 | .init_key_from_rec = xfs_inobt_init_key_from_rec, | 907 | .init_key_from_rec = xfs_inobt_init_key_from_rec, |
891 | .init_rec_from_key = xfs_inobt_init_rec_from_key, | 908 | .init_rec_from_key = xfs_inobt_init_rec_from_key, |