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
Kirill Smelkov
linux
Commits
68bf8611
Commit
68bf8611
authored
Oct 23, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
overlayfs: make ovl_cache_entry->name an array instead of pointer
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
3d268c9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
fs/overlayfs/readdir.c
fs/overlayfs/readdir.c
+5
-6
No files found.
fs/overlayfs/readdir.c
View file @
68bf8611
...
...
@@ -18,13 +18,13 @@
#include "overlayfs.h"
struct
ovl_cache_entry
{
const
char
*
name
;
unsigned
int
len
;
unsigned
int
type
;
u64
ino
;
bool
is_whiteout
;
struct
list_head
l_node
;
struct
rb_node
node
;
char
name
[];
};
struct
ovl_dir_cache
{
...
...
@@ -82,13 +82,12 @@ static struct ovl_cache_entry *ovl_cache_entry_new(const char *name, int len,
u64
ino
,
unsigned
int
d_type
)
{
struct
ovl_cache_entry
*
p
;
size_t
size
=
offsetof
(
struct
ovl_cache_entry
,
name
[
len
+
1
]);
p
=
kmalloc
(
size
of
(
*
p
)
+
len
+
1
,
GFP_KERNEL
);
p
=
kmalloc
(
size
,
GFP_KERNEL
);
if
(
p
)
{
char
*
name_copy
=
(
char
*
)
(
p
+
1
);
memcpy
(
name_copy
,
name
,
len
);
name_copy
[
len
]
=
'\0'
;
p
->
name
=
name_copy
;
memcpy
(
p
->
name
,
name
,
len
);
p
->
name
[
len
]
=
'\0'
;
p
->
len
=
len
;
p
->
type
=
d_type
;
p
->
ino
=
ino
;
...
...
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