#ifndef __XFS_BUF_H__
#define __XFS_BUF_H__
#include <linux/list.h>
#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/dax.h>
#include <linux/uio.h>
#include <linux/list_lru.h>
extern struct kmem_cache *xfs_buf_cache;
struct xfs_buf;
#define XFS_BUF_DADDR_NULL …
#define XBF_READ …
#define XBF_WRITE …
#define XBF_READ_AHEAD …
#define XBF_NO_IOACCT …
#define XBF_ASYNC …
#define XBF_DONE …
#define XBF_STALE …
#define XBF_WRITE_FAIL …
#define _XBF_INODES …
#define _XBF_DQUOTS …
#define _XBF_LOGRECOVERY …
#define _XBF_PAGES …
#define _XBF_KMEM …
#define _XBF_DELWRI_Q …
#define XBF_LIVESCAN …
#define XBF_INCORE …
#define XBF_TRYLOCK …
#define XBF_UNMAPPED …
xfs_buf_flags_t;
#define XFS_BUF_FLAGS …
#define XFS_BSTATE_DISPOSE …
#define XFS_BSTATE_IN_FLIGHT …
struct xfs_buf_cache { … };
int xfs_buf_cache_init(struct xfs_buf_cache *bch);
void xfs_buf_cache_destroy(struct xfs_buf_cache *bch);
struct xfs_buftarg { … };
#define XB_PAGES …
struct xfs_buf_map { … };
#define XBM_LIVESCAN …
#define DEFINE_SINGLE_BUF_MAP(map, blkno, numblk) …
struct xfs_buf_ops { … };
struct xfs_buf { … };
int xfs_buf_get_map(struct xfs_buftarg *target, struct xfs_buf_map *map,
int nmaps, xfs_buf_flags_t flags, struct xfs_buf **bpp);
int xfs_buf_read_map(struct xfs_buftarg *target, struct xfs_buf_map *map,
int nmaps, xfs_buf_flags_t flags, struct xfs_buf **bpp,
const struct xfs_buf_ops *ops, xfs_failaddr_t fa);
void xfs_buf_readahead_map(struct xfs_buftarg *target,
struct xfs_buf_map *map, int nmaps,
const struct xfs_buf_ops *ops);
static inline int
xfs_buf_incore(
struct xfs_buftarg *target,
xfs_daddr_t blkno,
size_t numblks,
xfs_buf_flags_t flags,
struct xfs_buf **bpp)
{ … }
static inline int
xfs_buf_get(
struct xfs_buftarg *target,
xfs_daddr_t blkno,
size_t numblks,
struct xfs_buf **bpp)
{ … }
static inline int
xfs_buf_read(
struct xfs_buftarg *target,
xfs_daddr_t blkno,
size_t numblks,
xfs_buf_flags_t flags,
struct xfs_buf **bpp,
const struct xfs_buf_ops *ops)
{ … }
static inline void
xfs_buf_readahead(
struct xfs_buftarg *target,
xfs_daddr_t blkno,
size_t numblks,
const struct xfs_buf_ops *ops)
{ … }
int xfs_buf_get_uncached(struct xfs_buftarg *target, size_t numblks,
xfs_buf_flags_t flags, struct xfs_buf **bpp);
int xfs_buf_read_uncached(struct xfs_buftarg *target, xfs_daddr_t daddr,
size_t numblks, xfs_buf_flags_t flags, struct xfs_buf **bpp,
const struct xfs_buf_ops *ops);
int _xfs_buf_read(struct xfs_buf *bp, xfs_buf_flags_t flags);
void xfs_buf_hold(struct xfs_buf *bp);
extern void xfs_buf_rele(struct xfs_buf *);
extern int xfs_buf_trylock(struct xfs_buf *);
extern void xfs_buf_lock(struct xfs_buf *);
extern void xfs_buf_unlock(struct xfs_buf *);
#define xfs_buf_islocked(bp) …
static inline void xfs_buf_relse(struct xfs_buf *bp)
{ … }
extern int xfs_bwrite(struct xfs_buf *bp);
extern void __xfs_buf_ioerror(struct xfs_buf *bp, int error,
xfs_failaddr_t failaddr);
#define xfs_buf_ioerror(bp, err) …
extern void xfs_buf_ioerror_alert(struct xfs_buf *bp, xfs_failaddr_t fa);
void xfs_buf_ioend_fail(struct xfs_buf *);
void xfs_buf_zero(struct xfs_buf *bp, size_t boff, size_t bsize);
void __xfs_buf_mark_corrupt(struct xfs_buf *bp, xfs_failaddr_t fa);
#define xfs_buf_mark_corrupt(bp) …
extern void *xfs_buf_offset(struct xfs_buf *, size_t);
extern void xfs_buf_stale(struct xfs_buf *bp);
extern void xfs_buf_delwri_cancel(struct list_head *);
extern bool xfs_buf_delwri_queue(struct xfs_buf *, struct list_head *);
void xfs_buf_delwri_queue_here(struct xfs_buf *bp, struct list_head *bl);
extern int xfs_buf_delwri_submit(struct list_head *);
extern int xfs_buf_delwri_submit_nowait(struct list_head *);
extern int xfs_buf_delwri_pushbuf(struct xfs_buf *, struct list_head *);
static inline xfs_daddr_t xfs_buf_daddr(struct xfs_buf *bp)
{ … }
void xfs_buf_set_ref(struct xfs_buf *bp, int lru_ref);
static inline void xfs_buf_oneshot(struct xfs_buf *bp)
{ … }
static inline int xfs_buf_ispinned(struct xfs_buf *bp)
{ … }
static inline int
xfs_buf_verify_cksum(struct xfs_buf *bp, unsigned long cksum_offset)
{ … }
static inline void
xfs_buf_update_cksum(struct xfs_buf *bp, unsigned long cksum_offset)
{ … }
struct xfs_buftarg *xfs_alloc_buftarg(struct xfs_mount *mp,
struct file *bdev_file);
extern void xfs_free_buftarg(struct xfs_buftarg *);
extern void xfs_buftarg_wait(struct xfs_buftarg *);
extern void xfs_buftarg_drain(struct xfs_buftarg *);
extern int xfs_setsize_buftarg(struct xfs_buftarg *, unsigned int);
#define xfs_getsize_buftarg(buftarg) …
#define xfs_readonly_buftarg(buftarg) …
int xfs_buf_reverify(struct xfs_buf *bp, const struct xfs_buf_ops *ops);
bool xfs_verify_magic(struct xfs_buf *bp, __be32 dmagic);
bool xfs_verify_magic16(struct xfs_buf *bp, __be16 dmagic);
int xfs_init_buftarg(struct xfs_buftarg *btp, size_t logical_sectorsize,
const char *descr);
void xfs_destroy_buftarg(struct xfs_buftarg *btp);
#endif