aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_trans.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-06-22 04:50:11 -0400
committerBen Myers <bpm@sgi.com>2012-07-01 15:50:06 -0400
commitde2a4f59190303ff5b82ead2969968a325e61230 (patch)
tree90a719a20401085dbb0e4848a49a0862f85059c9 /fs/xfs/xfs_trans.h
parent6dde27077eaf590eac279627f74b7e4e40b864b2 (diff)
xfs: add discontiguous buffer support to transactions
Now that the buffer cache supports discontiguous buffers, add support to the transaction buffer interface for getting and reading buffers. Note that this patch does not convert the buffer item logging to support discontiguous buffers. That will be done as a separate commit. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_trans.h')
-rw-r--r--fs/xfs/xfs_trans.h50
1 files changed, 45 insertions, 5 deletions
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h
index 7c37b533aa8..bc2afd52a0b 100644
--- a/fs/xfs/xfs_trans.h
+++ b/fs/xfs/xfs_trans.h
@@ -448,11 +448,51 @@ xfs_trans_t *xfs_trans_dup(xfs_trans_t *);
448int xfs_trans_reserve(xfs_trans_t *, uint, uint, uint, 448int xfs_trans_reserve(xfs_trans_t *, uint, uint, uint,
449 uint, uint); 449 uint, uint);
450void xfs_trans_mod_sb(xfs_trans_t *, uint, int64_t); 450void xfs_trans_mod_sb(xfs_trans_t *, uint, int64_t);
451struct xfs_buf *xfs_trans_get_buf(xfs_trans_t *, struct xfs_buftarg *, xfs_daddr_t, 451
452 int, uint); 452struct xfs_buf *xfs_trans_get_buf_map(struct xfs_trans *tp,
453int xfs_trans_read_buf(struct xfs_mount *, xfs_trans_t *, 453 struct xfs_buftarg *target,
454 struct xfs_buftarg *, xfs_daddr_t, int, uint, 454 struct xfs_buf_map *map, int nmaps,
455 struct xfs_buf **); 455 uint flags);
456
457static inline struct xfs_buf *
458xfs_trans_get_buf(
459 struct xfs_trans *tp,
460 struct xfs_buftarg *target,
461 xfs_daddr_t blkno,
462 int numblks,
463 uint flags)
464{
465 struct xfs_buf_map map = {
466 .bm_bn = blkno,
467 .bm_len = numblks,
468 };
469 return xfs_trans_get_buf_map(tp, target, &map, 1, flags);
470}
471
472int xfs_trans_read_buf_map(struct xfs_mount *mp,
473 struct xfs_trans *tp,
474 struct xfs_buftarg *target,
475 struct xfs_buf_map *map, int nmaps,
476 xfs_buf_flags_t flags,
477 struct xfs_buf **bpp);
478
479static inline int
480xfs_trans_read_buf(
481 struct xfs_mount *mp,
482 struct xfs_trans *tp,
483 struct xfs_buftarg *target,
484 xfs_daddr_t blkno,
485 int numblks,
486 xfs_buf_flags_t flags,
487 struct xfs_buf **bpp)
488{
489 struct xfs_buf_map map = {
490 .bm_bn = blkno,
491 .bm_len = numblks,
492 };
493 return xfs_trans_read_buf_map(mp, tp, target, &map, 1, flags, bpp);
494}
495
456struct xfs_buf *xfs_trans_getsb(xfs_trans_t *, struct xfs_mount *, int); 496struct xfs_buf *xfs_trans_getsb(xfs_trans_t *, struct xfs_mount *, int);
457 497
458void xfs_trans_brelse(xfs_trans_t *, struct xfs_buf *); 498void xfs_trans_brelse(xfs_trans_t *, struct xfs_buf *);