2020-05-12 23:54:17 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
2006-06-09 04:48:12 +00:00
|
|
|
* Copyright (c) 2000-2006 Silicon Graphics, Inc.
|
2005-11-02 03:58:39 +00:00
|
|
|
* All Rights Reserved.
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
|
|
|
#ifndef __XFS_BMAP_H__
|
|
|
|
#define __XFS_BMAP_H__
|
|
|
|
|
|
|
|
struct getbmap;
|
|
|
|
struct xfs_bmbt_irec;
|
2006-03-14 02:29:52 +00:00
|
|
|
struct xfs_ifork;
|
2005-04-16 22:20:36 +00:00
|
|
|
struct xfs_inode;
|
|
|
|
struct xfs_mount;
|
|
|
|
struct xfs_trans;
|
2023-02-12 22:14:55 +00:00
|
|
|
struct xfs_alloc_arg;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2015-01-08 23:46:49 +00:00
|
|
|
/*
|
|
|
|
* Argument structure for xfs_bmap_alloc.
|
|
|
|
*/
|
|
|
|
struct xfs_bmalloca {
|
|
|
|
struct xfs_trans *tp; /* transaction pointer */
|
|
|
|
struct xfs_inode *ip; /* incore inode pointer */
|
|
|
|
struct xfs_bmbt_irec prev; /* extent before the new one */
|
|
|
|
struct xfs_bmbt_irec got; /* extent after, or delayed */
|
|
|
|
|
|
|
|
xfs_fileoff_t offset; /* offset in file filling in */
|
|
|
|
xfs_extlen_t length; /* i/o length asked/allocated */
|
|
|
|
xfs_fsblock_t blkno; /* starting block of new extent */
|
|
|
|
|
|
|
|
struct xfs_btree_cur *cur; /* btree cursor */
|
2017-11-03 17:34:43 +00:00
|
|
|
struct xfs_iext_cursor icur; /* incore extent cursor */
|
2015-01-08 23:46:49 +00:00
|
|
|
int nallocs;/* number of extents alloc'd */
|
|
|
|
int logflags;/* flags for transaction logging */
|
|
|
|
|
|
|
|
xfs_extlen_t total; /* total blocks needed for xaction */
|
|
|
|
xfs_extlen_t minlen; /* minimum allocation size (blocks) */
|
|
|
|
xfs_extlen_t minleft; /* amount must be left after alloc */
|
|
|
|
bool eof; /* set if allocating past last extent */
|
|
|
|
bool wasdel; /* replacing a delayed allocation */
|
|
|
|
bool aeof; /* allocated space at eof */
|
|
|
|
bool conv; /* overwriting unwritten extents */
|
xfs: remote attribute blocks aren't really userdata
When adding a new remote attribute, we write the attribute to the
new extent before the allocation transaction is committed. This
means we cannot reuse busy extents as that violates crash
consistency semantics. Hence we currently treat remote attribute
extent allocation like userdata because it has the same overwrite
ordering constraints as userdata.
Unfortunately, this also allows the allocator to incorrectly apply
extent size hints to the remote attribute extent allocation. This
results in interesting failures, such as transaction block
reservation overruns and in-memory inode attribute fork corruption.
To fix this, we need to separate the busy extent reuse configuration
from the userdata configuration. This changes the definition of
XFS_BMAPI_METADATA slightly - it now means that allocation is
metadata and reuse of busy extents is acceptible due to the metadata
ordering semantics of the journal. If this flag is not set, it
means the allocation is that has unordered data writeback, and hence
busy extent reuse is not allowed. It no longer implies the
allocation is for user data, just that the data write will not be
strictly ordered. This matches the semantics for both user data
and remote attribute block allocation.
As such, This patch changes the "userdata" field to a "datatype"
field, and adds a "no busy reuse" flag to the field.
When we detect an unordered data extent allocation, we immediately set
the no reuse flag. We then set the "user data" flags based on the
inode fork we are allocating the extent to. Hence we only set
userdata flags on data fork allocations now and consider attribute
fork remote extents to be an unordered metadata extent.
The result is that remote attribute extents now have the expected
allocation semantics, and the data fork allocation behaviour is
completely unchanged.
It should be noted that there may be other ways to fix this (e.g.
use ordered metadata buffers for the remote attribute extent data
write) but they are more invasive and difficult to validate both
from a design and implementation POV. Hence this patch takes the
simple, obvious route to fixing the problem...
Reported-and-tested-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2016-09-25 22:21:28 +00:00
|
|
|
int datatype;/* data type being allocated */
|
2022-04-21 00:46:09 +00:00
|
|
|
uint32_t flags;
|
2015-01-08 23:46:49 +00:00
|
|
|
};
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
#define XFS_BMAP_MAX_NMAP 4
|
|
|
|
|
|
|
|
/*
|
2011-09-18 20:40:52 +00:00
|
|
|
* Flags for xfs_bmapi_*
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
2022-04-21 00:46:09 +00:00
|
|
|
#define XFS_BMAPI_ENTIRE (1u << 0) /* return entire extent untrimmed */
|
|
|
|
#define XFS_BMAPI_METADATA (1u << 1) /* mapping metadata not user data */
|
|
|
|
#define XFS_BMAPI_ATTRFORK (1u << 2) /* use attribute fork not data */
|
|
|
|
#define XFS_BMAPI_PREALLOC (1u << 3) /* preallocating unwritten space */
|
|
|
|
#define XFS_BMAPI_CONTIG (1u << 4) /* must allocate only one extent */
|
2010-08-24 02:02:11 +00:00
|
|
|
/*
|
|
|
|
* unwritten extent conversion - this needs write cache flushing and no additional
|
|
|
|
* allocation alignments. When specified with XFS_BMAPI_PREALLOC it converts
|
|
|
|
* from written to unwritten, otherwise convert from unwritten to written.
|
|
|
|
*/
|
2022-04-21 00:46:09 +00:00
|
|
|
#define XFS_BMAPI_CONVERT (1u << 5)
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2015-11-03 01:27:22 +00:00
|
|
|
/*
|
|
|
|
* allocate zeroed extents - this requires all newly allocated user data extents
|
|
|
|
* to be initialised to zero. It will be ignored if XFS_BMAPI_METADATA is set.
|
|
|
|
* Use in conjunction with XFS_BMAPI_CONVERT to convert unwritten extents found
|
|
|
|
* during the allocation range to zeroed written extents.
|
|
|
|
*/
|
2022-04-21 00:46:09 +00:00
|
|
|
#define XFS_BMAPI_ZERO (1u << 6)
|
2015-11-03 01:27:22 +00:00
|
|
|
|
2016-10-03 16:11:27 +00:00
|
|
|
/*
|
|
|
|
* Map the inode offset to the block given in ap->firstblock. Primarily
|
|
|
|
* used for reflink. The range must be in a hole, and this flag cannot be
|
|
|
|
* turned on with PREALLOC or CONVERT, and cannot be used on the attr fork.
|
2016-10-03 16:11:27 +00:00
|
|
|
*
|
|
|
|
* For bunmapi, this flag unmaps the range without adjusting quota, reducing
|
|
|
|
* refcount, or freeing the blocks.
|
2016-10-03 16:11:27 +00:00
|
|
|
*/
|
2022-04-21 00:46:09 +00:00
|
|
|
#define XFS_BMAPI_REMAP (1u << 7)
|
2016-10-03 16:11:27 +00:00
|
|
|
|
2016-10-03 16:11:32 +00:00
|
|
|
/* Map something in the CoW fork. */
|
2022-04-21 00:46:09 +00:00
|
|
|
#define XFS_BMAPI_COWFORK (1u << 8)
|
2016-10-03 16:11:32 +00:00
|
|
|
|
2018-05-09 15:45:04 +00:00
|
|
|
/* Skip online discard of freed extents */
|
2022-04-21 00:46:09 +00:00
|
|
|
#define XFS_BMAPI_NODISCARD (1u << 9)
|
2018-05-09 15:45:04 +00:00
|
|
|
|
2018-05-09 17:02:32 +00:00
|
|
|
/* Do not update the rmap btree. Used for reconstructing bmbt from rmapbt. */
|
2022-04-21 00:46:09 +00:00
|
|
|
#define XFS_BMAPI_NORMAP (1u << 10)
|
2018-05-09 17:02:32 +00:00
|
|
|
|
2009-12-14 23:14:59 +00:00
|
|
|
#define XFS_BMAPI_FLAGS \
|
|
|
|
{ XFS_BMAPI_ENTIRE, "ENTIRE" }, \
|
|
|
|
{ XFS_BMAPI_METADATA, "METADATA" }, \
|
|
|
|
{ XFS_BMAPI_ATTRFORK, "ATTRFORK" }, \
|
|
|
|
{ XFS_BMAPI_PREALLOC, "PREALLOC" }, \
|
|
|
|
{ XFS_BMAPI_CONTIG, "CONTIG" }, \
|
2015-11-03 01:27:22 +00:00
|
|
|
{ XFS_BMAPI_CONVERT, "CONVERT" }, \
|
2016-10-03 16:11:27 +00:00
|
|
|
{ XFS_BMAPI_ZERO, "ZERO" }, \
|
2016-10-03 16:11:32 +00:00
|
|
|
{ XFS_BMAPI_REMAP, "REMAP" }, \
|
2017-01-20 17:31:54 +00:00
|
|
|
{ XFS_BMAPI_COWFORK, "COWFORK" }, \
|
2018-05-09 17:02:32 +00:00
|
|
|
{ XFS_BMAPI_NODISCARD, "NODISCARD" }, \
|
|
|
|
{ XFS_BMAPI_NORMAP, "NORMAP" }
|
2009-12-14 23:14:59 +00:00
|
|
|
|
|
|
|
|
2005-11-02 03:38:42 +00:00
|
|
|
static inline int xfs_bmapi_aflag(int w)
|
|
|
|
{
|
2016-10-03 16:11:32 +00:00
|
|
|
return (w == XFS_ATTR_FORK ? XFS_BMAPI_ATTRFORK :
|
|
|
|
(w == XFS_COW_FORK ? XFS_BMAPI_COWFORK : 0));
|
|
|
|
}
|
|
|
|
|
2022-04-21 00:46:09 +00:00
|
|
|
static inline int xfs_bmapi_whichfork(uint32_t bmapi_flags)
|
2016-10-03 16:11:32 +00:00
|
|
|
{
|
|
|
|
if (bmapi_flags & XFS_BMAPI_COWFORK)
|
|
|
|
return XFS_COW_FORK;
|
|
|
|
else if (bmapi_flags & XFS_BMAPI_ATTRFORK)
|
|
|
|
return XFS_ATTR_FORK;
|
|
|
|
return XFS_DATA_FORK;
|
2005-11-02 03:38:42 +00:00
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2023-12-18 04:57:20 +00:00
|
|
|
void xfs_bmap_alloc_account(struct xfs_bmalloca *ap);
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* Special values for xfs_bmbt_irec_t br_startblock field.
|
|
|
|
*/
|
|
|
|
#define DELAYSTARTBLOCK ((xfs_fsblock_t)-1LL)
|
|
|
|
#define HOLESTARTBLOCK ((xfs_fsblock_t)-2LL)
|
|
|
|
|
2009-11-25 00:00:19 +00:00
|
|
|
/*
|
|
|
|
* Flags for xfs_bmap_add_extent*.
|
|
|
|
*/
|
2022-04-21 00:46:01 +00:00
|
|
|
#define BMAP_LEFT_CONTIG (1u << 0)
|
|
|
|
#define BMAP_RIGHT_CONTIG (1u << 1)
|
|
|
|
#define BMAP_LEFT_FILLING (1u << 2)
|
|
|
|
#define BMAP_RIGHT_FILLING (1u << 3)
|
|
|
|
#define BMAP_LEFT_DELAY (1u << 4)
|
|
|
|
#define BMAP_RIGHT_DELAY (1u << 5)
|
|
|
|
#define BMAP_LEFT_VALID (1u << 6)
|
|
|
|
#define BMAP_RIGHT_VALID (1u << 7)
|
|
|
|
#define BMAP_ATTRFORK (1u << 8)
|
|
|
|
#define BMAP_COWFORK (1u << 9)
|
2009-11-25 00:00:19 +00:00
|
|
|
|
2009-12-14 23:14:59 +00:00
|
|
|
#define XFS_BMAP_EXT_FLAGS \
|
|
|
|
{ BMAP_LEFT_CONTIG, "LC" }, \
|
|
|
|
{ BMAP_RIGHT_CONTIG, "RC" }, \
|
|
|
|
{ BMAP_LEFT_FILLING, "LF" }, \
|
|
|
|
{ BMAP_RIGHT_FILLING, "RF" }, \
|
2016-10-03 16:11:32 +00:00
|
|
|
{ BMAP_ATTRFORK, "ATTR" }, \
|
|
|
|
{ BMAP_COWFORK, "COW" }
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2020-06-29 21:47:18 +00:00
|
|
|
/* Return true if the extent is an allocated extent, written or not. */
|
2023-04-12 02:00:24 +00:00
|
|
|
static inline bool xfs_bmap_is_real_extent(const struct xfs_bmbt_irec *irec)
|
2020-06-29 21:47:18 +00:00
|
|
|
{
|
|
|
|
return irec->br_startblock != HOLESTARTBLOCK &&
|
|
|
|
irec->br_startblock != DELAYSTARTBLOCK &&
|
|
|
|
!isnullstartblock(irec->br_startblock);
|
|
|
|
}
|
2014-02-23 23:58:19 +00:00
|
|
|
|
2017-03-28 21:53:35 +00:00
|
|
|
/*
|
|
|
|
* Return true if the extent is a real, allocated extent, or false if it is a
|
|
|
|
* delayed allocation, and unwritten extent or a hole.
|
|
|
|
*/
|
2020-06-29 21:47:18 +00:00
|
|
|
static inline bool xfs_bmap_is_written_extent(struct xfs_bmbt_irec *irec)
|
2017-03-28 21:53:35 +00:00
|
|
|
{
|
2020-06-29 21:47:18 +00:00
|
|
|
return xfs_bmap_is_real_extent(irec) &&
|
|
|
|
irec->br_state != XFS_EXT_UNWRITTEN;
|
2017-03-28 21:53:35 +00:00
|
|
|
}
|
|
|
|
|
2019-09-03 15:13:13 +00:00
|
|
|
/*
|
|
|
|
* Check the mapping for obviously garbage allocations that could trash the
|
|
|
|
* filesystem immediately.
|
|
|
|
*/
|
|
|
|
#define xfs_valid_startblock(ip, startblock) \
|
|
|
|
((startblock) != 0 || XFS_IS_REALTIME_INODE(ip))
|
|
|
|
|
2023-02-12 22:14:55 +00:00
|
|
|
int xfs_bmap_longest_free_extent(struct xfs_perag *pag,
|
|
|
|
struct xfs_trans *tp, xfs_extlen_t *blen);
|
2016-10-20 04:51:50 +00:00
|
|
|
void xfs_trim_extent(struct xfs_bmbt_irec *irec, xfs_fileoff_t bno,
|
|
|
|
xfs_filblks_t len);
|
2021-04-06 14:03:24 +00:00
|
|
|
unsigned int xfs_bmap_compute_attr_offset(struct xfs_mount *mp);
|
2011-09-18 20:41:07 +00:00
|
|
|
int xfs_bmap_add_attrfork(struct xfs_inode *ip, int size, int rsvd);
|
2019-10-07 19:54:16 +00:00
|
|
|
void xfs_bmap_local_to_extents_empty(struct xfs_trans *tp,
|
|
|
|
struct xfs_inode *ip, int whichfork);
|
2011-09-18 20:41:07 +00:00
|
|
|
void xfs_bmap_compute_maxlevels(struct xfs_mount *mp, int whichfork);
|
|
|
|
int xfs_bmap_first_unused(struct xfs_trans *tp, struct xfs_inode *ip,
|
|
|
|
xfs_extlen_t len, xfs_fileoff_t *unused, int whichfork);
|
|
|
|
int xfs_bmap_last_before(struct xfs_trans *tp, struct xfs_inode *ip,
|
|
|
|
xfs_fileoff_t *last_block, int whichfork);
|
2014-04-14 08:58:05 +00:00
|
|
|
int xfs_bmap_last_offset(struct xfs_inode *ip, xfs_fileoff_t *unused,
|
|
|
|
int whichfork);
|
2011-09-18 20:40:45 +00:00
|
|
|
int xfs_bmapi_read(struct xfs_inode *ip, xfs_fileoff_t bno,
|
|
|
|
xfs_filblks_t len, struct xfs_bmbt_irec *mval,
|
2022-04-21 00:46:09 +00:00
|
|
|
int *nmap, uint32_t flags);
|
2011-09-18 20:40:52 +00:00
|
|
|
int xfs_bmapi_write(struct xfs_trans *tp, struct xfs_inode *ip,
|
2022-04-21 00:46:09 +00:00
|
|
|
xfs_fileoff_t bno, xfs_filblks_t len, uint32_t flags,
|
2018-07-12 05:26:25 +00:00
|
|
|
xfs_extlen_t total, struct xfs_bmbt_irec *mval, int *nmap);
|
2011-09-18 20:41:07 +00:00
|
|
|
int xfs_bunmapi(struct xfs_trans *tp, struct xfs_inode *ip,
|
2022-04-21 00:46:09 +00:00
|
|
|
xfs_fileoff_t bno, xfs_filblks_t len, uint32_t flags,
|
2018-07-12 05:26:25 +00:00
|
|
|
xfs_extnum_t nexts, int *done);
|
2016-10-20 04:54:14 +00:00
|
|
|
int xfs_bmap_del_extent_delay(struct xfs_inode *ip, int whichfork,
|
2017-11-03 17:34:43 +00:00
|
|
|
struct xfs_iext_cursor *cur, struct xfs_bmbt_irec *got,
|
|
|
|
struct xfs_bmbt_irec *del);
|
|
|
|
void xfs_bmap_del_extent_cow(struct xfs_inode *ip,
|
|
|
|
struct xfs_iext_cursor *cur, struct xfs_bmbt_irec *got,
|
2016-10-20 04:54:14 +00:00
|
|
|
struct xfs_bmbt_irec *del);
|
2011-09-18 20:41:07 +00:00
|
|
|
uint xfs_default_attroffset(struct xfs_inode *ip);
|
2017-10-19 18:07:11 +00:00
|
|
|
int xfs_bmap_collapse_extents(struct xfs_trans *tp, struct xfs_inode *ip,
|
2015-03-25 04:08:56 +00:00
|
|
|
xfs_fileoff_t *next_fsb, xfs_fileoff_t offset_shift_fsb,
|
2018-07-12 05:26:27 +00:00
|
|
|
bool *done);
|
2018-06-22 06:26:57 +00:00
|
|
|
int xfs_bmap_can_insert_extents(struct xfs_inode *ip, xfs_fileoff_t off,
|
|
|
|
xfs_fileoff_t shift);
|
2017-10-19 18:07:11 +00:00
|
|
|
int xfs_bmap_insert_extents(struct xfs_trans *tp, struct xfs_inode *ip,
|
|
|
|
xfs_fileoff_t *next_fsb, xfs_fileoff_t offset_shift_fsb,
|
2018-07-12 05:26:27 +00:00
|
|
|
bool *done, xfs_fileoff_t stop_fsb);
|
2020-02-26 17:43:15 +00:00
|
|
|
int xfs_bmap_split_extent(struct xfs_trans *tp, struct xfs_inode *ip,
|
|
|
|
xfs_fileoff_t split_offset);
|
2016-10-03 16:11:32 +00:00
|
|
|
int xfs_bmapi_reserve_delalloc(struct xfs_inode *ip, int whichfork,
|
2016-11-28 03:57:42 +00:00
|
|
|
xfs_fileoff_t off, xfs_filblks_t len, xfs_filblks_t prealloc,
|
2017-11-03 17:34:43 +00:00
|
|
|
struct xfs_bmbt_irec *got, struct xfs_iext_cursor *cur,
|
|
|
|
int eof);
|
2019-02-15 16:02:49 +00:00
|
|
|
int xfs_bmapi_convert_delalloc(struct xfs_inode *ip, int whichfork,
|
2019-10-17 20:12:06 +00:00
|
|
|
xfs_off_t offset, struct iomap *iomap, unsigned int *seq);
|
2019-02-18 17:38:48 +00:00
|
|
|
int xfs_bmap_add_extent_unwritten_real(struct xfs_trans *tp,
|
|
|
|
struct xfs_inode *ip, int whichfork,
|
|
|
|
struct xfs_iext_cursor *icur, struct xfs_btree_cur **curp,
|
|
|
|
struct xfs_bmbt_irec *new, int *logflagsp);
|
2023-02-10 17:09:06 +00:00
|
|
|
xfs_extlen_t xfs_bmapi_minleft(struct xfs_trans *tp, struct xfs_inode *ip,
|
|
|
|
int fork);
|
2023-02-12 22:14:55 +00:00
|
|
|
int xfs_bmap_btalloc_low_space(struct xfs_bmalloca *ap,
|
|
|
|
struct xfs_alloc_arg *args);
|
2009-03-29 17:26:46 +00:00
|
|
|
|
2016-10-03 16:11:26 +00:00
|
|
|
enum xfs_bmap_intent_type {
|
|
|
|
XFS_BMAP_MAP = 1,
|
|
|
|
XFS_BMAP_UNMAP,
|
|
|
|
};
|
|
|
|
|
2024-02-22 20:43:53 +00:00
|
|
|
#define XFS_BMAP_INTENT_STRINGS \
|
|
|
|
{ XFS_BMAP_MAP, "map" }, \
|
|
|
|
{ XFS_BMAP_UNMAP, "unmap" }
|
|
|
|
|
2016-10-03 16:11:26 +00:00
|
|
|
struct xfs_bmap_intent {
|
|
|
|
struct list_head bi_list;
|
|
|
|
enum xfs_bmap_intent_type bi_type;
|
|
|
|
int bi_whichfork;
|
2021-10-12 22:29:33 +00:00
|
|
|
struct xfs_inode *bi_owner;
|
2023-04-12 01:59:53 +00:00
|
|
|
struct xfs_perag *bi_pag;
|
2016-10-03 16:11:26 +00:00
|
|
|
struct xfs_bmbt_irec bi_bmap;
|
|
|
|
};
|
|
|
|
|
2023-02-01 17:50:53 +00:00
|
|
|
int xfs_bmap_finish_one(struct xfs_trans *tp, struct xfs_bmap_intent *bi);
|
2019-08-27 00:06:04 +00:00
|
|
|
void xfs_bmap_map_extent(struct xfs_trans *tp, struct xfs_inode *ip,
|
2018-08-01 14:20:34 +00:00
|
|
|
struct xfs_bmbt_irec *imap);
|
2019-08-27 00:06:04 +00:00
|
|
|
void xfs_bmap_unmap_extent(struct xfs_trans *tp, struct xfs_inode *ip,
|
2018-08-01 14:20:34 +00:00
|
|
|
struct xfs_bmbt_irec *imap);
|
2016-10-03 16:11:28 +00:00
|
|
|
|
2022-04-21 00:46:01 +00:00
|
|
|
static inline uint32_t xfs_bmap_fork_to_state(int whichfork)
|
2017-10-19 18:02:29 +00:00
|
|
|
{
|
|
|
|
switch (whichfork) {
|
|
|
|
case XFS_ATTR_FORK:
|
|
|
|
return BMAP_ATTRFORK;
|
|
|
|
case XFS_COW_FORK:
|
|
|
|
return BMAP_COWFORK;
|
|
|
|
default:
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-15 18:03:37 +00:00
|
|
|
xfs_failaddr_t xfs_bmap_validate_extent_raw(struct xfs_mount *mp, bool rtfile,
|
|
|
|
int whichfork, struct xfs_bmbt_irec *irec);
|
2018-03-23 17:06:52 +00:00
|
|
|
xfs_failaddr_t xfs_bmap_validate_extent(struct xfs_inode *ip, int whichfork,
|
|
|
|
struct xfs_bmbt_irec *irec);
|
2023-04-12 02:00:05 +00:00
|
|
|
int xfs_bmap_complain_bad_rec(struct xfs_inode *ip, int whichfork,
|
|
|
|
xfs_failaddr_t fa, const struct xfs_bmbt_irec *irec);
|
2018-03-23 17:06:52 +00:00
|
|
|
|
2018-05-14 13:34:34 +00:00
|
|
|
int xfs_bmapi_remap(struct xfs_trans *tp, struct xfs_inode *ip,
|
|
|
|
xfs_fileoff_t bno, xfs_filblks_t len, xfs_fsblock_t startblock,
|
2022-04-21 00:46:09 +00:00
|
|
|
uint32_t flags);
|
2023-12-15 18:03:43 +00:00
|
|
|
int xfs_bunmapi_range(struct xfs_trans **tpp, struct xfs_inode *ip,
|
|
|
|
uint32_t flags, xfs_fileoff_t startoff, xfs_fileoff_t endoff);
|
2018-05-14 13:34:34 +00:00
|
|
|
|
2021-10-12 21:11:01 +00:00
|
|
|
extern struct kmem_cache *xfs_bmap_intent_cache;
|
|
|
|
|
|
|
|
int __init xfs_bmap_intent_init_cache(void);
|
|
|
|
void xfs_bmap_intent_destroy_cache(void);
|
|
|
|
|
2024-02-22 20:43:38 +00:00
|
|
|
typedef int (*xfs_bmap_query_range_fn)(
|
|
|
|
struct xfs_btree_cur *cur,
|
|
|
|
struct xfs_bmbt_irec *rec,
|
|
|
|
void *priv);
|
|
|
|
|
|
|
|
int xfs_bmap_query_all(struct xfs_btree_cur *cur, xfs_bmap_query_range_fn fn,
|
|
|
|
void *priv);
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif /* __XFS_BMAP_H__ */
|