aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_rmap.h
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_rmap.h
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_rmap.h')
-rw-r--r--fs/xfs/libxfs/xfs_rmap.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/xfs/libxfs/xfs_rmap.h b/fs/xfs/libxfs/xfs_rmap.h
index 157dc722ad35..6d32838aa184 100644
--- a/fs/xfs/libxfs/xfs_rmap.h
+++ b/fs/xfs/libxfs/xfs_rmap.h
@@ -52,7 +52,7 @@ xfs_rmap_skip_owner_update(
52 52
53static inline bool 53static inline bool
54xfs_rmap_should_skip_owner_update( 54xfs_rmap_should_skip_owner_update(
55 struct xfs_owner_info *oi) 55 const struct xfs_owner_info *oi)
56{ 56{
57 return oi->oi_owner == XFS_RMAP_OWN_NULL; 57 return oi->oi_owner == XFS_RMAP_OWN_NULL;
58} 58}
@@ -103,12 +103,12 @@ xfs_rmap_irec_offset_unpack(
103 103
104static inline void 104static inline void
105xfs_owner_info_unpack( 105xfs_owner_info_unpack(
106 struct xfs_owner_info *oinfo, 106 const struct xfs_owner_info *oinfo,
107 uint64_t *owner, 107 uint64_t *owner,
108 uint64_t *offset, 108 uint64_t *offset,
109 unsigned int *flags) 109 unsigned int *flags)
110{ 110{
111 unsigned int r = 0; 111 unsigned int r = 0;
112 112
113 *owner = oinfo->oi_owner; 113 *owner = oinfo->oi_owner;
114 *offset = oinfo->oi_offset; 114 *offset = oinfo->oi_offset;
@@ -137,10 +137,10 @@ xfs_owner_info_pack(
137 137
138int xfs_rmap_alloc(struct xfs_trans *tp, struct xfs_buf *agbp, 138int xfs_rmap_alloc(struct xfs_trans *tp, struct xfs_buf *agbp,
139 xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len, 139 xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len,
140 struct xfs_owner_info *oinfo); 140 const struct xfs_owner_info *oinfo);
141int xfs_rmap_free(struct xfs_trans *tp, struct xfs_buf *agbp, 141int xfs_rmap_free(struct xfs_trans *tp, struct xfs_buf *agbp,
142 xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len, 142 xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len,
143 struct xfs_owner_info *oinfo); 143 const struct xfs_owner_info *oinfo);
144 144
145int xfs_rmap_lookup_le(struct xfs_btree_cur *cur, xfs_agblock_t bno, 145int xfs_rmap_lookup_le(struct xfs_btree_cur *cur, xfs_agblock_t bno,
146 xfs_extlen_t len, uint64_t owner, uint64_t offset, 146 xfs_extlen_t len, uint64_t owner, uint64_t offset,
@@ -218,10 +218,10 @@ int xfs_rmap_btrec_to_irec(union xfs_btree_rec *rec,
218int xfs_rmap_has_record(struct xfs_btree_cur *cur, xfs_agblock_t bno, 218int xfs_rmap_has_record(struct xfs_btree_cur *cur, xfs_agblock_t bno,
219 xfs_extlen_t len, bool *exists); 219 xfs_extlen_t len, bool *exists);
220int xfs_rmap_record_exists(struct xfs_btree_cur *cur, xfs_agblock_t bno, 220int xfs_rmap_record_exists(struct xfs_btree_cur *cur, xfs_agblock_t bno,
221 xfs_extlen_t len, struct xfs_owner_info *oinfo, 221 xfs_extlen_t len, const struct xfs_owner_info *oinfo,
222 bool *has_rmap); 222 bool *has_rmap);
223int xfs_rmap_has_other_keys(struct xfs_btree_cur *cur, xfs_agblock_t bno, 223int xfs_rmap_has_other_keys(struct xfs_btree_cur *cur, xfs_agblock_t bno,
224 xfs_extlen_t len, struct xfs_owner_info *oinfo, 224 xfs_extlen_t len, const struct xfs_owner_info *oinfo,
225 bool *has_rmap); 225 bool *has_rmap);
226int xfs_rmap_map_raw(struct xfs_btree_cur *cur, struct xfs_rmap_irec *rmap); 226int xfs_rmap_map_raw(struct xfs_btree_cur *cur, struct xfs_rmap_irec *rmap);
227 227