diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-12-12 11:46:23 -0500 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-12-12 11:47:16 -0500 |
commit | 66e3237e724c6650dca03627b40bb00a812d3f7a (patch) | |
tree | 84a31606547b538fb2e8fb4dd5b732f0444c53fb /fs/xfs/libxfs/xfs_rmap.h | |
parent | 02b100fb83f9b0f8719deef6c4ed973b4d9ce00c (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.h | 20 |
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 | ||
53 | static inline bool | 53 | static inline bool |
54 | xfs_rmap_should_skip_owner_update( | 54 | xfs_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 | ||
104 | static inline void | 104 | static inline void |
105 | xfs_owner_info_unpack( | 105 | xfs_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 | ||
138 | int xfs_rmap_alloc(struct xfs_trans *tp, struct xfs_buf *agbp, | 138 | int 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); |
141 | int xfs_rmap_free(struct xfs_trans *tp, struct xfs_buf *agbp, | 141 | int 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 | ||
145 | int xfs_rmap_lookup_le(struct xfs_btree_cur *cur, xfs_agblock_t bno, | 145 | int 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, | |||
218 | int xfs_rmap_has_record(struct xfs_btree_cur *cur, xfs_agblock_t bno, | 218 | int 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); |
220 | int xfs_rmap_record_exists(struct xfs_btree_cur *cur, xfs_agblock_t bno, | 220 | int 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); |
223 | int xfs_rmap_has_other_keys(struct xfs_btree_cur *cur, xfs_agblock_t bno, | 223 | int 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); |
226 | int xfs_rmap_map_raw(struct xfs_btree_cur *cur, struct xfs_rmap_irec *rmap); | 226 | int xfs_rmap_map_raw(struct xfs_btree_cur *cur, struct xfs_rmap_irec *rmap); |
227 | 227 | ||