Commit 53487786 authored by Dave Chinner's avatar Dave Chinner Committed by Dave Chinner
Browse files

xfs: convert xfs_fs_cmn_err to new error logging API



Continue to clean up the error logging code by converting all the
callers of xfs_fs_cmn_err() to the new API. Once done, remove the
unused old API function.

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 af34e09d
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1393,8 +1393,8 @@ xfs_qm_dqpurge(
		 */
		 */
		error = xfs_qm_dqflush(dqp, SYNC_WAIT);
		error = xfs_qm_dqflush(dqp, SYNC_WAIT);
		if (error)
		if (error)
			xfs_fs_cmn_err(CE_WARN, mp,
			xfs_warn(mp, "%s: dquot %p flush failed",
				"xfs_qm_dqpurge: dquot %p flush failed", dqp);
				__func__, dqp);
		xfs_dqflock(dqp);
		xfs_dqflock(dqp);
	}
	}
	ASSERT(atomic_read(&dqp->q_pincount) == 0);
	ASSERT(atomic_read(&dqp->q_pincount) == 0);
+2 −3
Original line number Original line Diff line number Diff line
@@ -136,9 +136,8 @@ xfs_qm_dquot_logitem_push(
	 */
	 */
	error = xfs_qm_dqflush(dqp, 0);
	error = xfs_qm_dqflush(dqp, 0);
	if (error)
	if (error)
		xfs_fs_cmn_err(CE_WARN, dqp->q_mount,
		xfs_warn(dqp->q_mount, "%s: push error %d on dqp %p",
			"xfs_qm_dquot_logitem_push: push error %d on dqp %p",
			__func__, error, dqp);
			error, dqp);
	xfs_dqunlock(dqp);
	xfs_dqunlock(dqp);
}
}


+6 −7
Original line number Original line Diff line number Diff line
@@ -402,14 +402,13 @@ xfs_qm_mount_quotas(
			 * off, but the on disk superblock doesn't know that !
			 * off, but the on disk superblock doesn't know that !
			 */
			 */
			ASSERT(!(XFS_IS_QUOTA_RUNNING(mp)));
			ASSERT(!(XFS_IS_QUOTA_RUNNING(mp)));
			xfs_fs_cmn_err(CE_ALERT, mp,
			xfs_alert(mp, "%s: Superblock update failed!",
				"XFS mount_quotas: Superblock update failed!");
				__func__);
		}
		}
	}
	}


	if (error) {
	if (error) {
		xfs_fs_cmn_err(CE_WARN, mp,
		xfs_warn(mp, "Failed to initialize disk quotas.");
			"Failed to initialize disk quotas.");
		return;
		return;
	}
	}


@@ -1257,7 +1256,7 @@ xfs_qm_qino_alloc(
	xfs_mod_sb(tp, sbfields);
	xfs_mod_sb(tp, sbfields);


	if ((error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES))) {
	if ((error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES))) {
		xfs_fs_cmn_err(CE_ALERT, mp, "XFS qino_alloc failed!");
		xfs_alert(mp, "%s failed (error %d)!", __func__, error);
		return error;
		return error;
	}
	}
	return 0;
	return 0;
@@ -1930,8 +1929,8 @@ again:
			 */
			 */
			error = xfs_qm_dqflush(dqp, 0);
			error = xfs_qm_dqflush(dqp, 0);
			if (error) {
			if (error) {
				xfs_fs_cmn_err(CE_WARN, mp,
				xfs_warn(mp, "%s: dquot %p flush failed",
			"xfs_qm_dqreclaim: dquot %p flush failed", dqp);
					__func__, dqp);
			}
			}
			goto dqunlock;
			goto dqunlock;
		}
		}
+0 −20
Original line number Original line Diff line number Diff line
@@ -44,26 +44,6 @@ cmn_err(
	BUG_ON(strncmp(lvl, KERN_EMERG, strlen(KERN_EMERG)) == 0);
	BUG_ON(strncmp(lvl, KERN_EMERG, strlen(KERN_EMERG)) == 0);
}
}


void
xfs_fs_cmn_err(
	const char		*lvl,
	struct xfs_mount	*mp,
	const char		*fmt,
	...)
{
	struct va_format	vaf;
	va_list			args;

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

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

	BUG_ON(strncmp(lvl, KERN_EMERG, strlen(KERN_EMERG)) == 0);
}

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
@@ -31,8 +31,6 @@ struct xfs_mount;


void cmn_err(const char *lvl, const char *fmt, ...)
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,
		const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));


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


Loading