drm/ssd130x: Set SPI .id_table to prevent an SPI core warning
[drm/drm-misc.git] / fs / xfs / libxfs / xfs_ag_resv.h
blobf247eeff7358c492020c7ee6044532eea9ae315d
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3 * Copyright (C) 2016 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
5 */
6 #ifndef __XFS_AG_RESV_H__
7 #define __XFS_AG_RESV_H__
9 void xfs_ag_resv_free(struct xfs_perag *pag);
10 int xfs_ag_resv_init(struct xfs_perag *pag, struct xfs_trans *tp);
12 bool xfs_ag_resv_critical(struct xfs_perag *pag, enum xfs_ag_resv_type type);
13 xfs_extlen_t xfs_ag_resv_needed(struct xfs_perag *pag,
14 enum xfs_ag_resv_type type);
16 void xfs_ag_resv_alloc_extent(struct xfs_perag *pag, enum xfs_ag_resv_type type,
17 struct xfs_alloc_arg *args);
18 void xfs_ag_resv_free_extent(struct xfs_perag *pag, enum xfs_ag_resv_type type,
19 struct xfs_trans *tp, xfs_extlen_t len);
21 static inline struct xfs_ag_resv *
22 xfs_perag_resv(
23 struct xfs_perag *pag,
24 enum xfs_ag_resv_type type)
26 switch (type) {
27 case XFS_AG_RESV_METADATA:
28 return &pag->pag_meta_resv;
29 case XFS_AG_RESV_RMAPBT:
30 return &pag->pag_rmapbt_resv;
31 default:
32 return NULL;
36 #endif /* __XFS_AG_RESV_H__ */