/* * Flags for xfs_alloc_fix_freelist.
*/ #define XFS_ALLOC_FLAG_TRYLOCK (1U << 0) /* use trylock for buffer locking */ #define XFS_ALLOC_FLAG_FREEING (1U << 1) /* indicate caller is freeing extents*/ #define XFS_ALLOC_FLAG_NORMAP (1U << 2) /* don't modify the rmapbt */ #define XFS_ALLOC_FLAG_NOSHRINK (1U << 3) /* don't shrink the freelist */ #define XFS_ALLOC_FLAG_CHECK (1U << 4) /* test only, don't modify args */ #define XFS_ALLOC_FLAG_TRYFLUSH (1U << 5) /* don't wait in busy extent flush */
/* * Argument structure for xfs_alloc routines. * This is turned into a structure to avoid having 20 arguments passed * down several levels of the stack.
*/ typedefstruct xfs_alloc_arg { struct xfs_trans *tp; /* transaction pointer */ struct xfs_mount *mp; /* file system mount point */ struct xfs_buf *agbp; /* buffer for a.g. freelist header */ struct xfs_perag *pag; /* per-ag struct for this agno */
xfs_fsblock_t fsbno; /* file system block number */
xfs_agnumber_t agno; /* allocation group number */
xfs_agblock_t agbno; /* allocation group-relative block # */
xfs_extlen_t minlen; /* minimum size of extent */
xfs_extlen_t maxlen; /* maximum size of extent */
xfs_extlen_t mod; /* mod value for extent size */
xfs_extlen_t prod; /* prod value for extent size */
xfs_extlen_t minleft; /* min blocks must be left after us */
xfs_extlen_t total; /* total blocks needed in xaction */
xfs_extlen_t alignment; /* align answer to multiple of this */
xfs_extlen_t minalignslop; /* slop for minlen+alignment calcs */
xfs_agblock_t min_agbno; /* set an agbno range for NEAR allocs */
xfs_agblock_t max_agbno; /* ... */
xfs_extlen_t len; /* output: actual size of extent */ int datatype; /* mask defining data type treatment */ char wasdel; /* set if allocation was prev delayed */ char wasfromfl; /* set if allocation is from freelist */ bool alloc_minlen_only; /* allocate exact minlen extent */ struct xfs_owner_info oinfo; /* owner of blocks being allocated */ enum xfs_ag_resv_type resv; /* block reservation to use */
} xfs_alloc_arg_t;
/* * Defines for datatype
*/ #define XFS_ALLOC_USERDATA (1 << 0)/* allocation is for user data*/ #define XFS_ALLOC_INITIAL_USER_DATA (1 << 1)/* special case start of file */ #define XFS_ALLOC_NOBUSY (1 << 2)/* Busy extents not allowed */
/* * Compute and fill in value of m_alloc_maxlevels.
*/ void
xfs_alloc_compute_maxlevels( struct xfs_mount *mp); /* file system mount structure */
/* * Log the given fields from the agf structure.
*/ void
xfs_alloc_log_agf( struct xfs_trans *tp, /* transaction pointer */ struct xfs_buf *bp, /* buffer for a.g. freelist header */
uint32_t fields);/* mask of fields to be logged (XFS_AGF_...) */
/* * Allocate an extent anywhere in the specific AG given. If there is no * space matching the requirements in that AG, then the allocation will fail.
*/ int xfs_alloc_vextent_this_ag(struct xfs_alloc_arg *args, xfs_agnumber_t agno);
/* * Allocate an extent as close to the target as possible. If there are not * viable candidates in the AG, then fail the allocation.
*/ int xfs_alloc_vextent_near_bno(struct xfs_alloc_arg *args,
xfs_fsblock_t target);
/* * Allocate an extent exactly at the target given. If this is not possible * then the allocation fails.
*/ int xfs_alloc_vextent_exact_bno(struct xfs_alloc_arg *args,
xfs_fsblock_t target);
/* * Best effort full filesystem allocation scan. * * Locality aware allocation will be attempted in the initial AG, but on failure * non-localised attempts will be made. The AGs are constrained by previous * allocations in the current transaction. Two passes will be made - the first * non-blocking, the second blocking.
*/ int xfs_alloc_vextent_start_ag(struct xfs_alloc_arg *args,
xfs_fsblock_t target);
/* * Iterate from the AG indicated from args->fsbno through to the end of the * filesystem attempting blocking allocation. This is for use in last * resort allocation attempts when everything else has failed.
*/ int xfs_alloc_vextent_first_ag(struct xfs_alloc_arg *args,
xfs_fsblock_t target);
/* * List of extents to be free "later". * The list is kept sorted on xbf_startblock.
*/ struct xfs_extent_free_item { struct list_head xefi_list;
uint64_t xefi_owner;
xfs_fsblock_t xefi_startblock;/* starting fs block number */
xfs_extlen_t xefi_blockcount;/* number of blocks in extent */ struct xfs_group *xefi_group; unsignedint xefi_flags; enum xfs_ag_resv_type xefi_agresv;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.