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
d463a43d
Commit
d463a43d
authored
Mar 31, 2016
by
Yan, Zheng
Committed by
Ilya Dryomov
May 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ceph: CEPH_FEATURE_MDSENC support
Signed-off-by:
Yan, Zheng
<
zyan@redhat.com
>
parent
235a0982
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
12 deletions
+36
-12
fs/ceph/mdsmap.c
fs/ceph/mdsmap.c
+34
-9
fs/ceph/super.c
fs/ceph/super.c
+2
-3
No files found.
fs/ceph/mdsmap.c
View file @
d463a43d
...
...
@@ -54,16 +54,21 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
const
void
*
start
=
*
p
;
int
i
,
j
,
n
;
int
err
=
-
EINVAL
;
u
16
version
;
u
8
mdsmap_v
,
mdsmap_cv
;
m
=
kzalloc
(
sizeof
(
*
m
),
GFP_NOFS
);
if
(
m
==
NULL
)
return
ERR_PTR
(
-
ENOMEM
);
ceph_decode_16_safe
(
p
,
end
,
version
,
bad
);
if
(
version
>
3
)
{
pr_warn
(
"got mdsmap version %d > 3, failing"
,
version
);
goto
bad
;
ceph_decode_need
(
p
,
end
,
1
+
1
,
bad
);
mdsmap_v
=
ceph_decode_8
(
p
);
mdsmap_cv
=
ceph_decode_8
(
p
);
if
(
mdsmap_v
>=
4
)
{
u32
mdsmap_len
;
ceph_decode_32_safe
(
p
,
end
,
mdsmap_len
,
bad
);
if
(
end
<
*
p
+
mdsmap_len
)
goto
bad
;
end
=
*
p
+
mdsmap_len
;
}
ceph_decode_need
(
p
,
end
,
8
*
sizeof
(
u32
)
+
sizeof
(
u64
),
bad
);
...
...
@@ -87,16 +92,29 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
u32
namelen
;
s32
mds
,
inc
,
state
;
u64
state_seq
;
u8
infoversion
;
u8
info_v
;
void
*
info_end
=
NULL
;
struct
ceph_entity_addr
addr
;
u32
num_export_targets
;
void
*
pexport_targets
=
NULL
;
struct
ceph_timespec
laggy_since
;
struct
ceph_mds_info
*
info
;
ceph_decode_need
(
p
,
end
,
sizeof
(
u64
)
*
2
+
1
+
sizeof
(
u32
)
,
bad
);
ceph_decode_need
(
p
,
end
,
sizeof
(
u64
)
+
1
,
bad
);
global_id
=
ceph_decode_64
(
p
);
infoversion
=
ceph_decode_8
(
p
);
info_v
=
ceph_decode_8
(
p
);
if
(
info_v
>=
4
)
{
u32
info_len
;
u8
info_cv
;
ceph_decode_need
(
p
,
end
,
1
+
sizeof
(
u32
),
bad
);
info_cv
=
ceph_decode_8
(
p
);
info_len
=
ceph_decode_32
(
p
);
info_end
=
*
p
+
info_len
;
if
(
info_end
>
end
)
goto
bad
;
}
ceph_decode_need
(
p
,
end
,
sizeof
(
u64
)
+
sizeof
(
u32
),
bad
);
*
p
+=
sizeof
(
u64
);
namelen
=
ceph_decode_32
(
p
);
/* skip mds name */
*
p
+=
namelen
;
...
...
@@ -115,7 +133,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
*
p
+=
sizeof
(
u32
);
ceph_decode_32_safe
(
p
,
end
,
namelen
,
bad
);
*
p
+=
namelen
;
if
(
info
version
>=
2
)
{
if
(
info
_v
>=
2
)
{
ceph_decode_32_safe
(
p
,
end
,
num_export_targets
,
bad
);
pexport_targets
=
*
p
;
*
p
+=
num_export_targets
*
sizeof
(
u32
);
...
...
@@ -123,6 +141,12 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
num_export_targets
=
0
;
}
if
(
info_end
&&
*
p
!=
info_end
)
{
if
(
*
p
>
info_end
)
goto
bad
;
*
p
=
info_end
;
}
dout
(
"mdsmap_decode %d/%d %lld mds%d.%d %s %s
\n
"
,
i
+
1
,
n
,
global_id
,
mds
,
inc
,
ceph_pr_addr
(
&
addr
.
in_addr
),
...
...
@@ -163,6 +187,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
m
->
m_cas_pg_pool
=
ceph_decode_64
(
p
);
/* ok, we don't care about the rest. */
*
p
=
end
;
dout
(
"mdsmap_decode success epoch %u
\n
"
,
m
->
m_epoch
);
return
m
;
...
...
fs/ceph/super.c
View file @
d463a43d
...
...
@@ -519,9 +519,8 @@ static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt,
{
struct
ceph_fs_client
*
fsc
;
const
u64
supported_features
=
CEPH_FEATURE_FLOCK
|
CEPH_FEATURE_DIRLAYOUTHASH
|
CEPH_FEATURE_MDS_INLINE_DATA
;
CEPH_FEATURE_FLOCK
|
CEPH_FEATURE_DIRLAYOUTHASH
|
CEPH_FEATURE_MDSENC
|
CEPH_FEATURE_MDS_INLINE_DATA
;
const
u64
required_features
=
0
;
int
page_count
;
size_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