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
68ac1234
Commit
68ac1234
authored
Mar 15, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch touch_atime to struct path
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
40ffe67d
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
19 deletions
+21
-19
fs/cachefiles/namei.c
fs/cachefiles/namei.c
+2
-1
fs/ecryptfs/file.c
fs/ecryptfs/file.c
+4
-5
fs/inode.c
fs/inode.c
+3
-2
fs/namei.c
fs/namei.c
+1
-1
fs/nfsd/vfs.c
fs/nfsd/vfs.c
+6
-5
fs/stat.c
fs/stat.c
+1
-1
include/linux/fs.h
include/linux/fs.h
+2
-2
net/unix/af_unix.c
net/unix/af_unix.c
+2
-2
No files found.
fs/cachefiles/namei.c
View file @
68ac1234
...
@@ -646,7 +646,8 @@ int cachefiles_walk_to_object(struct cachefiles_object *parent,
...
@@ -646,7 +646,8 @@ int cachefiles_walk_to_object(struct cachefiles_object *parent,
* (this is used to keep track of culling, and atimes are only
* (this is used to keep track of culling, and atimes are only
* updated by read, write and readdir but not lookup or
* updated by read, write and readdir but not lookup or
* open) */
* open) */
touch_atime
(
cache
->
mnt
,
next
);
path
.
dentry
=
next
;
touch_atime
(
&
path
);
}
}
/* open a file interface onto a data file */
/* open a file interface onto a data file */
...
...
fs/ecryptfs/file.c
View file @
68ac1234
...
@@ -48,8 +48,7 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb,
...
@@ -48,8 +48,7 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb,
unsigned
long
nr_segs
,
loff_t
pos
)
unsigned
long
nr_segs
,
loff_t
pos
)
{
{
ssize_t
rc
;
ssize_t
rc
;
struct
dentry
*
lower_dentry
;
struct
path
lower
;
struct
vfsmount
*
lower_vfsmount
;
struct
file
*
file
=
iocb
->
ki_filp
;
struct
file
*
file
=
iocb
->
ki_filp
;
rc
=
generic_file_aio_read
(
iocb
,
iov
,
nr_segs
,
pos
);
rc
=
generic_file_aio_read
(
iocb
,
iov
,
nr_segs
,
pos
);
...
@@ -60,9 +59,9 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb,
...
@@ -60,9 +59,9 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb,
if
(
-
EIOCBQUEUED
==
rc
)
if
(
-
EIOCBQUEUED
==
rc
)
rc
=
wait_on_sync_kiocb
(
iocb
);
rc
=
wait_on_sync_kiocb
(
iocb
);
if
(
rc
>=
0
)
{
if
(
rc
>=
0
)
{
lower
_
dentry
=
ecryptfs_dentry_to_lower
(
file
->
f_path
.
dentry
);
lower
.
dentry
=
ecryptfs_dentry_to_lower
(
file
->
f_path
.
dentry
);
lower
_vfsmou
nt
=
ecryptfs_dentry_to_lower_mnt
(
file
->
f_path
.
dentry
);
lower
.
m
nt
=
ecryptfs_dentry_to_lower_mnt
(
file
->
f_path
.
dentry
);
touch_atime
(
lower_vfsmount
,
lower_dentry
);
touch_atime
(
&
lower
);
}
}
return
rc
;
return
rc
;
}
}
...
...
fs/inode.c
View file @
68ac1234
...
@@ -1499,9 +1499,10 @@ static int relatime_need_update(struct vfsmount *mnt, struct inode *inode,
...
@@ -1499,9 +1499,10 @@ static int relatime_need_update(struct vfsmount *mnt, struct inode *inode,
* This function automatically handles read only file systems and media,
* This function automatically handles read only file systems and media,
* as well as the "noatime" flag and inode specific "noatime" markers.
* as well as the "noatime" flag and inode specific "noatime" markers.
*/
*/
void
touch_atime
(
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
)
void
touch_atime
(
struct
path
*
path
)
{
{
struct
inode
*
inode
=
dentry
->
d_inode
;
struct
vfsmount
*
mnt
=
path
->
mnt
;
struct
inode
*
inode
=
path
->
dentry
->
d_inode
;
struct
timespec
now
;
struct
timespec
now
;
if
(
inode
->
i_flags
&
S_NOATIME
)
if
(
inode
->
i_flags
&
S_NOATIME
)
...
...
fs/namei.c
View file @
68ac1234
...
@@ -642,7 +642,7 @@ follow_link(struct path *link, struct nameidata *nd, void **p)
...
@@ -642,7 +642,7 @@ follow_link(struct path *link, struct nameidata *nd, void **p)
cond_resched
();
cond_resched
();
current
->
total_link_count
++
;
current
->
total_link_count
++
;
touch_atime
(
link
->
mnt
,
dentry
);
touch_atime
(
link
);
nd_set_link
(
nd
,
NULL
);
nd_set_link
(
nd
,
NULL
);
error
=
security_inode_follow_link
(
link
->
dentry
,
nd
);
error
=
security_inode_follow_link
(
link
->
dentry
,
nd
);
...
...
fs/nfsd/vfs.c
View file @
68ac1234
...
@@ -1541,30 +1541,31 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
...
@@ -1541,30 +1541,31 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
__be32
__be32
nfsd_readlink
(
struct
svc_rqst
*
rqstp
,
struct
svc_fh
*
fhp
,
char
*
buf
,
int
*
lenp
)
nfsd_readlink
(
struct
svc_rqst
*
rqstp
,
struct
svc_fh
*
fhp
,
char
*
buf
,
int
*
lenp
)
{
{
struct
dentry
*
dentry
;
struct
inode
*
inode
;
struct
inode
*
inode
;
mm_segment_t
oldfs
;
mm_segment_t
oldfs
;
__be32
err
;
__be32
err
;
int
host_err
;
int
host_err
;
struct
path
path
;
err
=
fh_verify
(
rqstp
,
fhp
,
S_IFLNK
,
NFSD_MAY_NOP
);
err
=
fh_verify
(
rqstp
,
fhp
,
S_IFLNK
,
NFSD_MAY_NOP
);
if
(
err
)
if
(
err
)
goto
out
;
goto
out
;
dentry
=
fhp
->
fh_dentry
;
path
.
mnt
=
fhp
->
fh_export
->
ex_path
.
mnt
;
inode
=
dentry
->
d_inode
;
path
.
dentry
=
fhp
->
fh_dentry
;
inode
=
path
.
dentry
->
d_inode
;
err
=
nfserr_inval
;
err
=
nfserr_inval
;
if
(
!
inode
->
i_op
->
readlink
)
if
(
!
inode
->
i_op
->
readlink
)
goto
out
;
goto
out
;
touch_atime
(
fhp
->
fh_export
->
ex_path
.
mnt
,
dentry
);
touch_atime
(
&
path
);
/* N.B. Why does this call need a get_fs()??
/* N.B. Why does this call need a get_fs()??
* Remove the set_fs and watch the fireworks:-) --okir
* Remove the set_fs and watch the fireworks:-) --okir
*/
*/
oldfs
=
get_fs
();
set_fs
(
KERNEL_DS
);
oldfs
=
get_fs
();
set_fs
(
KERNEL_DS
);
host_err
=
inode
->
i_op
->
readlink
(
dentry
,
buf
,
*
lenp
);
host_err
=
inode
->
i_op
->
readlink
(
path
.
dentry
,
buf
,
*
lenp
);
set_fs
(
oldfs
);
set_fs
(
oldfs
);
if
(
host_err
<
0
)
if
(
host_err
<
0
)
...
...
fs/stat.c
View file @
68ac1234
...
@@ -307,7 +307,7 @@ SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
...
@@ -307,7 +307,7 @@ SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
if
(
inode
->
i_op
->
readlink
)
{
if
(
inode
->
i_op
->
readlink
)
{
error
=
security_inode_readlink
(
path
.
dentry
);
error
=
security_inode_readlink
(
path
.
dentry
);
if
(
!
error
)
{
if
(
!
error
)
{
touch_atime
(
path
.
mnt
,
path
.
dentry
);
touch_atime
(
&
path
);
error
=
inode
->
i_op
->
readlink
(
path
.
dentry
,
error
=
inode
->
i_op
->
readlink
(
path
.
dentry
,
buf
,
bufsiz
);
buf
,
bufsiz
);
}
}
...
...
include/linux/fs.h
View file @
68ac1234
...
@@ -1812,11 +1812,11 @@ static inline void inode_inc_iversion(struct inode *inode)
...
@@ -1812,11 +1812,11 @@ static inline void inode_inc_iversion(struct inode *inode)
spin_unlock
(
&
inode
->
i_lock
);
spin_unlock
(
&
inode
->
i_lock
);
}
}
extern
void
touch_atime
(
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
);
extern
void
touch_atime
(
struct
path
*
);
static
inline
void
file_accessed
(
struct
file
*
file
)
static
inline
void
file_accessed
(
struct
file
*
file
)
{
{
if
(
!
(
file
->
f_flags
&
O_NOATIME
))
if
(
!
(
file
->
f_flags
&
O_NOATIME
))
touch_atime
(
file
->
f_path
.
mnt
,
file
->
f_path
.
dentry
);
touch_atime
(
&
file
->
f_path
);
}
}
int
sync_inode
(
struct
inode
*
inode
,
struct
writeback_control
*
wbc
);
int
sync_inode
(
struct
inode
*
inode
,
struct
writeback_control
*
wbc
);
...
...
net/unix/af_unix.c
View file @
68ac1234
...
@@ -771,7 +771,7 @@ static struct sock *unix_find_other(struct net *net,
...
@@ -771,7 +771,7 @@ static struct sock *unix_find_other(struct net *net,
goto
put_fail
;
goto
put_fail
;
if
(
u
->
sk_type
==
type
)
if
(
u
->
sk_type
==
type
)
touch_atime
(
path
.
mnt
,
path
.
dentry
);
touch_atime
(
&
path
);
path_put
(
&
path
);
path_put
(
&
path
);
...
@@ -787,7 +787,7 @@ static struct sock *unix_find_other(struct net *net,
...
@@ -787,7 +787,7 @@ static struct sock *unix_find_other(struct net *net,
struct
dentry
*
dentry
;
struct
dentry
*
dentry
;
dentry
=
unix_sk
(
u
)
->
path
.
dentry
;
dentry
=
unix_sk
(
u
)
->
path
.
dentry
;
if
(
dentry
)
if
(
dentry
)
touch_atime
(
unix_sk
(
u
)
->
path
.
mnt
,
dentry
);
touch_atime
(
&
unix_sk
(
u
)
->
path
);
}
else
}
else
goto
fail
;
goto
fail
;
}
}
...
...
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