2005-04-17 06:20:36 +08:00
|
|
|
/*
|
2005-11-02 11:58:39 +08:00
|
|
|
* Copyright (c) 2000-2002,2005 Silicon Graphics, Inc.
|
|
|
|
* All Rights Reserved.
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
2005-11-02 11:58:39 +08:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
2005-04-17 06:20:36 +08:00
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
2005-11-02 11:58:39 +08:00
|
|
|
* This program is distributed in the hope that it would be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
2005-11-02 11:58:39 +08:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2005-04-17 06:20:36 +08:00
|
|
|
*/
|
|
|
|
#ifndef __XFS_ALLOC_H__
|
|
|
|
#define __XFS_ALLOC_H__
|
|
|
|
|
|
|
|
struct xfs_buf;
|
2011-01-07 21:02:04 +08:00
|
|
|
struct xfs_btree_cur;
|
2005-04-17 06:20:36 +08:00
|
|
|
struct xfs_mount;
|
|
|
|
struct xfs_perag;
|
|
|
|
struct xfs_trans;
|
xfs: Improve scalability of busy extent tracking
When we free a metadata extent, we record it in the per-AG busy
extent array so that it is not re-used before the freeing
transaction hits the disk. This array is fixed size, so when it
overflows we make further allocation transactions synchronous
because we cannot track more freed extents until those transactions
hit the disk and are completed. Under heavy mixed allocation and
freeing workloads with large log buffers, we can overflow this array
quite easily.
Further, the array is sparsely populated, which means that inserts
need to search for a free slot, and array searches often have to
search many more slots that are actually used to check all the
busy extents. Quite inefficient, really.
To enable this aspect of extent freeing to scale better, we need
a structure that can grow dynamically. While in other areas of
XFS we have used radix trees, the extents being freed are at random
locations on disk so are better suited to being indexed by an rbtree.
So, use a per-AG rbtree indexed by block number to track busy
extents. This incures a memory allocation when marking an extent
busy, but should not occur too often in low memory situations. This
should scale to an arbitrary number of extents so should not be a
limitation for features such as in-memory aggregation of
transactions.
However, there are still situations where we can't avoid allocating
busy extents (such as allocation from the AGFL). To minimise the
overhead of such occurences, we need to avoid doing a synchronous
log force while holding the AGF locked to ensure that the previous
transactions are safely on disk before we use the extent. We can do
this by marking the transaction doing the allocation as synchronous
rather issuing a log force.
Because of the locking involved and the ordering of transactions,
the synchronous transaction provides the same guarantees as a
synchronous log force because it ensures that all the prior
transactions are already on disk when the synchronous transaction
hits the disk. i.e. it preserves the free->allocate order of the
extent correctly in recovery.
By doing this, we avoid holding the AGF locked while log writes are
in progress, hence reducing the length of time the lock is held and
therefore we increase the rate at which we can allocate and free
from the allocation group, thereby increasing overall throughput.
The only problem with this approach is that when a metadata buffer is
marked stale (e.g. a directory block is removed), then buffer remains
pinned and locked until the log goes to disk. The issue here is that
if that stale buffer is reallocated in a subsequent transaction, the
attempt to lock that buffer in the transaction will hang waiting
the log to go to disk to unlock and unpin the buffer. Hence if
someone tries to lock a pinned, stale, locked buffer we need to
push on the log to get it unlocked ASAP. Effectively we are trading
off a guaranteed log force for a much less common trigger for log
force to occur.
Ideally we should not reallocate busy extents. That is a much more
complex fix to the problem as it involves direct intervention in the
allocation btree searches in many places. This is left to a future
set of modifications.
Finally, now that we track busy extents in allocated memory, we
don't need the descriptors in the transaction structure to point to
them. We can replace the complex busy chunk infrastructure with a
simple linked list of busy extents. This allows us to remove a large
chunk of code, making the overall change a net reduction in code
size.
Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
2010-05-21 10:07:08 +08:00
|
|
|
struct xfs_busy_extent;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Freespace allocation types. Argument to xfs_alloc_[v]extent.
|
|
|
|
*/
|
2010-06-24 09:49:12 +08:00
|
|
|
#define XFS_ALLOCTYPE_ANY_AG 0x01 /* allocate anywhere, use rotor */
|
|
|
|
#define XFS_ALLOCTYPE_FIRST_AG 0x02 /* ... start at ag 0 */
|
|
|
|
#define XFS_ALLOCTYPE_START_AG 0x04 /* anywhere, start in this a.g. */
|
|
|
|
#define XFS_ALLOCTYPE_THIS_AG 0x08 /* anywhere in this a.g. */
|
|
|
|
#define XFS_ALLOCTYPE_START_BNO 0x10 /* near this block else anywhere */
|
|
|
|
#define XFS_ALLOCTYPE_NEAR_BNO 0x20 /* in this a.g. and near this block */
|
|
|
|
#define XFS_ALLOCTYPE_THIS_BNO 0x40 /* at exactly this block */
|
|
|
|
|
|
|
|
/* this should become an enum again when the tracing code is fixed */
|
|
|
|
typedef unsigned int xfs_alloctype_t;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2009-12-15 07:14:59 +08:00
|
|
|
#define XFS_ALLOC_TYPES \
|
|
|
|
{ XFS_ALLOCTYPE_ANY_AG, "ANY_AG" }, \
|
|
|
|
{ XFS_ALLOCTYPE_FIRST_AG, "FIRST_AG" }, \
|
|
|
|
{ XFS_ALLOCTYPE_START_AG, "START_AG" }, \
|
|
|
|
{ XFS_ALLOCTYPE_THIS_AG, "THIS_AG" }, \
|
|
|
|
{ XFS_ALLOCTYPE_START_BNO, "START_BNO" }, \
|
|
|
|
{ XFS_ALLOCTYPE_NEAR_BNO, "NEAR_BNO" }, \
|
|
|
|
{ XFS_ALLOCTYPE_THIS_BNO, "THIS_BNO" }
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* Flags for xfs_alloc_fix_freelist.
|
|
|
|
*/
|
|
|
|
#define XFS_ALLOC_FLAG_TRYLOCK 0x00000001 /* use trylock for buffer locking */
|
2006-06-09 12:55:18 +08:00
|
|
|
#define XFS_ALLOC_FLAG_FREEING 0x00000002 /* indicate caller is freeing extents*/
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2006-09-07 12:26:50 +08:00
|
|
|
/*
|
|
|
|
* In order to avoid ENOSPC-related deadlock caused by
|
|
|
|
* out-of-order locking of AGF buffer (PV 947395), we place
|
|
|
|
* constraints on the relationship among actual allocations for
|
|
|
|
* data blocks, freelist blocks, and potential file data bmap
|
|
|
|
* btree blocks. However, these restrictions may result in no
|
|
|
|
* actual space allocated for a delayed extent, for example, a data
|
|
|
|
* block in a certain AG is allocated but there is no additional
|
|
|
|
* block for the additional bmap btree block due to a split of the
|
|
|
|
* bmap btree of the file. The result of this may lead to an
|
|
|
|
* infinite loop in xfssyncd when the file gets flushed to disk and
|
|
|
|
* all delayed extents need to be actually allocated. To get around
|
|
|
|
* this, we explicitly set aside a few blocks which will not be
|
|
|
|
* reserved in delayed allocation. Considering the minimum number of
|
|
|
|
* needed freelist blocks is 4 fsbs _per AG_, a potential split of file's bmap
|
|
|
|
* btree requires 1 fsb, so we set the number of set-aside blocks
|
|
|
|
* to 4 + 4*agcount.
|
|
|
|
*/
|
|
|
|
#define XFS_ALLOC_SET_ASIDE(mp) (4 + ((mp)->m_sb.sb_agcount * 4))
|
|
|
|
|
2011-01-27 09:16:28 +08:00
|
|
|
/*
|
|
|
|
* When deciding how much space to allocate out of an AG, we limit the
|
|
|
|
* allocation maximum size to the size the AG. However, we cannot use all the
|
|
|
|
* blocks in the AG - some are permanently used by metadata. These
|
|
|
|
* blocks are generally:
|
|
|
|
* - the AG superblock, AGF, AGI and AGFL
|
|
|
|
* - the AGF (bno and cnt) and AGI btree root blocks
|
|
|
|
* - 4 blocks on the AGFL according to XFS_ALLOC_SET_ASIDE() limits
|
|
|
|
*
|
|
|
|
* The AG headers are sector sized, so the amount of space they take up is
|
|
|
|
* dependent on filesystem geometry. The others are all single blocks.
|
|
|
|
*/
|
|
|
|
#define XFS_ALLOC_AG_MAX_USABLE(mp) \
|
|
|
|
((mp)->m_sb.sb_agblocks - XFS_BB_TO_FSB(mp, XFS_FSS_TO_BB(mp, 4)) - 7)
|
|
|
|
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* Argument structure for xfs_alloc routines.
|
|
|
|
* This is turned into a structure to avoid having 20 arguments passed
|
|
|
|
* down several levels of the stack.
|
|
|
|
*/
|
|
|
|
typedef struct 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_extlen_t len; /* output: actual size of extent */
|
|
|
|
xfs_alloctype_t type; /* allocation type XFS_ALLOCTYPE_... */
|
|
|
|
xfs_alloctype_t otype; /* original allocation type */
|
|
|
|
char wasdel; /* set if allocation was prev delayed */
|
|
|
|
char wasfromfl; /* set if allocation is from freelist */
|
2006-03-29 06:55:14 +08:00
|
|
|
char isfl; /* set if is freelist blocks - !acctg */
|
2005-04-17 06:20:36 +08:00
|
|
|
char userdata; /* set if this is user data */
|
2006-06-09 12:55:18 +08:00
|
|
|
xfs_fsblock_t firstblock; /* io first block allocated */
|
2005-04-17 06:20:36 +08:00
|
|
|
} xfs_alloc_arg_t;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Defines for userdata
|
|
|
|
*/
|
|
|
|
#define XFS_ALLOC_USERDATA 1 /* allocation is for user data*/
|
|
|
|
#define XFS_ALLOC_INITIAL_USER_DATA 2 /* special case start of file */
|
|
|
|
|
2009-03-16 15:29:46 +08:00
|
|
|
/*
|
|
|
|
* Find the length of the longest extent in an AG.
|
|
|
|
*/
|
|
|
|
xfs_extlen_t
|
|
|
|
xfs_alloc_longest_free_extent(struct xfs_mount *mp,
|
|
|
|
struct xfs_perag *pag);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#ifdef __KERNEL__
|
2008-10-30 14:05:38 +08:00
|
|
|
void
|
2011-01-07 21:02:04 +08:00
|
|
|
xfs_alloc_busy_insert(struct xfs_trans *tp, xfs_agnumber_t agno,
|
|
|
|
xfs_agblock_t bno, xfs_extlen_t len);
|
2008-10-30 14:05:38 +08:00
|
|
|
|
|
|
|
void
|
xfs: Improve scalability of busy extent tracking
When we free a metadata extent, we record it in the per-AG busy
extent array so that it is not re-used before the freeing
transaction hits the disk. This array is fixed size, so when it
overflows we make further allocation transactions synchronous
because we cannot track more freed extents until those transactions
hit the disk and are completed. Under heavy mixed allocation and
freeing workloads with large log buffers, we can overflow this array
quite easily.
Further, the array is sparsely populated, which means that inserts
need to search for a free slot, and array searches often have to
search many more slots that are actually used to check all the
busy extents. Quite inefficient, really.
To enable this aspect of extent freeing to scale better, we need
a structure that can grow dynamically. While in other areas of
XFS we have used radix trees, the extents being freed are at random
locations on disk so are better suited to being indexed by an rbtree.
So, use a per-AG rbtree indexed by block number to track busy
extents. This incures a memory allocation when marking an extent
busy, but should not occur too often in low memory situations. This
should scale to an arbitrary number of extents so should not be a
limitation for features such as in-memory aggregation of
transactions.
However, there are still situations where we can't avoid allocating
busy extents (such as allocation from the AGFL). To minimise the
overhead of such occurences, we need to avoid doing a synchronous
log force while holding the AGF locked to ensure that the previous
transactions are safely on disk before we use the extent. We can do
this by marking the transaction doing the allocation as synchronous
rather issuing a log force.
Because of the locking involved and the ordering of transactions,
the synchronous transaction provides the same guarantees as a
synchronous log force because it ensures that all the prior
transactions are already on disk when the synchronous transaction
hits the disk. i.e. it preserves the free->allocate order of the
extent correctly in recovery.
By doing this, we avoid holding the AGF locked while log writes are
in progress, hence reducing the length of time the lock is held and
therefore we increase the rate at which we can allocate and free
from the allocation group, thereby increasing overall throughput.
The only problem with this approach is that when a metadata buffer is
marked stale (e.g. a directory block is removed), then buffer remains
pinned and locked until the log goes to disk. The issue here is that
if that stale buffer is reallocated in a subsequent transaction, the
attempt to lock that buffer in the transaction will hang waiting
the log to go to disk to unlock and unpin the buffer. Hence if
someone tries to lock a pinned, stale, locked buffer we need to
push on the log to get it unlocked ASAP. Effectively we are trading
off a guaranteed log force for a much less common trigger for log
force to occur.
Ideally we should not reallocate busy extents. That is a much more
complex fix to the problem as it involves direct intervention in the
allocation btree searches in many places. This is left to a future
set of modifications.
Finally, now that we track busy extents in allocated memory, we
don't need the descriptors in the transaction structure to point to
them. We can replace the complex busy chunk infrastructure with a
simple linked list of busy extents. This allows us to remove a large
chunk of code, making the overall change a net reduction in code
size.
Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
2010-05-21 10:07:08 +08:00
|
|
|
xfs_alloc_busy_clear(struct xfs_mount *mp, struct xfs_busy_extent *busyp);
|
2008-10-30 14:05:38 +08:00
|
|
|
|
2011-01-07 21:02:04 +08:00
|
|
|
int
|
|
|
|
xfs_alloc_busy_search(struct xfs_mount *mp, xfs_agnumber_t agno,
|
|
|
|
xfs_agblock_t bno, xfs_extlen_t len);
|
2008-10-30 14:05:38 +08:00
|
|
|
#endif /* __KERNEL__ */
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* Compute and fill in value of m_ag_maxlevels.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
xfs_alloc_compute_maxlevels(
|
|
|
|
struct xfs_mount *mp); /* file system mount structure */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Get a block from the freelist.
|
|
|
|
* Returns with the buffer for the block gotten.
|
|
|
|
*/
|
|
|
|
int /* error */
|
|
|
|
xfs_alloc_get_freelist(
|
|
|
|
struct xfs_trans *tp, /* transaction pointer */
|
|
|
|
struct xfs_buf *agbp, /* buffer containing the agf structure */
|
[XFS] Lazy Superblock Counters
When we have a couple of hundred transactions on the fly at once, they all
typically modify the on disk superblock in some way.
create/unclink/mkdir/rmdir modify inode counts, allocation/freeing modify
free block counts.
When these counts are modified in a transaction, they must eventually lock
the superblock buffer and apply the mods. The buffer then remains locked
until the transaction is committed into the incore log buffer. The result
of this is that with enough transactions on the fly the incore superblock
buffer becomes a bottleneck.
The result of contention on the incore superblock buffer is that
transaction rates fall - the more pressure that is put on the superblock
buffer, the slower things go.
The key to removing the contention is to not require the superblock fields
in question to be locked. We do that by not marking the superblock dirty
in the transaction. IOWs, we modify the incore superblock but do not
modify the cached superblock buffer. In short, we do not log superblock
modifications to critical fields in the superblock on every transaction.
In fact we only do it just before we write the superblock to disk every
sync period or just before unmount.
This creates an interesting problem - if we don't log or write out the
fields in every transaction, then how do the values get recovered after a
crash? the answer is simple - we keep enough duplicate, logged information
in other structures that we can reconstruct the correct count after log
recovery has been performed.
It is the AGF and AGI structures that contain the duplicate information;
after recovery, we walk every AGI and AGF and sum their individual
counters to get the correct value, and we do a transaction into the log to
correct them. An optimisation of this is that if we have a clean unmount
record, we know the value in the superblock is correct, so we can avoid
the summation walk under normal conditions and so mount/recovery times do
not change under normal operation.
One wrinkle that was discovered during development was that the blocks
used in the freespace btrees are never accounted for in the AGF counters.
This was once a valid optimisation to make; when the filesystem is full,
the free space btrees are empty and consume no space. Hence when it
matters, the "accounting" is correct. But that means the when we do the
AGF summations, we would not have a correct count and xfs_check would
complain. Hence a new counter was added to track the number of blocks used
by the free space btrees. This is an *on-disk format change*.
As a result of this, lazy superblock counters are a mkfs option and at the
moment on linux there is no way to convert an old filesystem. This is
possible - xfs_db can be used to twiddle the right bits and then
xfs_repair will do the format conversion for you. Similarly, you can
convert backwards as well. At some point we'll add functionality to
xfs_admin to do the bit twiddling easily....
SGI-PV: 964999
SGI-Modid: xfs-linux-melb:xfs-kern:28652a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2007-05-24 13:26:31 +08:00
|
|
|
xfs_agblock_t *bnop, /* block address retrieved from freelist */
|
|
|
|
int btreeblk); /* destination is a AGF btree */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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 */
|
|
|
|
int fields);/* mask of fields to be logged (XFS_AGF_...) */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Interface for inode allocation to force the pag data to be initialized.
|
|
|
|
*/
|
|
|
|
int /* error */
|
|
|
|
xfs_alloc_pagf_init(
|
|
|
|
struct xfs_mount *mp, /* file system mount structure */
|
|
|
|
struct xfs_trans *tp, /* transaction pointer */
|
|
|
|
xfs_agnumber_t agno, /* allocation group number */
|
|
|
|
int flags); /* XFS_ALLOC_FLAGS_... */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Put the block on the freelist for the allocation group.
|
|
|
|
*/
|
|
|
|
int /* error */
|
|
|
|
xfs_alloc_put_freelist(
|
|
|
|
struct xfs_trans *tp, /* transaction pointer */
|
|
|
|
struct xfs_buf *agbp, /* buffer for a.g. freelist header */
|
|
|
|
struct xfs_buf *agflbp,/* buffer for a.g. free block array */
|
[XFS] Lazy Superblock Counters
When we have a couple of hundred transactions on the fly at once, they all
typically modify the on disk superblock in some way.
create/unclink/mkdir/rmdir modify inode counts, allocation/freeing modify
free block counts.
When these counts are modified in a transaction, they must eventually lock
the superblock buffer and apply the mods. The buffer then remains locked
until the transaction is committed into the incore log buffer. The result
of this is that with enough transactions on the fly the incore superblock
buffer becomes a bottleneck.
The result of contention on the incore superblock buffer is that
transaction rates fall - the more pressure that is put on the superblock
buffer, the slower things go.
The key to removing the contention is to not require the superblock fields
in question to be locked. We do that by not marking the superblock dirty
in the transaction. IOWs, we modify the incore superblock but do not
modify the cached superblock buffer. In short, we do not log superblock
modifications to critical fields in the superblock on every transaction.
In fact we only do it just before we write the superblock to disk every
sync period or just before unmount.
This creates an interesting problem - if we don't log or write out the
fields in every transaction, then how do the values get recovered after a
crash? the answer is simple - we keep enough duplicate, logged information
in other structures that we can reconstruct the correct count after log
recovery has been performed.
It is the AGF and AGI structures that contain the duplicate information;
after recovery, we walk every AGI and AGF and sum their individual
counters to get the correct value, and we do a transaction into the log to
correct them. An optimisation of this is that if we have a clean unmount
record, we know the value in the superblock is correct, so we can avoid
the summation walk under normal conditions and so mount/recovery times do
not change under normal operation.
One wrinkle that was discovered during development was that the blocks
used in the freespace btrees are never accounted for in the AGF counters.
This was once a valid optimisation to make; when the filesystem is full,
the free space btrees are empty and consume no space. Hence when it
matters, the "accounting" is correct. But that means the when we do the
AGF summations, we would not have a correct count and xfs_check would
complain. Hence a new counter was added to track the number of blocks used
by the free space btrees. This is an *on-disk format change*.
As a result of this, lazy superblock counters are a mkfs option and at the
moment on linux there is no way to convert an old filesystem. This is
possible - xfs_db can be used to twiddle the right bits and then
xfs_repair will do the format conversion for you. Similarly, you can
convert backwards as well. At some point we'll add functionality to
xfs_admin to do the bit twiddling easily....
SGI-PV: 964999
SGI-Modid: xfs-linux-melb:xfs-kern:28652a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2007-05-24 13:26:31 +08:00
|
|
|
xfs_agblock_t bno, /* block being freed */
|
|
|
|
int btreeblk); /* owner was a AGF btree */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Read in the allocation group header (free/alloc section).
|
|
|
|
*/
|
|
|
|
int /* error */
|
|
|
|
xfs_alloc_read_agf(
|
|
|
|
struct xfs_mount *mp, /* mount point structure */
|
|
|
|
struct xfs_trans *tp, /* transaction pointer */
|
|
|
|
xfs_agnumber_t agno, /* allocation group number */
|
|
|
|
int flags, /* XFS_ALLOC_FLAG_... */
|
|
|
|
struct xfs_buf **bpp); /* buffer for the ag freelist header */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Allocate an extent (variable-size).
|
|
|
|
*/
|
|
|
|
int /* error */
|
|
|
|
xfs_alloc_vextent(
|
|
|
|
xfs_alloc_arg_t *args); /* allocation argument structure */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Free an extent.
|
|
|
|
*/
|
|
|
|
int /* error */
|
|
|
|
xfs_free_extent(
|
|
|
|
struct xfs_trans *tp, /* transaction pointer */
|
|
|
|
xfs_fsblock_t bno, /* starting block number of extent */
|
|
|
|
xfs_extlen_t len); /* length of extent */
|
|
|
|
|
2011-01-07 21:02:04 +08:00
|
|
|
int /* error */
|
|
|
|
xfs_alloc_lookup_le(
|
|
|
|
struct xfs_btree_cur *cur, /* btree cursor */
|
|
|
|
xfs_agblock_t bno, /* starting block of extent */
|
|
|
|
xfs_extlen_t len, /* length of extent */
|
|
|
|
int *stat); /* success/failure */
|
|
|
|
|
|
|
|
int /* error */
|
|
|
|
xfs_alloc_get_rec(
|
|
|
|
struct xfs_btree_cur *cur, /* btree cursor */
|
|
|
|
xfs_agblock_t *bno, /* output: starting block of extent */
|
|
|
|
xfs_extlen_t *len, /* output: length of extent */
|
|
|
|
int *stat); /* output: success/failure */
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#endif /* __XFS_ALLOC_H__ */
|