void xfs_defer_cancel(struct xfs_trans *);
struct xfs_buf *libxfs_trans_getsb(struct xfs_trans *);
+struct xfs_buf *libxfs_trans_getrtsb(struct xfs_trans *tp);
void libxfs_trans_ijoin(struct xfs_trans *, struct xfs_inode *, uint);
void libxfs_trans_log_inode (struct xfs_trans *, struct xfs_inode *,
#define xfs_trans_dirty_buf libxfs_trans_dirty_buf
#define xfs_trans_get_buf libxfs_trans_get_buf
#define xfs_trans_get_buf_map libxfs_trans_get_buf_map
+#define xfs_trans_getrtsb libxfs_trans_getrtsb
#define xfs_trans_getsb libxfs_trans_getsb
#define xfs_trans_ichgtime libxfs_trans_ichgtime
#define xfs_trans_ijoin libxfs_trans_ijoin
int libxfs_readbuf_verify(struct xfs_buf *bp, const struct xfs_buf_ops *ops);
struct xfs_buf *libxfs_getsb(struct xfs_mount *mp);
+struct xfs_buf *libxfs_getrtsb(struct xfs_mount *mp);
extern void libxfs_bcache_purge(struct xfs_mount *mp);
extern void libxfs_bcache_free(void);
extern void libxfs_bcache_flush(struct xfs_mount *mp);
return bp;
}
+struct xfs_buf *
+libxfs_getrtsb(
+ struct xfs_mount *mp)
+{
+ struct xfs_buf *bp;
+ int error;
+
+ if (!mp->m_rtdev_targp->bt_bdev)
+ return NULL;
+
+ error = libxfs_buf_read_uncached(mp->m_rtdev_targp, XFS_RTSB_DADDR,
+ XFS_FSB_TO_BB(mp, 1), 0, &bp, &xfs_rtsb_buf_ops);
+ if (error)
+ return NULL;
+ return bp;
+}
+
struct kmem_cache *xfs_buf_cache;
static struct cache_mru xfs_buf_freelist =
return bp;
}
+struct xfs_buf *
+libxfs_trans_getrtsb(
+ struct xfs_trans *tp)
+{
+ struct xfs_mount *mp = tp->t_mountp;
+ struct xfs_buf *bp;
+ struct xfs_buf_log_item *bip;
+ int len = XFS_FSS_TO_BB(mp, 1);
+ DEFINE_SINGLE_BUF_MAP(map, XFS_SB_DADDR, len);
+
+ bp = xfs_trans_buf_item_match(tp, mp->m_rtdev, &map, 1);
+ if (bp != NULL) {
+ ASSERT(bp->b_transp == tp);
+ bip = bp->b_log_item;
+ ASSERT(bip != NULL);
+ bip->bli_recur++;
+ trace_xfs_trans_getsb_recur(bip);
+ return bp;
+ }
+
+ bp = libxfs_getrtsb(mp);
+ if (bp == NULL)
+ return NULL;
+
+ _libxfs_trans_bjoin(tp, bp, 1);
+ trace_xfs_trans_getsb(bp->b_log_item);
+ return bp;
+}
+
int
libxfs_trans_read_buf_map(
struct xfs_mount *mp,