Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
4f08c8d4
Unverified
Commit
4f08c8d4
authored
Dec 11, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: remove unused function
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
be50a0d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
61 deletions
+0
-61
storage_utils.c
src/lxc/storage/storage_utils.c
+0
-59
storage_utils.h
src/lxc/storage/storage_utils.h
+0
-2
No files found.
src/lxc/storage/storage_utils.c
View file @
4f08c8d4
...
...
@@ -61,65 +61,6 @@
lxc_log_define
(
storage_utils
,
lxc
);
/* the bulk of this needs to become a common helper */
char
*
dir_new_path
(
char
*
src
,
const
char
*
oldname
,
const
char
*
name
,
const
char
*
oldpath
,
const
char
*
lxcpath
)
{
char
*
ret
,
*
p
,
*
p2
;
int
l1
,
l2
,
nlen
;
nlen
=
strlen
(
src
)
+
1
;
l1
=
strlen
(
oldpath
);
p
=
src
;
/* if src starts with oldpath, look for oldname only after
* that path */
if
(
strncmp
(
src
,
oldpath
,
l1
)
==
0
)
{
p
+=
l1
;
nlen
+=
(
strlen
(
lxcpath
)
-
l1
);
}
l2
=
strlen
(
oldname
);
while
((
p
=
strstr
(
p
,
oldname
))
!=
NULL
)
{
p
+=
l2
;
nlen
+=
strlen
(
name
)
-
l2
;
}
ret
=
malloc
(
nlen
);
if
(
!
ret
)
return
NULL
;
p
=
ret
;
if
(
strncmp
(
src
,
oldpath
,
l1
)
==
0
)
{
p
+=
sprintf
(
p
,
"%s"
,
lxcpath
);
src
+=
l1
;
}
while
((
p2
=
strstr
(
src
,
oldname
))
!=
NULL
)
{
size_t
retlen
;
/* copy text up to oldname */
retlen
=
strlcpy
(
p
,
src
,
p2
-
src
);
if
(
retlen
>=
p2
-
src
)
{
free
(
ret
);
return
NULL
;
}
/* move target pointer (p) */
p
+=
p2
-
src
;
/* print new name in place of oldname */
p
+=
sprintf
(
p
,
"%s"
,
name
);
/* move src to end of oldname */
src
=
p2
+
l2
;
}
/* copy the rest of src */
sprintf
(
p
,
"%s"
,
src
);
return
ret
;
}
/*
* attach_block_device returns true if all went well,
* meaning either a block device was attached or was not
...
...
src/lxc/storage/storage_utils.h
View file @
4f08c8d4
...
...
@@ -33,8 +33,6 @@
struct
lxc_storage
;
struct
lxc_conf
;
extern
char
*
dir_new_path
(
char
*
src
,
const
char
*
oldname
,
const
char
*
name
,
const
char
*
oldpath
,
const
char
*
lxcpath
);
extern
bool
attach_block_device
(
struct
lxc_conf
*
conf
);
extern
void
detach_block_device
(
struct
lxc_conf
*
conf
);
extern
int
blk_getsize
(
struct
lxc_storage
*
bdev
,
uint64_t
*
size
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment