Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a19d939 authored by Dave Chinner's avatar Dave Chinner Committed by Dave Chinner
Browse files

xfs: convert xfs_cmn_err to xfs_alert_tag



Continue the conversion of the old cmn_err interface be converting
all the conditional panic tag errors to xfs_alert_tag() and then
removing xfs_cmn_err().

Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarAlex Elder <aelder@sgi.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent a0fa2b67
Loading
Loading
Loading
Loading
+0 −28
Original line number Original line Diff line number Diff line
@@ -64,34 +64,6 @@ xfs_fs_cmn_err(
	BUG_ON(strncmp(lvl, KERN_EMERG, strlen(KERN_EMERG)) == 0);
	BUG_ON(strncmp(lvl, KERN_EMERG, strlen(KERN_EMERG)) == 0);
}
}


/* All callers to xfs_cmn_err use CE_ALERT, so don't bother testing lvl */
void
xfs_cmn_err(
	int			panic_tag,
	const char		*lvl,
	struct xfs_mount	*mp,
	const char		*fmt,
	...)
{
	struct va_format	vaf;
	va_list			args;
	int			do_panic = 0;

	if (xfs_panic_mask && (xfs_panic_mask & panic_tag)) {
		printk(KERN_ALERT "XFS: Transforming an alert into a BUG.");
		do_panic = 1;
	}

	va_start(args, fmt);
	vaf.fmt = fmt;
	vaf.va = &args;

	printk(KERN_ALERT "Filesystem %s: %pV", mp->m_fsname, &vaf);
	va_end(args);

	BUG_ON(do_panic);
}

void
void
assfail(char *expr, char *file, int line)
assfail(char *expr, char *file, int line)
{
{
+0 −2
Original line number Original line Diff line number Diff line
@@ -33,8 +33,6 @@ void cmn_err(const char *lvl, const char *fmt, ...)
		__attribute__ ((format (printf, 2, 3)));
		__attribute__ ((format (printf, 2, 3)));
void xfs_fs_cmn_err( const char *lvl, struct xfs_mount *mp,
void xfs_fs_cmn_err( const char *lvl, struct xfs_mount *mp,
		const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
		const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
void xfs_cmn_err( int panic_tag, const char *lvl, struct xfs_mount *mp,
		const char *fmt, ...) __attribute__ ((format (printf, 4, 5)));


extern void assfail(char *expr, char *f, int l);
extern void assfail(char *expr, char *f, int l);


+1 −1
Original line number Original line Diff line number Diff line
@@ -3526,7 +3526,7 @@ xfs_bmap_search_extents(


	if (unlikely(!(gotp->br_startblock) && (*lastxp != NULLEXTNUM) &&
	if (unlikely(!(gotp->br_startblock) && (*lastxp != NULLEXTNUM) &&
		     !(XFS_IS_REALTIME_INODE(ip) && fork == XFS_DATA_FORK))) {
		     !(XFS_IS_REALTIME_INODE(ip) && fork == XFS_DATA_FORK))) {
		xfs_cmn_err(XFS_PTAG_FSBLOCK_ZERO, CE_ALERT, ip->i_mount,
		xfs_alert_tag(ip->i_mount, XFS_PTAG_FSBLOCK_ZERO,
				"Access to block zero in inode %llu "
				"Access to block zero in inode %llu "
				"start_block: %llx start_off: %llx "
				"start_block: %llx start_off: %llx "
				"blkcnt: %llx extent-state: %x lastx: %x\n",
				"blkcnt: %llx extent-state: %x lastx: %x\n",
+2 −3
Original line number Original line Diff line number Diff line
@@ -162,9 +162,8 @@ xfs_error_report(
	inst_t			*ra)
	inst_t			*ra)
{
{
	if (level <= xfs_error_level) {
	if (level <= xfs_error_level) {
		xfs_cmn_err(XFS_PTAG_ERROR_REPORT,
		xfs_alert_tag(mp, XFS_PTAG_ERROR_REPORT,
			    CE_ALERT, mp,
		"Internal error %s at line %d of file %s.  Caller 0x%p\n",
		"XFS internal error %s at line %d of file %s.  Caller 0x%p\n",
			    tag, linenum, filename, ra);
			    tag, linenum, filename, ra);


		xfs_stack_trace();
		xfs_stack_trace();
+2 −4
Original line number Original line Diff line number Diff line
@@ -145,10 +145,8 @@ extern int xfs_errortag_clearall(struct xfs_mount *mp, int loud);
#endif /* DEBUG */
#endif /* DEBUG */


/*
/*
 * XFS panic tags -- allow a call to xfs_cmn_err() be turned into
 * XFS panic tags -- allow a call to xfs_alert_tag() be turned into
 *			a panic by setting xfs_panic_mask in a
 *			a panic by setting xfs_panic_mask in a sysctl.
 *			sysctl.  update xfs_max[XFS_PARAM] if
 *			more are added.
 */
 */
#define		XFS_NO_PTAG			0
#define		XFS_NO_PTAG			0
#define		XFS_PTAG_IFLUSH			0x00000001
#define		XFS_PTAG_IFLUSH			0x00000001
Loading