mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Tidy
This commit is contained in:
parent
61e9603be5
commit
70d6838fb0
@ -68,7 +68,8 @@ struct list *find_snapshots(struct logical_volume *lv)
|
||||
{
|
||||
struct list *slh;
|
||||
struct list *snaplist;
|
||||
struct snapshot_list *sl, *newsl;
|
||||
struct snapshot *s;
|
||||
struct snapshot_list *newsl;
|
||||
struct pool *mem = lv->vg->cmd->mem;
|
||||
|
||||
if (!(snaplist = pool_alloc(mem, sizeof(*snaplist)))) {
|
||||
@ -79,15 +80,15 @@ struct list *find_snapshots(struct logical_volume *lv)
|
||||
list_init(snaplist);
|
||||
|
||||
list_iterate(slh, &lv->vg->snapshots) {
|
||||
sl = list_item(slh, struct snapshot_list);
|
||||
if (!(sl->snapshot->origin == lv))
|
||||
s = list_item(slh, struct snapshot_list)->snapshot;
|
||||
if (!(s->origin == lv))
|
||||
continue;
|
||||
if (!(newsl = pool_alloc(mem, sizeof(*newsl)))) {
|
||||
log_error("snapshot_list structure allocation failed");
|
||||
pool_free(mem, snaplist);
|
||||
return NULL;
|
||||
}
|
||||
newsl->snapshot = sl->snapshot;
|
||||
newsl->snapshot = s;
|
||||
list_add(snaplist, &newsl->list);
|
||||
}
|
||||
|
||||
|
@ -133,8 +133,9 @@ static int _create_dir_recursive(const char *dir)
|
||||
{
|
||||
char *orig, *s;
|
||||
int rc;
|
||||
|
||||
/* create parent directories */
|
||||
|
||||
log_verbose("Creating directory \"%s\"", dir);
|
||||
/* Create parent directories */
|
||||
orig = s = dbg_strdup(dir);
|
||||
while ((s = strchr(s, '/')) != NULL) {
|
||||
*s = '\0';
|
||||
@ -150,8 +151,7 @@ static int _create_dir_recursive(const char *dir)
|
||||
}
|
||||
dbg_free(orig);
|
||||
|
||||
/* done w/ parents, create final directory */
|
||||
log_verbose("Creating directory \"%s\"", dir);
|
||||
/* Create final directory */
|
||||
rc = mkdir(dir, 0777);
|
||||
if (rc < 0 && errno != EEXIST) {
|
||||
log_sys_error("mkdir", dir);
|
||||
|
Loading…
Reference in New Issue
Block a user