xfs: make the start pointer passed to btree alloc_block functions const
The @start pointer passed to each per-AG btree type's ->alloc_block function isn't supposed to be modified, since it's a hint about the location of the btree block being split that is to be fed to the allocator, so mark the parameter const. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
b5a6e5fe0e
commit
deb06b9ab6
@ -50,10 +50,10 @@ xfs_allocbt_set_root(
|
|||||||
|
|
||||||
STATIC int
|
STATIC int
|
||||||
xfs_allocbt_alloc_block(
|
xfs_allocbt_alloc_block(
|
||||||
struct xfs_btree_cur *cur,
|
struct xfs_btree_cur *cur,
|
||||||
union xfs_btree_ptr *start,
|
const union xfs_btree_ptr *start,
|
||||||
union xfs_btree_ptr *new,
|
union xfs_btree_ptr *new,
|
||||||
int *stat)
|
int *stat)
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
xfs_agblock_t bno;
|
xfs_agblock_t bno;
|
||||||
|
@ -193,10 +193,10 @@ xfs_bmbt_update_cursor(
|
|||||||
|
|
||||||
STATIC int
|
STATIC int
|
||||||
xfs_bmbt_alloc_block(
|
xfs_bmbt_alloc_block(
|
||||||
struct xfs_btree_cur *cur,
|
struct xfs_btree_cur *cur,
|
||||||
union xfs_btree_ptr *start,
|
const union xfs_btree_ptr *start,
|
||||||
union xfs_btree_ptr *new,
|
union xfs_btree_ptr *new,
|
||||||
int *stat)
|
int *stat)
|
||||||
{
|
{
|
||||||
xfs_alloc_arg_t args; /* block allocation args */
|
xfs_alloc_arg_t args; /* block allocation args */
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
|
@ -110,7 +110,7 @@ struct xfs_btree_ops {
|
|||||||
|
|
||||||
/* block allocation / freeing */
|
/* block allocation / freeing */
|
||||||
int (*alloc_block)(struct xfs_btree_cur *cur,
|
int (*alloc_block)(struct xfs_btree_cur *cur,
|
||||||
union xfs_btree_ptr *start_bno,
|
const union xfs_btree_ptr *start_bno,
|
||||||
union xfs_btree_ptr *new_bno,
|
union xfs_btree_ptr *new_bno,
|
||||||
int *stat);
|
int *stat);
|
||||||
int (*free_block)(struct xfs_btree_cur *cur, struct xfs_buf *bp);
|
int (*free_block)(struct xfs_btree_cur *cur, struct xfs_buf *bp);
|
||||||
|
@ -59,10 +59,10 @@ xfs_btree_fakeroot_dup_cursor(
|
|||||||
*/
|
*/
|
||||||
STATIC int
|
STATIC int
|
||||||
xfs_btree_fakeroot_alloc_block(
|
xfs_btree_fakeroot_alloc_block(
|
||||||
struct xfs_btree_cur *cur,
|
struct xfs_btree_cur *cur,
|
||||||
union xfs_btree_ptr *start_bno,
|
const union xfs_btree_ptr *start_bno,
|
||||||
union xfs_btree_ptr *new_bno,
|
union xfs_btree_ptr *new_bno,
|
||||||
int *stat)
|
int *stat)
|
||||||
{
|
{
|
||||||
ASSERT(0);
|
ASSERT(0);
|
||||||
return -EFSCORRUPTED;
|
return -EFSCORRUPTED;
|
||||||
|
@ -88,11 +88,11 @@ xfs_inobt_mod_blockcount(
|
|||||||
|
|
||||||
STATIC int
|
STATIC int
|
||||||
__xfs_inobt_alloc_block(
|
__xfs_inobt_alloc_block(
|
||||||
struct xfs_btree_cur *cur,
|
struct xfs_btree_cur *cur,
|
||||||
union xfs_btree_ptr *start,
|
const union xfs_btree_ptr *start,
|
||||||
union xfs_btree_ptr *new,
|
union xfs_btree_ptr *new,
|
||||||
int *stat,
|
int *stat,
|
||||||
enum xfs_ag_resv_type resv)
|
enum xfs_ag_resv_type resv)
|
||||||
{
|
{
|
||||||
xfs_alloc_arg_t args; /* block allocation args */
|
xfs_alloc_arg_t args; /* block allocation args */
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
@ -127,20 +127,20 @@ __xfs_inobt_alloc_block(
|
|||||||
|
|
||||||
STATIC int
|
STATIC int
|
||||||
xfs_inobt_alloc_block(
|
xfs_inobt_alloc_block(
|
||||||
struct xfs_btree_cur *cur,
|
struct xfs_btree_cur *cur,
|
||||||
union xfs_btree_ptr *start,
|
const union xfs_btree_ptr *start,
|
||||||
union xfs_btree_ptr *new,
|
union xfs_btree_ptr *new,
|
||||||
int *stat)
|
int *stat)
|
||||||
{
|
{
|
||||||
return __xfs_inobt_alloc_block(cur, start, new, stat, XFS_AG_RESV_NONE);
|
return __xfs_inobt_alloc_block(cur, start, new, stat, XFS_AG_RESV_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC int
|
STATIC int
|
||||||
xfs_finobt_alloc_block(
|
xfs_finobt_alloc_block(
|
||||||
struct xfs_btree_cur *cur,
|
struct xfs_btree_cur *cur,
|
||||||
union xfs_btree_ptr *start,
|
const union xfs_btree_ptr *start,
|
||||||
union xfs_btree_ptr *new,
|
union xfs_btree_ptr *new,
|
||||||
int *stat)
|
int *stat)
|
||||||
{
|
{
|
||||||
if (cur->bc_mp->m_finobt_nores)
|
if (cur->bc_mp->m_finobt_nores)
|
||||||
return xfs_inobt_alloc_block(cur, start, new, stat);
|
return xfs_inobt_alloc_block(cur, start, new, stat);
|
||||||
|
@ -51,10 +51,10 @@ xfs_refcountbt_set_root(
|
|||||||
|
|
||||||
STATIC int
|
STATIC int
|
||||||
xfs_refcountbt_alloc_block(
|
xfs_refcountbt_alloc_block(
|
||||||
struct xfs_btree_cur *cur,
|
struct xfs_btree_cur *cur,
|
||||||
union xfs_btree_ptr *start,
|
const union xfs_btree_ptr *start,
|
||||||
union xfs_btree_ptr *new,
|
union xfs_btree_ptr *new,
|
||||||
int *stat)
|
int *stat)
|
||||||
{
|
{
|
||||||
struct xfs_buf *agbp = cur->bc_ag.agbp;
|
struct xfs_buf *agbp = cur->bc_ag.agbp;
|
||||||
struct xfs_agf *agf = agbp->b_addr;
|
struct xfs_agf *agf = agbp->b_addr;
|
||||||
|
@ -76,10 +76,10 @@ xfs_rmapbt_set_root(
|
|||||||
|
|
||||||
STATIC int
|
STATIC int
|
||||||
xfs_rmapbt_alloc_block(
|
xfs_rmapbt_alloc_block(
|
||||||
struct xfs_btree_cur *cur,
|
struct xfs_btree_cur *cur,
|
||||||
union xfs_btree_ptr *start,
|
const union xfs_btree_ptr *start,
|
||||||
union xfs_btree_ptr *new,
|
union xfs_btree_ptr *new,
|
||||||
int *stat)
|
int *stat)
|
||||||
{
|
{
|
||||||
struct xfs_buf *agbp = cur->bc_ag.agbp;
|
struct xfs_buf *agbp = cur->bc_ag.agbp;
|
||||||
struct xfs_agf *agf = agbp->b_addr;
|
struct xfs_agf *agf = agbp->b_addr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user