Re: [PATCH v4 1/3] xfsprogs: allow i18n to xfs printk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 07, 2020 at 10:04:00PM +0800, Gao Xiang wrote:
> From: Gao Xiang <hsiangkao@xxxxxxxxxx>
> 
> In preparation to a common stripe validation helper,
> allow i18n to xfs_{notice,warn,err,alert} so that
> xfsprogs can share code with kernel.
> 
> Suggested-by: Dave Chinner <dchinner@xxxxxxxxxx>
> Signed-off-by: Gao Xiang <hsiangkao@xxxxxxxxxx>
> ---
>  libxfs/libxfs_priv.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
> index 5688284deb4e..545a66dec9b8 100644
> --- a/libxfs/libxfs_priv.h
> +++ b/libxfs/libxfs_priv.h
> @@ -121,10 +121,10 @@ extern char    *progname;
>  extern void cmn_err(int, char *, ...);
>  enum ce { CE_DEBUG, CE_CONT, CE_NOTE, CE_WARN, CE_ALERT, CE_PANIC };
>  
> -#define xfs_notice(mp,fmt,args...)		cmn_err(CE_NOTE,fmt, ## args)
> -#define xfs_warn(mp,fmt,args...)		cmn_err(CE_WARN,fmt, ## args)
> -#define xfs_err(mp,fmt,args...)			cmn_err(CE_ALERT,fmt, ## args)
> -#define xfs_alert(mp,fmt,args...)		cmn_err(CE_ALERT,fmt, ## args)
> +#define xfs_notice(mp,fmt,args...)	cmn_err(CE_NOTE, _(fmt), ## args)
> +#define xfs_warn(mp,fmt,args...)	cmn_err(CE_WARN, _(fmt), ## args)
> +#define xfs_err(mp,fmt,args...)		cmn_err(CE_ALERT, _(fmt), ## args)
> +#define xfs_alert(mp,fmt,args...)	cmn_err(CE_ALERT, _(fmt), ## args)

AFAICT there isn't anything that passes a _() string to
xfs_{alert,notice,warn,err} so this looks ok to me.  It'll be nice to
add the libxfs strings to the message catalogue at last...

Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

--D

>  
>  #define xfs_buf_ioerror_alert(bp,f)	((void) 0);
>  
> -- 
> 2.24.0
> 



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux