diff options
Diffstat (limited to 'fs/inode.c')
-rw-r--r-- | fs/inode.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/inode.c b/fs/inode.c index fa506d539653..31168fd45bdc 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -1416,31 +1416,31 @@ void touch_atime(struct vfsmount *mnt, struct dentry *dentry) | |||
1416 | struct inode *inode = dentry->d_inode; | 1416 | struct inode *inode = dentry->d_inode; |
1417 | struct timespec now; | 1417 | struct timespec now; |
1418 | 1418 | ||
1419 | if (mnt_want_write(mnt)) | ||
1420 | return; | ||
1421 | if (inode->i_flags & S_NOATIME) | 1419 | if (inode->i_flags & S_NOATIME) |
1422 | goto out; | 1420 | return; |
1423 | if (IS_NOATIME(inode)) | 1421 | if (IS_NOATIME(inode)) |
1424 | goto out; | 1422 | return; |
1425 | if ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode)) | 1423 | if ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode)) |
1426 | goto out; | 1424 | return; |
1427 | 1425 | ||
1428 | if (mnt->mnt_flags & MNT_NOATIME) | 1426 | if (mnt->mnt_flags & MNT_NOATIME) |
1429 | goto out; | 1427 | return; |
1430 | if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode)) | 1428 | if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode)) |
1431 | goto out; | 1429 | return; |
1432 | 1430 | ||
1433 | now = current_fs_time(inode->i_sb); | 1431 | now = current_fs_time(inode->i_sb); |
1434 | 1432 | ||
1435 | if (!relatime_need_update(mnt, inode, now)) | 1433 | if (!relatime_need_update(mnt, inode, now)) |
1436 | goto out; | 1434 | return; |
1437 | 1435 | ||
1438 | if (timespec_equal(&inode->i_atime, &now)) | 1436 | if (timespec_equal(&inode->i_atime, &now)) |
1439 | goto out; | 1437 | return; |
1438 | |||
1439 | if (mnt_want_write(mnt)) | ||
1440 | return; | ||
1440 | 1441 | ||
1441 | inode->i_atime = now; | 1442 | inode->i_atime = now; |
1442 | mark_inode_dirty_sync(inode); | 1443 | mark_inode_dirty_sync(inode); |
1443 | out: | ||
1444 | mnt_drop_write(mnt); | 1444 | mnt_drop_write(mnt); |
1445 | } | 1445 | } |
1446 | EXPORT_SYMBOL(touch_atime); | 1446 | EXPORT_SYMBOL(touch_atime); |