Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
ca35ffea
Commit
ca35ffea
authored
Jun 05, 2017
by
Ilya Dryomov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libceph: handle non-empty dest in ceph_{oloc,oid}_copy()
Signed-off-by:
Ilya Dryomov
<
idryomov@gmail.com
>
parent
f179d3ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
net/ceph/osdmap.c
net/ceph/osdmap.c
+6
-4
No files found.
net/ceph/osdmap.c
View file @
ca35ffea
...
@@ -1547,12 +1547,13 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
...
@@ -1547,12 +1547,13 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
void
ceph_oloc_copy
(
struct
ceph_object_locator
*
dest
,
void
ceph_oloc_copy
(
struct
ceph_object_locator
*
dest
,
const
struct
ceph_object_locator
*
src
)
const
struct
ceph_object_locator
*
src
)
{
{
WARN_ON
(
!
ceph_oloc_empty
(
dest
));
ceph_oloc_destroy
(
dest
);
WARN_ON
(
dest
->
pool_ns
);
/* empty() only covers ->pool */
dest
->
pool
=
src
->
pool
;
dest
->
pool
=
src
->
pool
;
if
(
src
->
pool_ns
)
if
(
src
->
pool_ns
)
dest
->
pool_ns
=
ceph_get_string
(
src
->
pool_ns
);
dest
->
pool_ns
=
ceph_get_string
(
src
->
pool_ns
);
else
dest
->
pool_ns
=
NULL
;
}
}
EXPORT_SYMBOL
(
ceph_oloc_copy
);
EXPORT_SYMBOL
(
ceph_oloc_copy
);
...
@@ -1565,14 +1566,15 @@ EXPORT_SYMBOL(ceph_oloc_destroy);
...
@@ -1565,14 +1566,15 @@ EXPORT_SYMBOL(ceph_oloc_destroy);
void
ceph_oid_copy
(
struct
ceph_object_id
*
dest
,
void
ceph_oid_copy
(
struct
ceph_object_id
*
dest
,
const
struct
ceph_object_id
*
src
)
const
struct
ceph_object_id
*
src
)
{
{
WARN_ON
(
!
ceph_oid_empty
(
dest
)
);
ceph_oid_destroy
(
dest
);
if
(
src
->
name
!=
src
->
inline_name
)
{
if
(
src
->
name
!=
src
->
inline_name
)
{
/* very rare, see ceph_object_id definition */
/* very rare, see ceph_object_id definition */
dest
->
name
=
kmalloc
(
src
->
name_len
+
1
,
dest
->
name
=
kmalloc
(
src
->
name_len
+
1
,
GFP_NOIO
|
__GFP_NOFAIL
);
GFP_NOIO
|
__GFP_NOFAIL
);
}
else
{
dest
->
name
=
dest
->
inline_name
;
}
}
memcpy
(
dest
->
name
,
src
->
name
,
src
->
name_len
+
1
);
memcpy
(
dest
->
name
,
src
->
name
,
src
->
name_len
+
1
);
dest
->
name_len
=
src
->
name_len
;
dest
->
name_len
=
src
->
name_len
;
}
}
...
...
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