.. | .. |
---|
1 | | -// SPDX-License-Identifier: GPL-2.0 |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
---|
2 | 2 | /* |
---|
3 | 3 | * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc. |
---|
4 | 4 | * All Rights Reserved. |
---|
.. | .. |
---|
54 | 54 | struct xfs_mount *mp; /* file system mount point */ |
---|
55 | 55 | struct xfs_buf *agbp; /* buffer for a.g. freelist header */ |
---|
56 | 56 | struct xfs_perag *pag; /* per-ag struct for this agno */ |
---|
57 | | - struct xfs_inode *ip; /* for userdata zeroing method */ |
---|
58 | 57 | xfs_fsblock_t fsbno; /* file system block number */ |
---|
59 | 58 | xfs_agnumber_t agno; /* allocation group number */ |
---|
60 | 59 | xfs_agblock_t agbno; /* allocation group-relative block # */ |
---|
.. | .. |
---|
83 | 82 | */ |
---|
84 | 83 | #define XFS_ALLOC_USERDATA (1 << 0)/* allocation is for user data*/ |
---|
85 | 84 | #define XFS_ALLOC_INITIAL_USER_DATA (1 << 1)/* special case start of file */ |
---|
86 | | -#define XFS_ALLOC_USERDATA_ZERO (1 << 2)/* zero extent on allocation */ |
---|
87 | | -#define XFS_ALLOC_NOBUSY (1 << 3)/* Busy extents not allowed */ |
---|
88 | | - |
---|
89 | | -static inline bool |
---|
90 | | -xfs_alloc_is_userdata(int datatype) |
---|
91 | | -{ |
---|
92 | | - return (datatype & ~XFS_ALLOC_NOBUSY) != 0; |
---|
93 | | -} |
---|
94 | | - |
---|
95 | | -static inline bool |
---|
96 | | -xfs_alloc_allow_busy_reuse(int datatype) |
---|
97 | | -{ |
---|
98 | | - return (datatype & XFS_ALLOC_NOBUSY) == 0; |
---|
99 | | -} |
---|
| 85 | +#define XFS_ALLOC_NOBUSY (1 << 2)/* Busy extents not allowed */ |
---|
100 | 86 | |
---|
101 | 87 | /* freespace limit calculations */ |
---|
102 | 88 | #define XFS_ALLOC_AGFL_RESERVE 4 |
---|
.. | .. |
---|
182 | 168 | struct xfs_trans *tp, /* transaction pointer */ |
---|
183 | 169 | xfs_fsblock_t bno, /* starting block number of extent */ |
---|
184 | 170 | xfs_extlen_t len, /* length of extent */ |
---|
185 | | - struct xfs_owner_info *oinfo, /* extent owner */ |
---|
| 171 | + const struct xfs_owner_info *oinfo, /* extent owner */ |
---|
186 | 172 | enum xfs_ag_resv_type type, /* block reservation type */ |
---|
187 | 173 | bool skip_discard); |
---|
188 | 174 | |
---|
.. | .. |
---|
191 | 177 | struct xfs_trans *tp, |
---|
192 | 178 | xfs_fsblock_t bno, |
---|
193 | 179 | xfs_extlen_t len, |
---|
194 | | - struct xfs_owner_info *oinfo, |
---|
| 180 | + const struct xfs_owner_info *oinfo, |
---|
195 | 181 | enum xfs_ag_resv_type type) |
---|
196 | 182 | { |
---|
197 | 183 | return __xfs_free_extent(tp, bno, len, oinfo, type, false); |
---|
.. | .. |
---|
250 | 236 | int xfs_agfl_walk(struct xfs_mount *mp, struct xfs_agf *agf, |
---|
251 | 237 | struct xfs_buf *agflbp, xfs_agfl_walk_fn walk_fn, void *priv); |
---|
252 | 238 | |
---|
| 239 | +static inline __be32 * |
---|
| 240 | +xfs_buf_to_agfl_bno( |
---|
| 241 | + struct xfs_buf *bp) |
---|
| 242 | +{ |
---|
| 243 | + if (xfs_sb_version_hascrc(&bp->b_mount->m_sb)) |
---|
| 244 | + return bp->b_addr + sizeof(struct xfs_agfl); |
---|
| 245 | + return bp->b_addr; |
---|
| 246 | +} |
---|
| 247 | + |
---|
253 | 248 | #endif /* __XFS_ALLOC_H__ */ |
---|