mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-27 11:29:36 +03:00
Replace /*PRINTFLIKEn*/ with attribute(printf)
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Issue #12201
This commit is contained in:
parent
1373709450
commit
5dbf6c5a66
@ -128,7 +128,7 @@ void free_vdev_cmd_data_list(vdev_cmd_data_list_t *vcdl);
|
|||||||
int check_device(const char *path, boolean_t force,
|
int check_device(const char *path, boolean_t force,
|
||||||
boolean_t isspare, boolean_t iswholedisk);
|
boolean_t isspare, boolean_t iswholedisk);
|
||||||
boolean_t check_sector_size_database(char *path, int *sector_size);
|
boolean_t check_sector_size_database(char *path, int *sector_size);
|
||||||
void vdev_error(const char *fmt, ...);
|
void vdev_error(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
|
||||||
int check_file(const char *file, boolean_t force, boolean_t isspare);
|
int check_file(const char *file, boolean_t force, boolean_t isspare);
|
||||||
void after_zpool_upgrade(zpool_handle_t *zhp);
|
void after_zpool_upgrade(zpool_handle_t *zhp);
|
||||||
|
|
||||||
|
@ -86,7 +86,6 @@
|
|||||||
boolean_t error_seen;
|
boolean_t error_seen;
|
||||||
boolean_t is_force;
|
boolean_t is_force;
|
||||||
|
|
||||||
/*PRINTFLIKE1*/
|
|
||||||
void
|
void
|
||||||
vdev_error(const char *fmt, ...)
|
vdev_error(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
@ -704,8 +703,11 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
|
|||||||
"are present\n"),
|
"are present\n"),
|
||||||
raidz->zprl_type,
|
raidz->zprl_type,
|
||||||
mirror->zprl_type,
|
mirror->zprl_type,
|
||||||
|
(u_longlong_t)
|
||||||
raidz->zprl_parity,
|
raidz->zprl_parity,
|
||||||
|
(u_longlong_t)
|
||||||
mirror->zprl_children - 1,
|
mirror->zprl_children - 1,
|
||||||
|
(u_longlong_t)
|
||||||
mirror->zprl_children);
|
mirror->zprl_children);
|
||||||
else
|
else
|
||||||
return (NULL);
|
return (NULL);
|
||||||
@ -728,7 +730,9 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
|
|||||||
"%llu are present\n"),
|
"%llu are present\n"),
|
||||||
lastrep.zprl_type,
|
lastrep.zprl_type,
|
||||||
rep.zprl_type,
|
rep.zprl_type,
|
||||||
|
(u_longlong_t)
|
||||||
lastrep.zprl_parity,
|
lastrep.zprl_parity,
|
||||||
|
(u_longlong_t)
|
||||||
rep.zprl_parity);
|
rep.zprl_parity);
|
||||||
else
|
else
|
||||||
return (NULL);
|
return (NULL);
|
||||||
@ -755,8 +759,9 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
|
|||||||
"mismatched replication level: "
|
"mismatched replication level: "
|
||||||
"both %llu and %llu device parity "
|
"both %llu and %llu device parity "
|
||||||
"%s vdevs are present\n"),
|
"%s vdevs are present\n"),
|
||||||
|
(u_longlong_t)
|
||||||
lastrep.zprl_parity,
|
lastrep.zprl_parity,
|
||||||
rep.zprl_parity,
|
(u_longlong_t)rep.zprl_parity,
|
||||||
rep.zprl_type);
|
rep.zprl_type);
|
||||||
else
|
else
|
||||||
return (NULL);
|
return (NULL);
|
||||||
@ -769,7 +774,9 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
|
|||||||
"mismatched replication level: "
|
"mismatched replication level: "
|
||||||
"both %llu-way and %llu-way %s "
|
"both %llu-way and %llu-way %s "
|
||||||
"vdevs are present\n"),
|
"vdevs are present\n"),
|
||||||
|
(u_longlong_t)
|
||||||
lastrep.zprl_children,
|
lastrep.zprl_children,
|
||||||
|
(u_longlong_t)
|
||||||
rep.zprl_children,
|
rep.zprl_children,
|
||||||
rep.zprl_type);
|
rep.zprl_type);
|
||||||
else
|
else
|
||||||
@ -854,9 +861,9 @@ check_replication(nvlist_t *config, nvlist_t *newroot)
|
|||||||
"and %s vdevs, %llu vs. %llu (%llu-way)\n"),
|
"and %s vdevs, %llu vs. %llu (%llu-way)\n"),
|
||||||
raidz->zprl_type,
|
raidz->zprl_type,
|
||||||
mirror->zprl_type,
|
mirror->zprl_type,
|
||||||
raidz->zprl_parity,
|
(u_longlong_t)raidz->zprl_parity,
|
||||||
mirror->zprl_children - 1,
|
(u_longlong_t)mirror->zprl_children - 1,
|
||||||
mirror->zprl_children);
|
(u_longlong_t)mirror->zprl_children);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
} else if (strcmp(current->zprl_type, new->zprl_type) != 0) {
|
} else if (strcmp(current->zprl_type, new->zprl_type) != 0) {
|
||||||
@ -869,14 +876,17 @@ check_replication(nvlist_t *config, nvlist_t *newroot)
|
|||||||
vdev_error(gettext(
|
vdev_error(gettext(
|
||||||
"mismatched replication level: pool uses %llu "
|
"mismatched replication level: pool uses %llu "
|
||||||
"device parity and new vdev uses %llu\n"),
|
"device parity and new vdev uses %llu\n"),
|
||||||
current->zprl_parity, new->zprl_parity);
|
(u_longlong_t)current->zprl_parity,
|
||||||
|
(u_longlong_t)new->zprl_parity);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
} else if (current->zprl_children != new->zprl_children) {
|
} else if (current->zprl_children != new->zprl_children) {
|
||||||
vdev_error(gettext(
|
vdev_error(gettext(
|
||||||
"mismatched replication level: pool uses %llu-way "
|
"mismatched replication level: pool uses %llu-way "
|
||||||
"%s and new vdev uses %llu-way %s\n"),
|
"%s and new vdev uses %llu-way %s\n"),
|
||||||
current->zprl_children, current->zprl_type,
|
(u_longlong_t)current->zprl_children,
|
||||||
new->zprl_children, new->zprl_type);
|
current->zprl_type,
|
||||||
|
(u_longlong_t)new->zprl_children,
|
||||||
|
new->zprl_type);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,15 +81,18 @@ const char *uu_strerror(uint32_t);
|
|||||||
extern void uu_alt_exit(int);
|
extern void uu_alt_exit(int);
|
||||||
extern const char *uu_setpname(char *);
|
extern const char *uu_setpname(char *);
|
||||||
extern const char *uu_getpname(void);
|
extern const char *uu_getpname(void);
|
||||||
/*PRINTFLIKE1*/
|
extern void uu_warn(const char *, ...)
|
||||||
extern void uu_warn(const char *, ...);
|
__attribute__((format(printf, 1, 2)));
|
||||||
extern void uu_vwarn(const char *, va_list);
|
extern void uu_vwarn(const char *, va_list)
|
||||||
/*PRINTFLIKE1*/
|
__attribute__((format(printf, 1, 0)));
|
||||||
extern void uu_die(const char *, ...) __NORETURN;
|
extern void uu_die(const char *, ...)
|
||||||
extern void uu_vdie(const char *, va_list) __NORETURN;
|
__attribute__((format(printf, 1, 2))) __NORETURN;
|
||||||
/*PRINTFLIKE2*/
|
extern void uu_vdie(const char *, va_list)
|
||||||
extern void uu_xdie(int, const char *, ...) __NORETURN;
|
__attribute__((format(printf, 1, 0))) __NORETURN;
|
||||||
extern void uu_vxdie(int, const char *, va_list) __NORETURN;
|
extern void uu_xdie(int, const char *, ...)
|
||||||
|
__attribute__((format(printf, 2, 3))) __NORETURN;
|
||||||
|
extern void uu_vxdie(int, const char *, va_list)
|
||||||
|
__attribute__((format(printf, 2, 0))) __NORETURN;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exit status functions (not to be used directly)
|
* Exit status functions (not to be used directly)
|
||||||
@ -111,8 +114,8 @@ int uu_check_name(const char *, uint_t);
|
|||||||
*/
|
*/
|
||||||
#define UU_NELEM(a) (sizeof (a) / sizeof ((a)[0]))
|
#define UU_NELEM(a) (sizeof (a) / sizeof ((a)[0]))
|
||||||
|
|
||||||
/*PRINTFLIKE1*/
|
extern char *uu_msprintf(const char *format, ...)
|
||||||
extern char *uu_msprintf(const char *format, ...);
|
__attribute__((format(printf, 1, 2)));
|
||||||
extern void *uu_zalloc(size_t);
|
extern void *uu_zalloc(size_t);
|
||||||
extern char *uu_strdup(const char *);
|
extern char *uu_strdup(const char *);
|
||||||
extern void uu_free(void *);
|
extern void uu_free(void *);
|
||||||
|
@ -42,8 +42,7 @@ extern "C" {
|
|||||||
void uu_set_error(uint_t);
|
void uu_set_error(uint_t);
|
||||||
|
|
||||||
|
|
||||||
/*PRINTFLIKE1*/
|
void uu_panic(const char *format, ...) __attribute__((format(printf, 1, 2)));
|
||||||
void uu_panic(const char *format, ...);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -36,91 +36,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* Allow for version tests for compiler bugs and features.
|
|
||||||
*/
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
#define __GNUC_VERSION \
|
|
||||||
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
|
|
||||||
#else
|
|
||||||
#define __GNUC_VERSION 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__ATTRIBUTE_IMPLEMENTED) || defined(__GNUC__)
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/*
|
|
||||||
* analogous to lint's PRINTFLIKEn
|
|
||||||
*/
|
|
||||||
#define __sun_attr___PRINTFLIKE__(__n) \
|
|
||||||
__attribute__((__format__(printf, __n, (__n)+1)))
|
|
||||||
#define __sun_attr___VPRINTFLIKE__(__n) \
|
|
||||||
__attribute__((__format__(printf, __n, 0)))
|
|
||||||
|
|
||||||
#define __sun_attr___KPRINTFLIKE__ __sun_attr___PRINTFLIKE__
|
|
||||||
#define __sun_attr___KVPRINTFLIKE__ __sun_attr___VPRINTFLIKE__
|
|
||||||
#else
|
|
||||||
/*
|
|
||||||
* Currently the openzfs codebase has a lot of formatting errors
|
|
||||||
* which are not picked up in the linux build because they're not
|
|
||||||
* doing formatting checks. LLVM's kprintf implementation doesn't
|
|
||||||
* actually do format checks!
|
|
||||||
*
|
|
||||||
* For FreeBSD these break under gcc! LLVM shim'ed cmn_err as a
|
|
||||||
* format attribute but also didn't check anything. If one
|
|
||||||
* replaces it with the above, all of the format issues
|
|
||||||
* in the codebase show up.
|
|
||||||
*
|
|
||||||
* Once those format string issues are addressed, the above
|
|
||||||
* should be flipped on once again.
|
|
||||||
*/
|
|
||||||
#define __sun_attr___PRINTFLIKE__(__n)
|
|
||||||
#define __sun_attr___VPRINTFLIKE__(__n)
|
|
||||||
#define __sun_attr___KPRINTFLIKE__(__n)
|
|
||||||
#define __sun_attr___KVPRINTFLIKE__(__n)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This one's pretty obvious -- the function never returns
|
|
||||||
*/
|
|
||||||
#define __sun_attr___noreturn__ __attribute__((__noreturn__))
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This is an appropriate label for functions that do not
|
|
||||||
* modify their arguments, e.g. strlen()
|
|
||||||
*/
|
|
||||||
#define __sun_attr___pure__ __attribute__((__pure__))
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This is a stronger form of __pure__. Can be used for functions
|
|
||||||
* that do not modify their arguments and don't depend on global
|
|
||||||
* memory.
|
|
||||||
*/
|
|
||||||
#define __sun_attr___const__ __attribute__((__const__))
|
|
||||||
|
|
||||||
/*
|
|
||||||
* structure packing like #pragma pack(1)
|
|
||||||
*/
|
|
||||||
#define __sun_attr___packed__ __attribute__((__packed__))
|
|
||||||
|
|
||||||
#define ___sun_attr_inner(__a) __sun_attr_##__a
|
|
||||||
#define __sun_attr__(__a) ___sun_attr_inner __a
|
|
||||||
|
|
||||||
#else /* __ATTRIBUTE_IMPLEMENTED || __GNUC__ */
|
|
||||||
|
|
||||||
#define __sun_attr__(__a)
|
|
||||||
|
|
||||||
#endif /* __ATTRIBUTE_IMPLEMENTED || __GNUC__ */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Shorthand versions for readability
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define __PRINTFLIKE(__n) __sun_attr__((__PRINTFLIKE__(__n)))
|
|
||||||
#define __VPRINTFLIKE(__n) __sun_attr__((__VPRINTFLIKE__(__n)))
|
|
||||||
#define __KPRINTFLIKE(__n) __sun_attr__((__KPRINTFLIKE__(__n)))
|
|
||||||
#define __KVPRINTFLIKE(__n) __sun_attr__((__KVPRINTFLIKE__(__n)))
|
|
||||||
#if defined(_KERNEL) || defined(_STANDALONE)
|
#if defined(_KERNEL) || defined(_STANDALONE)
|
||||||
#define __NORETURN __sun_attr__((__noreturn__))
|
#define __NORETURN __sun_attr__((__noreturn__))
|
||||||
#endif /* _KERNEL || _STANDALONE */
|
#endif /* _KERNEL || _STANDALONE */
|
||||||
|
@ -49,36 +49,29 @@ extern "C" {
|
|||||||
|
|
||||||
#ifndef _ASM
|
#ifndef _ASM
|
||||||
|
|
||||||
/*PRINTFLIKE2*/
|
|
||||||
extern void cmn_err(int, const char *, ...)
|
extern void cmn_err(int, const char *, ...)
|
||||||
__KPRINTFLIKE(2);
|
__attribute__((format(printf, 2, 3)));
|
||||||
|
|
||||||
extern void vzcmn_err(zoneid_t, int, const char *, __va_list)
|
extern void vzcmn_err(zoneid_t, int, const char *, __va_list)
|
||||||
__KVPRINTFLIKE(3);
|
__attribute__((format(printf, 3, 0)));
|
||||||
|
|
||||||
extern void vcmn_err(int, const char *, __va_list)
|
extern void vcmn_err(int, const char *, __va_list)
|
||||||
__KVPRINTFLIKE(2);
|
__attribute__((format(printf, 2, 0)));
|
||||||
|
|
||||||
/*PRINTFLIKE3*/
|
|
||||||
extern void zcmn_err(zoneid_t, int, const char *, ...)
|
extern void zcmn_err(zoneid_t, int, const char *, ...)
|
||||||
__KPRINTFLIKE(3);
|
__attribute__((format(printf, 3, 4)));
|
||||||
|
|
||||||
extern void vzprintf(zoneid_t, const char *, __va_list)
|
extern void vzprintf(zoneid_t, const char *, __va_list)
|
||||||
__KVPRINTFLIKE(2);
|
__attribute__((format(printf, 2, 0)));
|
||||||
|
|
||||||
/*PRINTFLIKE2*/
|
|
||||||
extern void zprintf(zoneid_t, const char *, ...)
|
extern void zprintf(zoneid_t, const char *, ...)
|
||||||
__KPRINTFLIKE(2);
|
__attribute__((format(printf, 2, 3)));
|
||||||
|
|
||||||
extern void vuprintf(const char *, __va_list)
|
extern void vuprintf(const char *, __va_list)
|
||||||
__KVPRINTFLIKE(1);
|
__attribute__((format(printf, 1, 0)));
|
||||||
|
|
||||||
/*PRINTFLIKE1*/
|
|
||||||
extern void panic(const char *, ...)
|
extern void panic(const char *, ...)
|
||||||
__KPRINTFLIKE(1) __NORETURN;
|
__attribute__((format(printf, 1, 2))) __NORETURN;
|
||||||
|
|
||||||
extern void vpanic(const char *, __va_list)
|
|
||||||
__KVPRINTFLIKE(1) __NORETURN;
|
|
||||||
|
|
||||||
#endif /* !_ASM */
|
#endif /* !_ASM */
|
||||||
|
|
||||||
|
@ -32,9 +32,12 @@
|
|||||||
#define CE_PANIC 3 /* panic */
|
#define CE_PANIC 3 /* panic */
|
||||||
#define CE_IGNORE 4 /* print nothing */
|
#define CE_IGNORE 4 /* print nothing */
|
||||||
|
|
||||||
extern void cmn_err(int, const char *, ...);
|
extern void cmn_err(int, const char *, ...)
|
||||||
extern void vcmn_err(int, const char *, va_list);
|
__attribute__((format(printf, 2, 3)));
|
||||||
extern void vpanic(const char *, va_list);
|
extern void vcmn_err(int, const char *, va_list)
|
||||||
|
__attribute__((format(printf, 2, 0)));
|
||||||
|
extern void vpanic(const char *, va_list)
|
||||||
|
__attribute__((format(printf, 1, 0)));
|
||||||
|
|
||||||
#define fm_panic panic
|
#define fm_panic panic
|
||||||
|
|
||||||
|
@ -1056,8 +1056,10 @@ extern uint64_t spa_dirty_data(spa_t *spa);
|
|||||||
extern spa_autotrim_t spa_get_autotrim(spa_t *spa);
|
extern spa_autotrim_t spa_get_autotrim(spa_t *spa);
|
||||||
|
|
||||||
/* Miscellaneous support routines */
|
/* Miscellaneous support routines */
|
||||||
extern void spa_load_failed(spa_t *spa, const char *fmt, ...);
|
extern void spa_load_failed(spa_t *spa, const char *fmt, ...)
|
||||||
extern void spa_load_note(spa_t *spa, const char *fmt, ...);
|
__attribute__((format(printf, 2, 3)));
|
||||||
|
extern void spa_load_note(spa_t *spa, const char *fmt, ...)
|
||||||
|
__attribute__((format(printf, 2, 3)));
|
||||||
extern void spa_activate_mos_feature(spa_t *spa, const char *feature,
|
extern void spa_activate_mos_feature(spa_t *spa, const char *feature,
|
||||||
dmu_tx_t *tx);
|
dmu_tx_t *tx);
|
||||||
extern void spa_deactivate_mos_feature(spa_t *spa, const char *feature);
|
extern void spa_deactivate_mos_feature(spa_t *spa, const char *feature);
|
||||||
|
@ -52,7 +52,8 @@ extern int zfs_nocacheflush;
|
|||||||
|
|
||||||
typedef boolean_t vdev_open_children_func_t(vdev_t *vd);
|
typedef boolean_t vdev_open_children_func_t(vdev_t *vd);
|
||||||
|
|
||||||
extern void vdev_dbgmsg(vdev_t *vd, const char *fmt, ...);
|
extern void vdev_dbgmsg(vdev_t *vd, const char *fmt, ...)
|
||||||
|
__attribute__((format(printf, 2, 3)));
|
||||||
extern void vdev_dbgmsg_print_tree(vdev_t *, int);
|
extern void vdev_dbgmsg_print_tree(vdev_t *, int);
|
||||||
extern int vdev_open(vdev_t *);
|
extern int vdev_open(vdev_t *);
|
||||||
extern void vdev_open_children(vdev_t *);
|
extern void vdev_open_children(vdev_t *);
|
||||||
|
@ -38,9 +38,6 @@
|
|||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
static const char PNAME_FMT[] = "%s: ";
|
|
||||||
static const char ERRNO_FMT[] = ": %s\n";
|
|
||||||
|
|
||||||
static const char *pname;
|
static const char *pname;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -85,16 +82,16 @@ uu_alt_exit(int profile)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static __attribute__((format(printf, 2, 0))) void
|
||||||
uu_warn_internal(int err, const char *format, va_list alist)
|
uu_warn_internal(int err, const char *format, va_list alist)
|
||||||
{
|
{
|
||||||
if (pname != NULL)
|
if (pname != NULL)
|
||||||
(void) fprintf(stderr, PNAME_FMT, pname);
|
(void) fprintf(stderr, "%s: ", pname);
|
||||||
|
|
||||||
(void) vfprintf(stderr, format, alist);
|
(void) vfprintf(stderr, format, alist);
|
||||||
|
|
||||||
if (strrchr(format, '\n') == NULL)
|
if (strrchr(format, '\n') == NULL)
|
||||||
(void) fprintf(stderr, ERRNO_FMT, strerror(err));
|
(void) fprintf(stderr, ": %s\n", strerror(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -103,7 +100,6 @@ uu_vwarn(const char *format, va_list alist)
|
|||||||
uu_warn_internal(errno, format, alist);
|
uu_warn_internal(errno, format, alist);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PRINTFLIKE1*/
|
|
||||||
void
|
void
|
||||||
uu_warn(const char *format, ...)
|
uu_warn(const char *format, ...)
|
||||||
{
|
{
|
||||||
@ -113,7 +109,7 @@ uu_warn(const char *format, ...)
|
|||||||
va_end(alist);
|
va_end(alist);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static __attribute__((format(printf, 2, 0))) __NORETURN void
|
||||||
uu_die_internal(int status, const char *format, va_list alist)
|
uu_die_internal(int status, const char *format, va_list alist)
|
||||||
{
|
{
|
||||||
uu_warn_internal(errno, format, alist);
|
uu_warn_internal(errno, format, alist);
|
||||||
@ -137,7 +133,6 @@ uu_vdie(const char *format, va_list alist)
|
|||||||
uu_die_internal(UU_EXIT_FATAL, format, alist);
|
uu_die_internal(UU_EXIT_FATAL, format, alist);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PRINTFLIKE1*/
|
|
||||||
void
|
void
|
||||||
uu_die(const char *format, ...)
|
uu_die(const char *format, ...)
|
||||||
{
|
{
|
||||||
@ -153,7 +148,6 @@ uu_vxdie(int status, const char *format, va_list alist)
|
|||||||
uu_die_internal(status, format, alist);
|
uu_die_internal(status, format, alist);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PRINTFLIKE2*/
|
|
||||||
void
|
void
|
||||||
uu_xdie(int status, const char *format, ...)
|
uu_xdie(int status, const char *format, ...)
|
||||||
{
|
{
|
||||||
|
@ -304,7 +304,6 @@ libzfs_error_description(libzfs_handle_t *hdl)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PRINTFLIKE2*/
|
|
||||||
void
|
void
|
||||||
zfs_error_aux(libzfs_handle_t *hdl, const char *fmt, ...)
|
zfs_error_aux(libzfs_handle_t *hdl, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
@ -352,7 +351,6 @@ zfs_error(libzfs_handle_t *hdl, int error, const char *msg)
|
|||||||
return (zfs_error_fmt(hdl, error, "%s", msg));
|
return (zfs_error_fmt(hdl, error, "%s", msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PRINTFLIKE3*/
|
|
||||||
int
|
int
|
||||||
zfs_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
|
zfs_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
@ -403,7 +401,6 @@ zfs_standard_error(libzfs_handle_t *hdl, int error, const char *msg)
|
|||||||
return (zfs_standard_error_fmt(hdl, error, "%s", msg));
|
return (zfs_standard_error_fmt(hdl, error, "%s", msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PRINTFLIKE3*/
|
|
||||||
int
|
int
|
||||||
zfs_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
|
zfs_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
@ -613,7 +610,6 @@ zpool_standard_error(libzfs_handle_t *hdl, int error, const char *msg)
|
|||||||
return (zpool_standard_error_fmt(hdl, error, "%s", msg));
|
return (zpool_standard_error_fmt(hdl, error, "%s", msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PRINTFLIKE3*/
|
|
||||||
int
|
int
|
||||||
zpool_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
|
zpool_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
@ -771,7 +767,6 @@ zfs_alloc(libzfs_handle_t *hdl, size_t size)
|
|||||||
/*
|
/*
|
||||||
* A safe form of asprintf() which will die if the allocation fails.
|
* A safe form of asprintf() which will die if the allocation fails.
|
||||||
*/
|
*/
|
||||||
/*PRINTFLIKE2*/
|
|
||||||
char *
|
char *
|
||||||
zfs_asprintf(libzfs_handle_t *hdl, const char *fmt, ...)
|
zfs_asprintf(libzfs_handle_t *hdl, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
@ -634,7 +634,6 @@ vcmn_err(int ce, const char *fmt, va_list adx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PRINTFLIKE2*/
|
|
||||||
void
|
void
|
||||||
cmn_err(int ce, const char *fmt, ...)
|
cmn_err(int ce, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
@ -69,8 +69,7 @@
|
|||||||
|
|
||||||
#include "zutil_import.h"
|
#include "zutil_import.h"
|
||||||
|
|
||||||
/*PRINTFLIKE2*/
|
static __attribute__((format(printf, 2, 3))) void
|
||||||
static void
|
|
||||||
zutil_error_aux(libpc_handle_t *hdl, const char *fmt, ...)
|
zutil_error_aux(libpc_handle_t *hdl, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
@ -104,8 +103,7 @@ zutil_verror(libpc_handle_t *hdl, const char *error, const char *fmt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PRINTFLIKE3*/
|
static __attribute__((format(printf, 3, 4))) int
|
||||||
static int
|
|
||||||
zutil_error_fmt(libpc_handle_t *hdl, const char *error, const char *fmt, ...)
|
zutil_error_fmt(libpc_handle_t *hdl, const char *error, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
@ -1237,7 +1235,7 @@ zpool_find_import_scan_dir(libpc_handle_t *hdl, pthread_mutex_t *lock,
|
|||||||
if (error == ENOENT)
|
if (error == ENOENT)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
zutil_error_aux(hdl, strerror(error));
|
zutil_error_aux(hdl, "%s", strerror(error));
|
||||||
(void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext(
|
(void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext(
|
||||||
TEXT_DOMAIN, "cannot resolve path '%s'"), dir);
|
TEXT_DOMAIN, "cannot resolve path '%s'"), dir);
|
||||||
return (error);
|
return (error);
|
||||||
@ -1246,7 +1244,7 @@ zpool_find_import_scan_dir(libpc_handle_t *hdl, pthread_mutex_t *lock,
|
|||||||
dirp = opendir(path);
|
dirp = opendir(path);
|
||||||
if (dirp == NULL) {
|
if (dirp == NULL) {
|
||||||
error = errno;
|
error = errno;
|
||||||
zutil_error_aux(hdl, strerror(error));
|
zutil_error_aux(hdl, "%s", strerror(error));
|
||||||
(void) zutil_error_fmt(hdl, EZFS_BADPATH,
|
(void) zutil_error_fmt(hdl, EZFS_BADPATH,
|
||||||
dgettext(TEXT_DOMAIN, "cannot open '%s'"), path);
|
dgettext(TEXT_DOMAIN, "cannot open '%s'"), path);
|
||||||
return (error);
|
return (error);
|
||||||
@ -1308,7 +1306,7 @@ zpool_find_import_scan_path(libpc_handle_t *hdl, pthread_mutex_t *lock,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
zutil_error_aux(hdl, strerror(error));
|
zutil_error_aux(hdl, "%s", strerror(error));
|
||||||
(void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext(
|
(void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext(
|
||||||
TEXT_DOMAIN, "cannot resolve path '%s'"), dir);
|
TEXT_DOMAIN, "cannot resolve path '%s'"), dir);
|
||||||
goto out;
|
goto out;
|
||||||
@ -1346,7 +1344,7 @@ zpool_find_import_scan(libpc_handle_t *hdl, pthread_mutex_t *lock,
|
|||||||
if (error == ENOENT)
|
if (error == ENOENT)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
zutil_error_aux(hdl, strerror(error));
|
zutil_error_aux(hdl, "%s", strerror(error));
|
||||||
(void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext(
|
(void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext(
|
||||||
TEXT_DOMAIN, "cannot resolve path '%s'"), dir[i]);
|
TEXT_DOMAIN, "cannot resolve path '%s'"), dir[i]);
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -546,7 +546,9 @@ __vdev_disk_physio(struct block_device *bdev, zio_t *zio,
|
|||||||
if (io_offset + io_size > bdev->bd_inode->i_size) {
|
if (io_offset + io_size > bdev->bd_inode->i_size) {
|
||||||
vdev_dbgmsg(zio->io_vd,
|
vdev_dbgmsg(zio->io_vd,
|
||||||
"Illegal access %llu size %llu, device size %llu",
|
"Illegal access %llu size %llu, device size %llu",
|
||||||
io_offset, io_size, i_size_read(bdev->bd_inode));
|
(u_longlong_t)io_offset,
|
||||||
|
(u_longlong_t)io_size,
|
||||||
|
(u_longlong_t)i_size_read(bdev->bd_inode));
|
||||||
return (SET_ERROR(EIO));
|
return (SET_ERROR(EIO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7470,7 +7470,7 @@ arc_state_multilist_index_func(multilist_t *ml, void *obj)
|
|||||||
if ((do_warn) && (tuning) && ((tuning) != (value))) { \
|
if ((do_warn) && (tuning) && ((tuning) != (value))) { \
|
||||||
cmn_err(CE_WARN, \
|
cmn_err(CE_WARN, \
|
||||||
"ignoring tunable %s (using %llu instead)", \
|
"ignoring tunable %s (using %llu instead)", \
|
||||||
(#tuning), (value)); \
|
(#tuning), (u_longlong_t)(value)); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
@ -1033,8 +1033,8 @@ spa_ld_log_sm_metadata(spa_t *spa)
|
|||||||
if (sls == NULL) {
|
if (sls == NULL) {
|
||||||
spa_load_failed(spa, "spa_ld_log_sm_metadata(): bug "
|
spa_load_failed(spa, "spa_ld_log_sm_metadata(): bug "
|
||||||
"encountered: could not find log spacemap for "
|
"encountered: could not find log spacemap for "
|
||||||
"TXG %ld [error %d]",
|
"TXG %llu [error %d]",
|
||||||
metaslab_unflushed_txg(m), ENOENT);
|
(u_longlong_t)metaslab_unflushed_txg(m), ENOENT);
|
||||||
return (ENOENT);
|
return (ENOENT);
|
||||||
}
|
}
|
||||||
sls->sls_mscount++;
|
sls->sls_mscount++;
|
||||||
|
@ -389,7 +389,6 @@ uint64_t spa_max_slop = 128ULL * 1024 * 1024 * 1024;
|
|||||||
int spa_allocators = 4;
|
int spa_allocators = 4;
|
||||||
|
|
||||||
|
|
||||||
/*PRINTFLIKE2*/
|
|
||||||
void
|
void
|
||||||
spa_load_failed(spa_t *spa, const char *fmt, ...)
|
spa_load_failed(spa_t *spa, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
@ -404,7 +403,6 @@ spa_load_failed(spa_t *spa, const char *fmt, ...)
|
|||||||
spa->spa_trust_config ? "trusted" : "untrusted", buf);
|
spa->spa_trust_config ? "trusted" : "untrusted", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PRINTFLIKE2*/
|
|
||||||
void
|
void
|
||||||
spa_load_note(spa_t *spa, const char *fmt, ...)
|
spa_load_note(spa_t *spa, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
@ -137,7 +137,6 @@ int zfs_nocacheflush = 0;
|
|||||||
uint64_t zfs_vdev_max_auto_ashift = ASHIFT_MAX;
|
uint64_t zfs_vdev_max_auto_ashift = ASHIFT_MAX;
|
||||||
uint64_t zfs_vdev_min_auto_ashift = ASHIFT_MIN;
|
uint64_t zfs_vdev_min_auto_ashift = ASHIFT_MIN;
|
||||||
|
|
||||||
/*PRINTFLIKE2*/
|
|
||||||
void
|
void
|
||||||
vdev_dbgmsg(vdev_t *vd, const char *fmt, ...)
|
vdev_dbgmsg(vdev_t *vd, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
@ -3457,7 +3456,8 @@ vdev_load(vdev_t *vd)
|
|||||||
vdev_set_state(vd, B_FALSE, VDEV_STATE_CANT_OPEN,
|
vdev_set_state(vd, B_FALSE, VDEV_STATE_CANT_OPEN,
|
||||||
VDEV_AUX_CORRUPT_DATA);
|
VDEV_AUX_CORRUPT_DATA);
|
||||||
vdev_dbgmsg(vd, "vdev_load: zap_lookup(top_zap=%llu) "
|
vdev_dbgmsg(vd, "vdev_load: zap_lookup(top_zap=%llu) "
|
||||||
"failed [error=%d]", vd->vdev_top_zap, error);
|
"failed [error=%d]",
|
||||||
|
(u_longlong_t)vd->vdev_top_zap, error);
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -165,8 +165,8 @@ vdev_raidz_math_generate(raidz_map_t *rm, raidz_row_t *rr)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
gen_parity = NULL;
|
gen_parity = NULL;
|
||||||
cmn_err(CE_PANIC, "invalid RAID-Z configuration %d",
|
cmn_err(CE_PANIC, "invalid RAID-Z configuration %llu",
|
||||||
raidz_parity(rm));
|
(u_longlong_t)raidz_parity(rm));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -257,8 +257,8 @@ vdev_raidz_math_reconstruct(raidz_map_t *rm, raidz_row_t *rr,
|
|||||||
rec_fn = reconstruct_fun_pqr_sel(rm, parity_valid, nbaddata);
|
rec_fn = reconstruct_fun_pqr_sel(rm, parity_valid, nbaddata);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cmn_err(CE_PANIC, "invalid RAID-Z configuration %d",
|
cmn_err(CE_PANIC, "invalid RAID-Z configuration %llu",
|
||||||
raidz_parity(rm));
|
(u_longlong_t)raidz_parity(rm));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user