Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90953
b: refs/heads/master
c: cdb70f3
h: refs/heads/master
i:
  90951: 2cee23f
v: v3
  • Loading branch information
Dave Hansen authored and Al Viro committed Apr 19, 2008
1 parent 789d741 commit 7c1e8ee
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a761a1c03a739f04afd6c8d37fd16405bbe754da
refs/heads/master: cdb70f3f74b31576cc4d707a3d3b00d159cab8bb
45 changes: 20 additions & 25 deletions trunk/fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1199,42 +1199,37 @@ void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
struct inode *inode = dentry->d_inode;
struct timespec now;

if (inode->i_flags & S_NOATIME)
if (mnt_want_write(mnt))
return;
if (inode->i_flags & S_NOATIME)
goto out;
if (IS_NOATIME(inode))
return;
goto out;
if ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode))
return;

/*
* We may have a NULL vfsmount when coming from NFSD
*/
if (mnt) {
if (mnt->mnt_flags & MNT_NOATIME)
return;
if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))
return;
goto out;

if (mnt->mnt_flags & MNT_RELATIME) {
/*
* With relative atime, only update atime if the
* previous atime is earlier than either the ctime or
* mtime.
*/
if (timespec_compare(&inode->i_mtime,
&inode->i_atime) < 0 &&
timespec_compare(&inode->i_ctime,
&inode->i_atime) < 0)
return;
}
if (mnt->mnt_flags & MNT_NOATIME)
goto out;
if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))
goto out;
if (mnt->mnt_flags & MNT_RELATIME) {
/*
* With relative atime, only update atime if the previous
* atime is earlier than either the ctime or mtime.
*/
if (timespec_compare(&inode->i_mtime, &inode->i_atime) < 0 &&
timespec_compare(&inode->i_ctime, &inode->i_atime) < 0)
goto out;
}

now = current_fs_time(inode->i_sb);
if (timespec_equal(&inode->i_atime, &now))
return;
goto out;

inode->i_atime = now;
mark_inode_dirty_sync(inode);
out:
mnt_drop_write(mnt);
}
EXPORT_SYMBOL(touch_atime);

Expand Down

0 comments on commit 7c1e8ee

Please sign in to comment.