mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cov: add some initializers
This commit is contained in:
parent
f5f1cdfa70
commit
63930f576a
@ -1383,7 +1383,7 @@ static void cpg_leave_callback(struct clog_cpg *match,
|
||||
size_t member_list_entries)
|
||||
{
|
||||
unsigned i;
|
||||
int j, fd;
|
||||
int j, fd = -1;
|
||||
uint32_t lowest = match->lowest_id;
|
||||
struct clog_request *rq, *n;
|
||||
struct checkpoint_data *p_cp, *c_cp;
|
||||
|
@ -378,7 +378,7 @@ static int _clog_ctr(char *uuid, uint64_t luid,
|
||||
uint32_t block_on_error = 0;
|
||||
|
||||
int disk_log;
|
||||
char disk_path[PATH_MAX];
|
||||
char disk_path[PATH_MAX] = { 0 };
|
||||
int unlink_path = 0;
|
||||
long page_size;
|
||||
int pages;
|
||||
|
@ -1660,7 +1660,7 @@ int lm_lock_sanlock(struct lockspace *ls, struct resource *r, int ld_mode,
|
||||
struct sanlk_options opt;
|
||||
uint64_t lock_lv_offset;
|
||||
uint32_t flags = 0;
|
||||
struct val_blk vb;
|
||||
struct val_blk vb = { 0 };
|
||||
int added = 0;
|
||||
int rv;
|
||||
|
||||
|
@ -372,7 +372,7 @@ static void debug_print(struct lvmpolld_state *ls, const char * const* ptr)
|
||||
|
||||
static void *fork_and_poll(void *args)
|
||||
{
|
||||
int outfd, errfd, state;
|
||||
int outfd, errfd, state = 0;
|
||||
struct lvmpolld_thread_data *data;
|
||||
pid_t r;
|
||||
|
||||
|
@ -2332,7 +2332,7 @@ static const char *_reserved_name(struct dm_report *rh,
|
||||
uint32_t field_num, const char *s, size_t len)
|
||||
{
|
||||
dm_report_reserved_handler handler;
|
||||
const char *canonical_name;
|
||||
const char *canonical_name = NULL;
|
||||
const char **name;
|
||||
char *tmp_s;
|
||||
char c;
|
||||
@ -3910,7 +3910,7 @@ static struct selection_node *_parse_ex(struct dm_report *rh,
|
||||
static const char _pe_expected_msg[] = "Syntax error: right parenthesis expected at \'%s\'";
|
||||
struct selection_node *sn = NULL;
|
||||
uint32_t t;
|
||||
const char *tmp;
|
||||
const char *tmp = NULL;
|
||||
|
||||
t = _tok_op_log(s, next, SEL_MODIFIER_NOT | SEL_PRECEDENCE_PS);
|
||||
if (t == SEL_MODIFIER_NOT) {
|
||||
@ -3956,7 +3956,7 @@ static struct selection_node *_parse_and_ex(struct dm_report *rh,
|
||||
struct selection_node *and_sn)
|
||||
{
|
||||
struct selection_node *n;
|
||||
const char *tmp;
|
||||
const char *tmp = NULL;
|
||||
|
||||
n = _parse_ex(rh, s, next);
|
||||
if (!n)
|
||||
@ -3988,7 +3988,7 @@ static struct selection_node *_parse_or_ex(struct dm_report *rh,
|
||||
struct selection_node *or_sn)
|
||||
{
|
||||
struct selection_node *n;
|
||||
const char *tmp;
|
||||
const char *tmp = NULL;
|
||||
|
||||
n = _parse_and_ex(rh, s, next, NULL);
|
||||
if (!n)
|
||||
|
@ -836,7 +836,7 @@ static void _collapse_slashes(char *str)
|
||||
static int _insert_dir(const char *dir)
|
||||
{
|
||||
int n, dirent_count, r = 1;
|
||||
struct dirent **dirent;
|
||||
struct dirent **dirent = NULL;
|
||||
char path[PATH_MAX];
|
||||
size_t len;
|
||||
|
||||
|
@ -126,7 +126,7 @@ static struct dm_list *_scan_archive(struct dm_pool *mem,
|
||||
int i, count;
|
||||
uint32_t ix;
|
||||
char vgname_found[64], *path;
|
||||
struct dirent **dirent;
|
||||
struct dirent **dirent = NULL;
|
||||
struct archive_file *af;
|
||||
struct dm_list *results;
|
||||
|
||||
|
@ -893,7 +893,7 @@ static int _setup_bcache(void)
|
||||
static void _prepare_open_file_limit(struct cmd_context *cmd, unsigned int num_devs)
|
||||
{
|
||||
#ifdef HAVE_PRLIMIT
|
||||
struct rlimit old, new;
|
||||
struct rlimit old = { 0 }, new;
|
||||
unsigned int want = num_devs + BASE_FD_COUNT;
|
||||
int rv;
|
||||
|
||||
|
@ -456,6 +456,7 @@ static int _merge_mirror_images(struct logical_volume *lv,
|
||||
return 1;
|
||||
|
||||
img_lvs = alloca(sizeof(*img_lvs) * addition);
|
||||
memset(img_lvs, 0, sizeof(*img_lvs) * addition);
|
||||
|
||||
dm_list_iterate_items(lvl, mimages)
|
||||
img_lvs[i++] = lvl->lv;
|
||||
@ -1531,6 +1532,7 @@ static int _form_mirror(struct cmd_context *cmd, struct alloc_handle *ah,
|
||||
* create mirror image LVs
|
||||
*/
|
||||
img_lvs = alloca(sizeof(*img_lvs) * mirrors);
|
||||
memset(img_lvs, 0, sizeof(*img_lvs) * mirrors);
|
||||
|
||||
if (!_create_mimage_lvs(ah, mirrors, stripes, stripe_size, lv, img_lvs, log))
|
||||
return_0;
|
||||
|
@ -2331,7 +2331,7 @@ static const char *_reserved_name(struct dm_report *rh,
|
||||
uint32_t field_num, const char *s, size_t len)
|
||||
{
|
||||
dm_report_reserved_handler handler;
|
||||
const char *canonical_name;
|
||||
const char *canonical_name = NULL;
|
||||
const char **name;
|
||||
char *tmp_s;
|
||||
char c;
|
||||
@ -3909,7 +3909,7 @@ static struct selection_node *_parse_ex(struct dm_report *rh,
|
||||
static const char _pe_expected_msg[] = "Syntax error: right parenthesis expected at \'%s\'";
|
||||
struct selection_node *sn = NULL;
|
||||
uint32_t t;
|
||||
const char *tmp;
|
||||
const char *tmp = NULL;
|
||||
|
||||
t = _tok_op_log(s, next, SEL_MODIFIER_NOT | SEL_PRECEDENCE_PS);
|
||||
if (t == SEL_MODIFIER_NOT) {
|
||||
@ -3955,7 +3955,7 @@ static struct selection_node *_parse_and_ex(struct dm_report *rh,
|
||||
struct selection_node *and_sn)
|
||||
{
|
||||
struct selection_node *n;
|
||||
const char *tmp;
|
||||
const char *tmp = NULL;
|
||||
|
||||
n = _parse_ex(rh, s, next);
|
||||
if (!n)
|
||||
@ -3987,7 +3987,7 @@ static struct selection_node *_parse_or_ex(struct dm_report *rh,
|
||||
struct selection_node *or_sn)
|
||||
{
|
||||
struct selection_node *n;
|
||||
const char *tmp;
|
||||
const char *tmp = NULL;
|
||||
|
||||
n = _parse_and_ex(rh, s, next, NULL);
|
||||
if (!n)
|
||||
|
@ -4519,7 +4519,7 @@ static int _stats_unmap_regions(struct dm_stats *dms, uint64_t group_id,
|
||||
struct dm_stats_region *region = NULL;
|
||||
struct dm_stats_group *group = NULL;
|
||||
uint64_t nr_kept, nr_old;
|
||||
struct _extent ext;
|
||||
struct _extent ext = { 0 };
|
||||
int64_t i;
|
||||
|
||||
group = &dms->groups[group_id];
|
||||
@ -4607,7 +4607,7 @@ static uint64_t *_stats_map_file_regions(struct dm_stats *dms, int fd,
|
||||
struct dm_pool *extent_mem = NULL;
|
||||
struct _extent *old_ext;
|
||||
char *hist_arg = NULL;
|
||||
struct statfs fsbuf;
|
||||
struct statfs fsbuf = { 0 };
|
||||
int64_t nr_kept = 0;
|
||||
struct stat buf;
|
||||
int update;
|
||||
|
@ -123,7 +123,7 @@ const char *skip_dev_dir(struct cmd_context *cmd, const char *vg_name,
|
||||
size_t devdir_len = strlen(cmd->dev_dir);
|
||||
const char *dmdir = dm_dir() + devdir_len;
|
||||
size_t dmdir_len = strlen(dmdir), vglv_sz;
|
||||
char *vgname, *lvname, *layer, *vglv;
|
||||
char *vgname = NULL, *lvname, *layer, *vglv;
|
||||
|
||||
/* FIXME Do this properly */
|
||||
if (*vg_name == '/')
|
||||
|
Loading…
Reference in New Issue
Block a user