Go to the documentation of this file.
21 #include <linux/list.h>
22 #include <linux/types.h>
27 #include <linux/uio.h>
33 #define XFS_BUF_DADDR_NULL ((xfs_daddr_t) (-1LL))
41 #define XBF_READ (1 << 0)
42 #define XBF_WRITE (1 << 1)
43 #define XBF_READ_AHEAD (1 << 2)
44 #define XBF_ASYNC (1 << 4)
45 #define XBF_DONE (1 << 5)
46 #define XBF_STALE (1 << 6)
49 #define XBF_SYNCIO (1 << 10)
50 #define XBF_FUA (1 << 11)
51 #define XBF_FLUSH (1 << 12)
54 #define XBF_TRYLOCK (1 << 16)
55 #define XBF_UNMAPPED (1 << 17)
58 #define _XBF_PAGES (1 << 20)
59 #define _XBF_KMEM (1 << 21)
60 #define _XBF_DELWRI_Q (1 << 22)
61 #define _XBF_COMPOUND (1 << 23)
62 #define _XBF_LRU_DISPOSE (1 << 24)
66 #define XFS_BUF_FLAGS \
67 { XBF_READ, "READ" }, \
68 { XBF_WRITE, "WRITE" }, \
69 { XBF_READ_AHEAD, "READ_AHEAD" }, \
70 { XBF_ASYNC, "ASYNC" }, \
71 { XBF_DONE, "DONE" }, \
72 { XBF_STALE, "STALE" }, \
73 { XBF_SYNCIO, "SYNCIO" }, \
75 { XBF_FLUSH, "FLUSH" }, \
76 { XBF_TRYLOCK, "TRYLOCK" }, \
77 { XBF_UNMAPPED, "UNMAPPED" }, \
78 { _XBF_PAGES, "PAGES" }, \
79 { _XBF_KMEM, "KMEM" }, \
80 { _XBF_DELWRI_Q, "DELWRI_Q" }, \
81 { _XBF_COMPOUND, "COMPOUND" }, \
82 { _XBF_LRU_DISPOSE, "LRU_DISPOSE" }
110 #define DEFINE_SINGLE_BUF_MAP(map, blkno, numblk) \
111 struct xfs_buf_map (map) = { .bm_bn = (blkno), .bm_len = (numblk) };
157 #ifdef XFS_BUF_LOCK_TRACKING
242 xfs_daddr_t
daddr,
size_t numblks,
int flags);
253 #define xfs_buf_islocked(bp) \
254 ((bp)->b_sema.count <= 0)
268 #define xfs_buf_zero(bp, off, len) \
269 xfs_buf_iomove((bp), (off), (len), NULL, XBRW_ZERO)
271 static inline int xfs_buf_geterror(
xfs_buf_t *bp)
288 #define XFS_BUF_ZEROFLAGS(bp) \
289 ((bp)->b_flags &= ~(XBF_READ|XBF_WRITE|XBF_ASYNC| \
290 XBF_SYNCIO|XBF_FUA|XBF_FLUSH))
293 #define XFS_BUF_UNSTALE(bp) ((bp)->b_flags &= ~XBF_STALE)
294 #define XFS_BUF_ISSTALE(bp) ((bp)->b_flags & XBF_STALE)
296 #define XFS_BUF_DONE(bp) ((bp)->b_flags |= XBF_DONE)
297 #define XFS_BUF_UNDONE(bp) ((bp)->b_flags &= ~XBF_DONE)
298 #define XFS_BUF_ISDONE(bp) ((bp)->b_flags & XBF_DONE)
300 #define XFS_BUF_ASYNC(bp) ((bp)->b_flags |= XBF_ASYNC)
301 #define XFS_BUF_UNASYNC(bp) ((bp)->b_flags &= ~XBF_ASYNC)
302 #define XFS_BUF_ISASYNC(bp) ((bp)->b_flags & XBF_ASYNC)
304 #define XFS_BUF_READ(bp) ((bp)->b_flags |= XBF_READ)
305 #define XFS_BUF_UNREAD(bp) ((bp)->b_flags &= ~XBF_READ)
306 #define XFS_BUF_ISREAD(bp) ((bp)->b_flags & XBF_READ)
308 #define XFS_BUF_WRITE(bp) ((bp)->b_flags |= XBF_WRITE)
309 #define XFS_BUF_UNWRITE(bp) ((bp)->b_flags &= ~XBF_WRITE)
310 #define XFS_BUF_ISWRITE(bp) ((bp)->b_flags & XBF_WRITE)
322 #define XFS_BUF_ADDR(bp) ((bp)->b_map.bm_bn)
323 #define XFS_BUF_SET_ADDR(bp, bno) ((bp)->b_map.bm_bn = (xfs_daddr_t)(bno))
325 static inline void xfs_buf_set_ref(
struct xfs_buf *bp,
int lru_ref)
330 static inline int xfs_buf_ispinned(
struct xfs_buf *bp)
335 static inline void xfs_buf_relse(
xfs_buf_t *bp)
350 #define xfs_getsize_buftarg(buftarg) block_size((buftarg)->bt_bdev)
351 #define xfs_readonly_buftarg(buftarg) bdev_read_only((buftarg)->bt_bdev)