diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2016-08-03 05:30:31 +0300 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-08-03 05:30:31 +0300 |
commit | 51ce9d000c0a80bddf9a93a4232283cc9a4564c0 (patch) | |
tree | 9986b59cc53e7bec56f5b14468204e22ba33ad13 /fs/xfs/xfs_trans_rmap.c | |
parent | e127fafd1d3c46532903d530dfa69822d3d35d8a (diff) | |
download | linux-51ce9d000c0a80bddf9a93a4232283cc9a4564c0.tar.xz |
xfs: collapse single use static functions
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_trans_rmap.c')
-rw-r--r-- | fs/xfs/xfs_trans_rmap.c | 103 |
1 files changed, 33 insertions, 70 deletions
diff --git a/fs/xfs/xfs_trans_rmap.c b/fs/xfs/xfs_trans_rmap.c index 35650d6b2606..5a50ef881568 100644 --- a/fs/xfs/xfs_trans_rmap.c +++ b/fs/xfs/xfs_trans_rmap.c @@ -31,32 +31,6 @@ #include "xfs_alloc.h" #include "xfs_rmap.h" -/* - * This routine is called to allocate an "rmap update intent" - * log item that will hold nextents worth of extents. The - * caller must use all nextents extents, because we are not - * flexible about this at all. - */ -STATIC struct xfs_rui_log_item * -xfs_trans_get_rui( - struct xfs_trans *tp, - uint nextents) -{ - struct xfs_rui_log_item *ruip; - - ASSERT(tp != NULL); - ASSERT(nextents > 0); - - ruip = xfs_rui_init(tp->t_mountp, nextents); - ASSERT(ruip != NULL); - - /* - * Get a log_item_desc to point at the new item. - */ - xfs_trans_add_item(tp, &ruip->rui_item); - return ruip; -} - /* Set the map extent flags for this reverse mapping. */ static void xfs_trans_set_rmap_flags( @@ -91,44 +65,6 @@ xfs_trans_set_rmap_flags( } } -/* - * This routine is called to indicate that the described reverse - * mapping is to be logged as needing to be updated. It should be - * called once for each mapping. - */ -STATIC void -xfs_trans_log_start_rmap_update( - struct xfs_trans *tp, - struct xfs_rui_log_item *ruip, - enum xfs_rmap_intent_type type, - __uint64_t owner, - int whichfork, - xfs_fileoff_t startoff, - xfs_fsblock_t startblock, - xfs_filblks_t blockcount, - xfs_exntst_t state) -{ - uint next_extent; - struct xfs_map_extent *rmap; - - tp->t_flags |= XFS_TRANS_DIRTY; - ruip->rui_item.li_desc->lid_flags |= XFS_LID_DIRTY; - - /* - * atomic_inc_return gives us the value after the increment; - * we want to use it as an array index so we need to subtract 1 from - * it. - */ - next_extent = atomic_inc_return(&ruip->rui_next_extent) - 1; - ASSERT(next_extent < ruip->rui_format.rui_nextents); - rmap = &(ruip->rui_format.rui_extents[next_extent]); - rmap->me_owner = owner; - rmap->me_startblock = startblock; - rmap->me_startoff = startoff; - rmap->me_len = blockcount; - xfs_trans_set_rmap_flags(rmap, type, whichfork, state); -} - struct xfs_rud_log_item * xfs_trans_get_rud( struct xfs_trans *tp, @@ -200,7 +136,19 @@ xfs_rmap_update_create_intent( struct xfs_trans *tp, unsigned int count) { - return xfs_trans_get_rui(tp, count); + struct xfs_rui_log_item *ruip; + + ASSERT(tp != NULL); + ASSERT(count > 0); + + ruip = xfs_rui_init(tp->t_mountp, count); + ASSERT(ruip != NULL); + + /* + * Get a log_item_desc to point at the new item. + */ + xfs_trans_add_item(tp, &ruip->rui_item); + return ruip; } /* Log rmap updates in the intent item. */ @@ -210,14 +158,29 @@ xfs_rmap_update_log_item( void *intent, struct list_head *item) { + struct xfs_rui_log_item *ruip = intent; struct xfs_rmap_intent *rmap; + uint next_extent; + struct xfs_map_extent *map; rmap = container_of(item, struct xfs_rmap_intent, ri_list); - xfs_trans_log_start_rmap_update(tp, intent, rmap->ri_type, - rmap->ri_owner, rmap->ri_whichfork, - rmap->ri_bmap.br_startoff, - rmap->ri_bmap.br_startblock, - rmap->ri_bmap.br_blockcount, + + tp->t_flags |= XFS_TRANS_DIRTY; + ruip->rui_item.li_desc->lid_flags |= XFS_LID_DIRTY; + + /* + * atomic_inc_return gives us the value after the increment; + * we want to use it as an array index so we need to subtract 1 from + * it. + */ + next_extent = atomic_inc_return(&ruip->rui_next_extent) - 1; + ASSERT(next_extent < ruip->rui_format.rui_nextents); + map = &ruip->rui_format.rui_extents[next_extent]; + map->me_owner = rmap->ri_owner; + map->me_startblock = rmap->ri_bmap.br_startblock; + map->me_startoff = rmap->ri_bmap.br_startoff; + map->me_len = rmap->ri_bmap.br_blockcount; + xfs_trans_set_rmap_flags(map, rmap->ri_type, rmap->ri_whichfork, rmap->ri_bmap.br_state); } |