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
0f7ff2da
Commit
0f7ff2da
authored
Dec 06, 2015
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ovl: get rid of the dead code left from broken (and disabled) optimizations
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
acff81ec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
26 deletions
+11
-26
fs/overlayfs/copy_up.c
fs/overlayfs/copy_up.c
+6
-17
fs/overlayfs/inode.c
fs/overlayfs/inode.c
+4
-7
fs/overlayfs/overlayfs.h
fs/overlayfs/overlayfs.h
+1
-2
No files found.
fs/overlayfs/copy_up.c
View file @
0f7ff2da
...
@@ -195,8 +195,7 @@ int ovl_set_attr(struct dentry *upperdentry, struct kstat *stat)
...
@@ -195,8 +195,7 @@ int ovl_set_attr(struct dentry *upperdentry, struct kstat *stat)
static
int
ovl_copy_up_locked
(
struct
dentry
*
workdir
,
struct
dentry
*
upperdir
,
static
int
ovl_copy_up_locked
(
struct
dentry
*
workdir
,
struct
dentry
*
upperdir
,
struct
dentry
*
dentry
,
struct
path
*
lowerpath
,
struct
dentry
*
dentry
,
struct
path
*
lowerpath
,
struct
kstat
*
stat
,
struct
iattr
*
attr
,
struct
kstat
*
stat
,
const
char
*
link
)
const
char
*
link
)
{
{
struct
inode
*
wdir
=
workdir
->
d_inode
;
struct
inode
*
wdir
=
workdir
->
d_inode
;
struct
inode
*
udir
=
upperdir
->
d_inode
;
struct
inode
*
udir
=
upperdir
->
d_inode
;
...
@@ -240,8 +239,6 @@ static int ovl_copy_up_locked(struct dentry *workdir, struct dentry *upperdir,
...
@@ -240,8 +239,6 @@ static int ovl_copy_up_locked(struct dentry *workdir, struct dentry *upperdir,
mutex_lock
(
&
newdentry
->
d_inode
->
i_mutex
);
mutex_lock
(
&
newdentry
->
d_inode
->
i_mutex
);
err
=
ovl_set_attr
(
newdentry
,
stat
);
err
=
ovl_set_attr
(
newdentry
,
stat
);
if
(
!
err
&&
attr
)
err
=
notify_change
(
newdentry
,
attr
,
NULL
);
mutex_unlock
(
&
newdentry
->
d_inode
->
i_mutex
);
mutex_unlock
(
&
newdentry
->
d_inode
->
i_mutex
);
if
(
err
)
if
(
err
)
goto
out_cleanup
;
goto
out_cleanup
;
...
@@ -286,8 +283,7 @@ static int ovl_copy_up_locked(struct dentry *workdir, struct dentry *upperdir,
...
@@ -286,8 +283,7 @@ static int ovl_copy_up_locked(struct dentry *workdir, struct dentry *upperdir,
* that point the file will have already been copied up anyway.
* that point the file will have already been copied up anyway.
*/
*/
int
ovl_copy_up_one
(
struct
dentry
*
parent
,
struct
dentry
*
dentry
,
int
ovl_copy_up_one
(
struct
dentry
*
parent
,
struct
dentry
*
dentry
,
struct
path
*
lowerpath
,
struct
kstat
*
stat
,
struct
path
*
lowerpath
,
struct
kstat
*
stat
)
struct
iattr
*
attr
)
{
{
struct
dentry
*
workdir
=
ovl_workdir
(
dentry
);
struct
dentry
*
workdir
=
ovl_workdir
(
dentry
);
int
err
;
int
err
;
...
@@ -345,26 +341,19 @@ int ovl_copy_up_one(struct dentry *parent, struct dentry *dentry,
...
@@ -345,26 +341,19 @@ int ovl_copy_up_one(struct dentry *parent, struct dentry *dentry,
}
}
upperdentry
=
ovl_dentry_upper
(
dentry
);
upperdentry
=
ovl_dentry_upper
(
dentry
);
if
(
upperdentry
)
{
if
(
upperdentry
)
{
unlock_rename
(
workdir
,
upperdir
);
/* Raced with another copy-up? Nothing to do, then... */
err
=
0
;
err
=
0
;
/* Raced with another copy-up? Do the setattr here */
goto
out_unlock
;
if
(
attr
)
{
mutex_lock
(
&
upperdentry
->
d_inode
->
i_mutex
);
err
=
notify_change
(
upperdentry
,
attr
,
NULL
);
mutex_unlock
(
&
upperdentry
->
d_inode
->
i_mutex
);
}
goto
out_put_cred
;
}
}
err
=
ovl_copy_up_locked
(
workdir
,
upperdir
,
dentry
,
lowerpath
,
err
=
ovl_copy_up_locked
(
workdir
,
upperdir
,
dentry
,
lowerpath
,
stat
,
attr
,
link
);
stat
,
link
);
if
(
!
err
)
{
if
(
!
err
)
{
/* Restore timestamps on parent (best effort) */
/* Restore timestamps on parent (best effort) */
ovl_set_timestamps
(
upperdir
,
&
pstat
);
ovl_set_timestamps
(
upperdir
,
&
pstat
);
}
}
out_unlock:
out_unlock:
unlock_rename
(
workdir
,
upperdir
);
unlock_rename
(
workdir
,
upperdir
);
out_put_cred:
revert_creds
(
old_cred
);
revert_creds
(
old_cred
);
put_cred
(
override_cred
);
put_cred
(
override_cred
);
...
@@ -406,7 +395,7 @@ int ovl_copy_up(struct dentry *dentry)
...
@@ -406,7 +395,7 @@ int ovl_copy_up(struct dentry *dentry)
ovl_path_lower
(
next
,
&
lowerpath
);
ovl_path_lower
(
next
,
&
lowerpath
);
err
=
vfs_getattr
(
&
lowerpath
,
&
stat
);
err
=
vfs_getattr
(
&
lowerpath
,
&
stat
);
if
(
!
err
)
if
(
!
err
)
err
=
ovl_copy_up_one
(
parent
,
next
,
&
lowerpath
,
&
stat
,
NULL
);
err
=
ovl_copy_up_one
(
parent
,
next
,
&
lowerpath
,
&
stat
);
dput
(
parent
);
dput
(
parent
);
dput
(
next
);
dput
(
next
);
...
...
fs/overlayfs/inode.c
View file @
0f7ff2da
...
@@ -12,8 +12,7 @@
...
@@ -12,8 +12,7 @@
#include <linux/xattr.h>
#include <linux/xattr.h>
#include "overlayfs.h"
#include "overlayfs.h"
static
int
ovl_copy_up_last
(
struct
dentry
*
dentry
,
struct
iattr
*
attr
,
static
int
ovl_copy_up_truncate
(
struct
dentry
*
dentry
)
bool
no_data
)
{
{
int
err
;
int
err
;
struct
dentry
*
parent
;
struct
dentry
*
parent
;
...
@@ -30,10 +29,8 @@ static int ovl_copy_up_last(struct dentry *dentry, struct iattr *attr,
...
@@ -30,10 +29,8 @@ static int ovl_copy_up_last(struct dentry *dentry, struct iattr *attr,
if
(
err
)
if
(
err
)
goto
out_dput_parent
;
goto
out_dput_parent
;
if
(
no_data
)
stat
.
size
=
0
;
stat
.
size
=
0
;
err
=
ovl_copy_up_one
(
parent
,
dentry
,
&
lowerpath
,
&
stat
);
err
=
ovl_copy_up_one
(
parent
,
dentry
,
&
lowerpath
,
&
stat
,
attr
);
out_dput_parent:
out_dput_parent:
dput
(
parent
);
dput
(
parent
);
...
@@ -353,7 +350,7 @@ struct inode *ovl_d_select_inode(struct dentry *dentry, unsigned file_flags)
...
@@ -353,7 +350,7 @@ struct inode *ovl_d_select_inode(struct dentry *dentry, unsigned file_flags)
return
ERR_PTR
(
err
);
return
ERR_PTR
(
err
);
if
(
file_flags
&
O_TRUNC
)
if
(
file_flags
&
O_TRUNC
)
err
=
ovl_copy_up_
last
(
dentry
,
NULL
,
true
);
err
=
ovl_copy_up_
truncate
(
dentry
);
else
else
err
=
ovl_copy_up
(
dentry
);
err
=
ovl_copy_up
(
dentry
);
ovl_drop_write
(
dentry
);
ovl_drop_write
(
dentry
);
...
...
fs/overlayfs/overlayfs.h
View file @
0f7ff2da
...
@@ -194,7 +194,6 @@ void ovl_cleanup(struct inode *dir, struct dentry *dentry);
...
@@ -194,7 +194,6 @@ void ovl_cleanup(struct inode *dir, struct dentry *dentry);
/* copy_up.c */
/* copy_up.c */
int
ovl_copy_up
(
struct
dentry
*
dentry
);
int
ovl_copy_up
(
struct
dentry
*
dentry
);
int
ovl_copy_up_one
(
struct
dentry
*
parent
,
struct
dentry
*
dentry
,
int
ovl_copy_up_one
(
struct
dentry
*
parent
,
struct
dentry
*
dentry
,
struct
path
*
lowerpath
,
struct
kstat
*
stat
,
struct
path
*
lowerpath
,
struct
kstat
*
stat
);
struct
iattr
*
attr
);
int
ovl_copy_xattr
(
struct
dentry
*
old
,
struct
dentry
*
new
);
int
ovl_copy_xattr
(
struct
dentry
*
old
,
struct
dentry
*
new
);
int
ovl_set_attr
(
struct
dentry
*
upper
,
struct
kstat
*
stat
);
int
ovl_set_attr
(
struct
dentry
*
upper
,
struct
kstat
*
stat
);
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