xfs: dispatch metadata scrub subcommands
Create structures needed to hold scrubbing context and dispatch incoming commands to the individual scrubbers. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
This commit is contained in:
@@ -25,6 +25,49 @@
|
||||
|
||||
#include <linux/tracepoint.h>
|
||||
|
||||
DECLARE_EVENT_CLASS(xfs_scrub_class,
|
||||
TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm,
|
||||
int error),
|
||||
TP_ARGS(ip, sm, error),
|
||||
TP_STRUCT__entry(
|
||||
__field(dev_t, dev)
|
||||
__field(xfs_ino_t, ino)
|
||||
__field(unsigned int, type)
|
||||
__field(xfs_agnumber_t, agno)
|
||||
__field(xfs_ino_t, inum)
|
||||
__field(unsigned int, gen)
|
||||
__field(unsigned int, flags)
|
||||
__field(int, error)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->type = sm->sm_type;
|
||||
__entry->agno = sm->sm_agno;
|
||||
__entry->inum = sm->sm_ino;
|
||||
__entry->gen = sm->sm_gen;
|
||||
__entry->flags = sm->sm_flags;
|
||||
__entry->error = error;
|
||||
),
|
||||
TP_printk("dev %d:%d ino %llu type %u agno %u inum %llu gen %u flags 0x%x error %d",
|
||||
MAJOR(__entry->dev), MINOR(__entry->dev),
|
||||
__entry->ino,
|
||||
__entry->type,
|
||||
__entry->agno,
|
||||
__entry->inum,
|
||||
__entry->gen,
|
||||
__entry->flags,
|
||||
__entry->error)
|
||||
)
|
||||
#define DEFINE_SCRUB_EVENT(name) \
|
||||
DEFINE_EVENT(xfs_scrub_class, name, \
|
||||
TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm, \
|
||||
int error), \
|
||||
TP_ARGS(ip, sm, error))
|
||||
|
||||
DEFINE_SCRUB_EVENT(xfs_scrub_start);
|
||||
DEFINE_SCRUB_EVENT(xfs_scrub_done);
|
||||
|
||||
#endif /* _TRACE_XFS_SCRUB_TRACE_H */
|
||||
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
|
Reference in New Issue
Block a user