aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_alloc.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-12-12 11:46:23 -0500
committerDarrick J. Wong <darrick.wong@oracle.com>2018-12-12 11:47:16 -0500
commit66e3237e724c6650dca03627b40bb00a812d3f7a (patch)
tree84a31606547b538fb2e8fb4dd5b732f0444c53fb /fs/xfs/libxfs/xfs_alloc.c
parent02b100fb83f9b0f8719deef6c4ed973b4d9ce00c (diff)
xfs: const-ify xfs_owner_info arguments
Only certain functions actually change the contents of an xfs_owner_info; the rest can accept a const struct pointer. This will enable us to save stack space by hoisting static owner info types to be const global variables. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_alloc.c')
-rw-r--r--fs/xfs/libxfs/xfs_alloc.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
index 4be387de8294..e9eb4b2768f2 100644
--- a/fs/xfs/libxfs/xfs_alloc.c
+++ b/fs/xfs/libxfs/xfs_alloc.c
@@ -1694,28 +1694,28 @@ error0:
1694 */ 1694 */
1695STATIC int 1695STATIC int
1696xfs_free_ag_extent( 1696xfs_free_ag_extent(
1697 xfs_trans_t *tp, 1697 struct xfs_trans *tp,
1698 xfs_buf_t *agbp, 1698 struct xfs_buf *agbp,
1699 xfs_agnumber_t agno, 1699 xfs_agnumber_t agno,
1700 xfs_agblock_t bno, 1700 xfs_agblock_t bno,
1701 xfs_extlen_t len, 1701 xfs_extlen_t len,
1702 struct xfs_owner_info *oinfo, 1702 const struct xfs_owner_info *oinfo,
1703 enum xfs_ag_resv_type type) 1703 enum xfs_ag_resv_type type)
1704{ 1704{
1705 xfs_btree_cur_t *bno_cur; /* cursor for by-block btree */ 1705 struct xfs_mount *mp;
1706 xfs_btree_cur_t *cnt_cur; /* cursor for by-size btree */ 1706 struct xfs_perag *pag;
1707 int error; /* error return value */ 1707 struct xfs_btree_cur *bno_cur;
1708 xfs_agblock_t gtbno; /* start of right neighbor block */ 1708 struct xfs_btree_cur *cnt_cur;
1709 xfs_extlen_t gtlen; /* length of right neighbor block */ 1709 xfs_agblock_t gtbno; /* start of right neighbor */
1710 int haveleft; /* have a left neighbor block */ 1710 xfs_extlen_t gtlen; /* length of right neighbor */
1711 int haveright; /* have a right neighbor block */ 1711 xfs_agblock_t ltbno; /* start of left neighbor */
1712 int i; /* temp, result code */ 1712 xfs_extlen_t ltlen; /* length of left neighbor */
1713 xfs_agblock_t ltbno; /* start of left neighbor block */ 1713 xfs_agblock_t nbno; /* new starting block of freesp */
1714 xfs_extlen_t ltlen; /* length of left neighbor block */ 1714 xfs_extlen_t nlen; /* new length of freespace */
1715 xfs_mount_t *mp; /* mount point struct for filesystem */ 1715 int haveleft; /* have a left neighbor */
1716 xfs_agblock_t nbno; /* new starting block of freespace */ 1716 int haveright; /* have a right neighbor */
1717 xfs_extlen_t nlen; /* new length of freespace */ 1717 int i;
1718 xfs_perag_t *pag; /* per allocation group data */ 1718 int error;
1719 1719
1720 bno_cur = cnt_cur = NULL; 1720 bno_cur = cnt_cur = NULL;
1721 mp = tp->t_mountp; 1721 mp = tp->t_mountp;
@@ -3008,21 +3008,21 @@ out:
3008 * Just break up the extent address and hand off to xfs_free_ag_extent 3008 * Just break up the extent address and hand off to xfs_free_ag_extent
3009 * after fixing up the freelist. 3009 * after fixing up the freelist.
3010 */ 3010 */
3011int /* error */ 3011int
3012__xfs_free_extent( 3012__xfs_free_extent(
3013 struct xfs_trans *tp, /* transaction pointer */ 3013 struct xfs_trans *tp,
3014 xfs_fsblock_t bno, /* starting block number of extent */ 3014 xfs_fsblock_t bno,
3015 xfs_extlen_t len, /* length of extent */ 3015 xfs_extlen_t len,
3016 struct xfs_owner_info *oinfo, /* extent owner */ 3016 const struct xfs_owner_info *oinfo,
3017 enum xfs_ag_resv_type type, /* block reservation type */ 3017 enum xfs_ag_resv_type type,
3018 bool skip_discard) 3018 bool skip_discard)
3019{ 3019{
3020 struct xfs_mount *mp = tp->t_mountp; 3020 struct xfs_mount *mp = tp->t_mountp;
3021 struct xfs_buf *agbp; 3021 struct xfs_buf *agbp;
3022 xfs_agnumber_t agno = XFS_FSB_TO_AGNO(mp, bno); 3022 xfs_agnumber_t agno = XFS_FSB_TO_AGNO(mp, bno);
3023 xfs_agblock_t agbno = XFS_FSB_TO_AGBNO(mp, bno); 3023 xfs_agblock_t agbno = XFS_FSB_TO_AGBNO(mp, bno);
3024 int error; 3024 int error;
3025 unsigned int busy_flags = 0; 3025 unsigned int busy_flags = 0;
3026 3026
3027 ASSERT(len != 0); 3027 ASSERT(len != 0);
3028 ASSERT(type != XFS_AG_RESV_AGFL); 3028 ASSERT(type != XFS_AG_RESV_AGFL);