extern int libxfs_bcache_overflowed(void);
/* Buffer (Raw) Interfaces */
-extern xfs_buf_t *libxfs_getbufr(struct xfs_buftarg *, xfs_daddr_t, int);
-extern void libxfs_putbufr(xfs_buf_t *);
-
int libxfs_bwrite(struct xfs_buf *bp);
extern int libxfs_readbufr(struct xfs_buftarg *, xfs_daddr_t, xfs_buf_t *, int, int);
extern int libxfs_readbufr_map(struct xfs_buftarg *, struct xfs_buf *, int);
#include "libxfs.h"
+static void libxfs_brelse(struct cache_node *node);
+
/*
* Important design/architecture note:
*
return bp;
}
-xfs_buf_t *
+static xfs_buf_t *
libxfs_getbufr(struct xfs_buftarg *btp, xfs_daddr_t blkno, int bblen)
{
xfs_buf_t *bp;
if (!list_empty(&bp->b_node.cn_hash))
cache_node_put(libxfs_bcache, &bp->b_node);
- else if (--bp->b_node.cn_count == 0)
- libxfs_putbufr(bp);
+ else if (--bp->b_node.cn_count == 0) {
+ if (bp->b_flags & LIBXFS_B_DIRTY)
+ libxfs_bwrite(bp);
+ libxfs_brelse(&bp->b_node);
+ }
}
static struct cache_node *
return bp->b_error;
}
-void
-libxfs_putbufr(xfs_buf_t *bp)
-{
- if (bp->b_flags & LIBXFS_B_DIRTY)
- libxfs_bwrite(bp);
- libxfs_brelse(&bp->b_node);
-}
-
-
void
libxfs_bcache_purge(void)
{