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
04a01ac7
Commit
04a01ac7
authored
Jul 04, 2017
by
Miklos Szeredi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ovl: move cache and version to ovl_inode
Signed-off-by:
Miklos Szeredi
<
mszeredi@redhat.com
>
parent
a015dafc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
17 deletions
+13
-17
fs/overlayfs/ovl_entry.h
fs/overlayfs/ovl_entry.h
+3
-5
fs/overlayfs/super.c
fs/overlayfs/super.c
+2
-0
fs/overlayfs/util.c
fs/overlayfs/util.c
+8
-12
No files found.
fs/overlayfs/ovl_entry.h
View file @
04a01ac7
...
@@ -35,12 +35,8 @@ struct ovl_fs {
...
@@ -35,12 +35,8 @@ struct ovl_fs {
/* private information held for every overlayfs dentry */
/* private information held for every overlayfs dentry */
struct
ovl_entry
{
struct
ovl_entry
{
struct
ovl_dir_cache
*
cache
;
union
{
union
{
struct
{
u64
version
;
bool
opaque
;
bool
opaque
;
};
struct
rcu_head
rcu
;
struct
rcu_head
rcu
;
};
};
unsigned
numlower
;
unsigned
numlower
;
...
@@ -50,7 +46,9 @@ struct ovl_entry {
...
@@ -50,7 +46,9 @@ struct ovl_entry {
struct
ovl_entry
*
ovl_alloc_entry
(
unsigned
int
numlower
);
struct
ovl_entry
*
ovl_alloc_entry
(
unsigned
int
numlower
);
struct
ovl_inode
{
struct
ovl_inode
{
struct
ovl_dir_cache
*
cache
;
const
char
*
redirect
;
const
char
*
redirect
;
u64
version
;
unsigned
long
flags
;
unsigned
long
flags
;
struct
inode
vfs_inode
;
struct
inode
vfs_inode
;
struct
dentry
*
__upperdentry
;
struct
dentry
*
__upperdentry
;
...
...
fs/overlayfs/super.c
View file @
04a01ac7
...
@@ -169,7 +169,9 @@ static struct inode *ovl_alloc_inode(struct super_block *sb)
...
@@ -169,7 +169,9 @@ static struct inode *ovl_alloc_inode(struct super_block *sb)
{
{
struct
ovl_inode
*
oi
=
kmem_cache_alloc
(
ovl_inode_cachep
,
GFP_KERNEL
);
struct
ovl_inode
*
oi
=
kmem_cache_alloc
(
ovl_inode_cachep
,
GFP_KERNEL
);
oi
->
cache
=
NULL
;
oi
->
redirect
=
NULL
;
oi
->
redirect
=
NULL
;
oi
->
version
=
0
;
oi
->
flags
=
0
;
oi
->
flags
=
0
;
oi
->
__upperdentry
=
NULL
;
oi
->
__upperdentry
=
NULL
;
oi
->
lower
=
NULL
;
oi
->
lower
=
NULL
;
...
...
fs/overlayfs/util.c
View file @
04a01ac7
...
@@ -160,16 +160,12 @@ struct inode *ovl_inode_real(struct inode *inode)
...
@@ -160,16 +160,12 @@ struct inode *ovl_inode_real(struct inode *inode)
struct
ovl_dir_cache
*
ovl_dir_cache
(
struct
dentry
*
dentry
)
struct
ovl_dir_cache
*
ovl_dir_cache
(
struct
dentry
*
dentry
)
{
{
struct
ovl_entry
*
oe
=
dentry
->
d_fsdata
;
return
OVL_I
(
d_inode
(
dentry
))
->
cache
;
return
oe
->
cache
;
}
}
void
ovl_set_dir_cache
(
struct
dentry
*
dentry
,
struct
ovl_dir_cache
*
cache
)
void
ovl_set_dir_cache
(
struct
dentry
*
dentry
,
struct
ovl_dir_cache
*
cache
)
{
{
struct
ovl_entry
*
oe
=
dentry
->
d_fsdata
;
OVL_I
(
d_inode
(
dentry
))
->
cache
=
cache
;
oe
->
cache
=
cache
;
}
}
bool
ovl_dentry_is_opaque
(
struct
dentry
*
dentry
)
bool
ovl_dentry_is_opaque
(
struct
dentry
*
dentry
)
...
@@ -242,18 +238,18 @@ void ovl_inode_update(struct inode *inode, struct dentry *upperdentry)
...
@@ -242,18 +238,18 @@ void ovl_inode_update(struct inode *inode, struct dentry *upperdentry)
void
ovl_dentry_version_inc
(
struct
dentry
*
dentry
)
void
ovl_dentry_version_inc
(
struct
dentry
*
dentry
)
{
{
struct
ovl_entry
*
oe
=
dentry
->
d_fsdata
;
struct
inode
*
inode
=
d_inode
(
dentry
)
;
WARN_ON
(
!
inode_is_locked
(
dentry
->
d_
inode
));
WARN_ON
(
!
inode_is_locked
(
inode
));
oe
->
version
++
;
OVL_I
(
inode
)
->
version
++
;
}
}
u64
ovl_dentry_version_get
(
struct
dentry
*
dentry
)
u64
ovl_dentry_version_get
(
struct
dentry
*
dentry
)
{
{
struct
ovl_entry
*
oe
=
dentry
->
d_fsdata
;
struct
inode
*
inode
=
d_inode
(
dentry
)
;
WARN_ON
(
!
inode_is_locked
(
dentry
->
d_
inode
));
WARN_ON
(
!
inode_is_locked
(
inode
));
return
oe
->
version
;
return
OVL_I
(
inode
)
->
version
;
}
}
bool
ovl_is_whiteout
(
struct
dentry
*
dentry
)
bool
ovl_is_whiteout
(
struct
dentry
*
dentry
)
...
...
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