Commit e3f77734 authored by Nathan Scott's avatar Nathan Scott

[XFS] Change pagebuf to use the same ktrace implementation as XFS, instead of...

[XFS] Change pagebuf to use the same ktrace implementation as XFS, instead of reinventing that wheel.

SGI Modid: 2.5.x-xfs:slinx:162159a
parent 272a8d2c
......@@ -69,10 +69,6 @@
#include <pagebuf/page_buf.h>
#ifndef STATIC
#define STATIC static
#endif
/*
* State flag for unwritten extent buffers.
*
......
This diff is collapsed.
......@@ -321,4 +321,16 @@ extern void pagebuf_delwri_dequeue(
extern int pagebuf_init(void);
extern void pagebuf_terminate(void);
#ifdef PAGEBUF_TRACE
extern ktrace_t *pagebuf_trace_buf;
extern void pagebuf_trace(
page_buf_t *, /* buffer being traced */
char *, /* description of operation */
void *, /* arbitrary diagnostic value */
void *); /* return address */
#else
# define pagebuf_trace(pb, id, ptr, ra) do { } while (0)
#endif
#endif /* __PAGE_BUF_H__ */
......@@ -44,6 +44,10 @@
extern void icmn_err(int, char *, va_list);
extern void cmn_err(int, char *, ...);
#ifndef STATIC
# define STATIC static
#endif
#ifdef DEBUG
# ifdef lint
# define ASSERT(EX) ((void)0) /* avoid "constant in conditional" babble */
......
......@@ -179,6 +179,7 @@ ktrace_enter(
void *val15)
{
static lock_t wrap_lock = SPIN_LOCK_UNLOCKED;
unsigned long flags;
int index;
ktrace_entry_t *ktep;
......@@ -187,11 +188,11 @@ ktrace_enter(
/*
* Grab an entry by pushing the index up to the next one.
*/
spin_lock(&wrap_lock);
spin_lock_irqsave(&wrap_lock, flags);
index = ktp->kt_index;
if (++ktp->kt_index == ktp->kt_nentries)
ktp->kt_index = 0;
spin_unlock(&wrap_lock);
spin_unlock_irqrestore(&wrap_lock, flags);
if (!ktp->kt_rollover && index == ktp->kt_nentries - 1)
ktp->kt_rollover = 1;
......
......@@ -231,18 +231,11 @@ static inline void xfs_buf_relse(page_buf_t *bp)
pagebuf_rele(bp);
}
#define xfs_bpin(bp) pagebuf_pin(bp)
#define xfs_bunpin(bp) pagebuf_unpin(bp)
#ifdef PAGEBUF_TRACE
# define PB_DEFINE_TRACES
# include <pagebuf/page_buf_trace.h>
# define xfs_buftrace(id, bp) PB_TRACE(bp, PB_TRACE_REC(external), (void *)id)
#else
# define xfs_buftrace(id, bp) do { } while (0)
#endif
#define xfs_buftrace(id, bp) \
pagebuf_trace(bp, id, NULL, (void *)__builtin_return_address(0))
#define xfs_biodone(pb) \
pagebuf_iodone(pb, (pb->pb_flags & PBF_FS_DATAIOD), 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment