#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_shared.h"
#include "xfs_format.h"
#include "xfs_log_format.h"
#include "xfs_trans_resv.h"
#include "xfs_mount.h"
#include "xfs_defer.h"
#include "xfs_inode.h"
#include "xfs_trans.h"
#include "xfs_bmap.h"
#include "xfs_icache.h"
#include "xfs_quota.h"
#include "xfs_exchmaps.h"
#include "xfs_trace.h"
#include "xfs_bmap_btree.h"
#include "xfs_trans_space.h"
#include "xfs_error.h"
#include "xfs_errortag.h"
#include "xfs_health.h"
#include "xfs_exchmaps_item.h"
#include "xfs_da_format.h"
#include "xfs_da_btree.h"
#include "xfs_attr_leaf.h"
#include "xfs_attr.h"
#include "xfs_dir2_priv.h"
#include "xfs_dir2.h"
#include "xfs_symlink_remote.h"
struct kmem_cache *xfs_exchmaps_intent_cache;
struct xfs_exchmaps_adjacent { … };
#define ADJACENT_INIT …
static inline void
xfs_exchmaps_ensure_cowfork(
struct xfs_inode *ip)
{ … }
STATIC void
xfs_exchmaps_update_size(
struct xfs_trans *tp,
struct xfs_inode *ip,
struct xfs_bmbt_irec *imap,
xfs_fsize_t new_isize)
{ … }
static inline void
xmi_advance(
struct xfs_exchmaps_intent *xmi,
const struct xfs_bmbt_irec *irec)
{ … }
static inline bool
xmi_has_more_exchange_work(const struct xfs_exchmaps_intent *xmi)
{ … }
static inline bool
xmi_has_postop_work(const struct xfs_exchmaps_intent *xmi)
{ … }
int
xfs_exchmaps_check_forks(
struct xfs_mount *mp,
const struct xfs_exchmaps_req *req)
{ … }
#ifdef CONFIG_XFS_QUOTA
static inline void
xfs_exchmaps_update_quota(
struct xfs_trans *tp,
struct xfs_exchmaps_intent *xmi,
struct xfs_bmbt_irec *irec1,
struct xfs_bmbt_irec *irec2)
{ … }
#else
#define xfs_exchmaps_update_quota …
#endif
static inline bool
xfs_exchmaps_can_skip_mapping(
struct xfs_exchmaps_intent *xmi,
struct xfs_bmbt_irec *irec)
{ … }
static int
xfs_exchmaps_find_mappings(
struct xfs_exchmaps_intent *xmi,
struct xfs_bmbt_irec *irec1,
struct xfs_bmbt_irec *irec2,
struct xfs_exchmaps_adjacent *adj)
{ … }
static void
xfs_exchmaps_one_step(
struct xfs_trans *tp,
struct xfs_exchmaps_intent *xmi,
struct xfs_bmbt_irec *irec1,
struct xfs_bmbt_irec *irec2)
{ … }
STATIC int
xfs_exchmaps_attr_to_sf(
struct xfs_trans *tp,
struct xfs_exchmaps_intent *xmi)
{ … }
STATIC int
xfs_exchmaps_dir_to_sf(
struct xfs_trans *tp,
struct xfs_exchmaps_intent *xmi)
{ … }
STATIC int
xfs_exchmaps_link_to_sf(
struct xfs_trans *tp,
struct xfs_exchmaps_intent *xmi)
{ … }
static inline void
xfs_exchmaps_clear_reflink(
struct xfs_trans *tp,
struct xfs_inode *ip)
{ … }
static int
xfs_exchmaps_do_postop_work(
struct xfs_trans *tp,
struct xfs_exchmaps_intent *xmi)
{ … }
int
xfs_exchmaps_finish_one(
struct xfs_trans *tp,
struct xfs_exchmaps_intent *xmi)
{ … }
static inline uint64_t
xfs_exchmaps_bmbt_blocks(
struct xfs_mount *mp,
const struct xfs_exchmaps_req *req)
{ … }
static inline uint64_t
xfs_exchmaps_rmapbt_blocks(
struct xfs_mount *mp,
const struct xfs_exchmaps_req *req)
{ … }
int
xfs_exchmaps_estimate_overhead(
struct xfs_exchmaps_req *req)
{ … }
static inline bool
xmi_can_merge(
const struct xfs_bmbt_irec *b1,
const struct xfs_bmbt_irec *b2)
{ … }
static inline bool
xmi_can_merge_all(
const struct xfs_bmbt_irec *l,
const struct xfs_bmbt_irec *m,
const struct xfs_bmbt_irec *r)
{ … }
#define CLEFT_CONTIG …
#define CRIGHT_CONTIG …
#define CHOLE …
#define CBOTH_CONTIG …
#define NLEFT_CONTIG …
#define NRIGHT_CONTIG …
#define NHOLE …
#define NBOTH_CONTIG …
static inline int
xmi_delta_nextents_step(
struct xfs_mount *mp,
const struct xfs_bmbt_irec *left,
const struct xfs_bmbt_irec *curr,
const struct xfs_bmbt_irec *new,
const struct xfs_bmbt_irec *right)
{ … }
static inline int
xmi_ensure_delta_nextents(
struct xfs_exchmaps_req *req,
struct xfs_inode *ip,
int64_t delta)
{ … }
static inline int
xmi_next(
struct xfs_inode *ip,
int bmap_flags,
const struct xfs_bmbt_irec *irec,
struct xfs_bmbt_irec *nrec)
{ … }
int __init
xfs_exchmaps_intent_init_cache(void)
{ … }
void
xfs_exchmaps_intent_destroy_cache(void)
{ … }
static inline bool
xmi_can_exchange_reflink_flags(
const struct xfs_exchmaps_req *req,
unsigned int reflink_state)
{ … }
struct xfs_exchmaps_intent *
xfs_exchmaps_init_intent(
const struct xfs_exchmaps_req *req)
{ … }
int
xfs_exchmaps_estimate(
struct xfs_exchmaps_req *req)
{ … }
static inline void
xfs_exchmaps_set_reflink(
struct xfs_trans *tp,
struct xfs_inode *ip)
{ … }
void
xfs_exchmaps_ensure_reflink(
struct xfs_trans *tp,
const struct xfs_exchmaps_intent *xmi)
{ … }
static inline void
xfs_exchmaps_ensure_large_extent_counts(
struct xfs_trans *tp,
struct xfs_inode *ip)
{ … }
void
xfs_exchmaps_upgrade_extent_counts(
struct xfs_trans *tp,
const struct xfs_exchmaps_intent *xmi)
{ … }
void
xfs_exchange_mappings(
struct xfs_trans *tp,
const struct xfs_exchmaps_req *req)
{ … }