summaryrefslogtreecommitdiffstats
path: root/fs/nfs/inode.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-03-03 14:38:56 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-03-03 14:38:56 -0500
commit590dce2d4934fb909b112cd80c80486362337744 (patch)
tree9c46dfa627c0adb639ee1542fffbc2262727ef36 /fs/nfs/inode.c
parente0d072250a54669dce876d8ade70e417356aae74 (diff)
parenta528d35e8bfcc521d7cb70aaf03e1bd296c8493f (diff)
Merge branch 'rebased-statx' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs 'statx()' update from Al Viro. This adds the new extended stat() interface that internally subsumes our previous stat interfaces, and allows user mode to specify in more detail what kind of information it wants. It also allows for some explicit synchronization information to be passed to the filesystem, which can be relevant for network filesystems: is the cached value ok, or do you need open/close consistency, or what? From David Howells. Andreas Dilger points out that the first version of the extended statx interface was posted June 29, 2010: https://www.spinics.net/lists/linux-fsdevel/msg33831.html * 'rebased-statx' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: statx: Add a system call to make enhanced file info available
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r--fs/nfs/inode.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 685565b229c3..f489a5a71bd5 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -703,9 +703,10 @@ static bool nfs_need_revalidate_inode(struct inode *inode)
703 return false; 703 return false;
704} 704}
705 705
706int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) 706int nfs_getattr(const struct path *path, struct kstat *stat,
707 u32 request_mask, unsigned int query_flags)
707{ 708{
708 struct inode *inode = d_inode(dentry); 709 struct inode *inode = d_inode(path->dentry);
709 int need_atime = NFS_I(inode)->cache_validity & NFS_INO_INVALID_ATIME; 710 int need_atime = NFS_I(inode)->cache_validity & NFS_INO_INVALID_ATIME;
710 int err = 0; 711 int err = 0;
711 712
@@ -726,17 +727,17 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
726 * - NFS never sets MS_NOATIME or MS_NODIRATIME so there is 727 * - NFS never sets MS_NOATIME or MS_NODIRATIME so there is
727 * no point in checking those. 728 * no point in checking those.
728 */ 729 */
729 if ((mnt->mnt_flags & MNT_NOATIME) || 730 if ((path->mnt->mnt_flags & MNT_NOATIME) ||
730 ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))) 731 ((path->mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode)))
731 need_atime = 0; 732 need_atime = 0;
732 733
733 if (need_atime || nfs_need_revalidate_inode(inode)) { 734 if (need_atime || nfs_need_revalidate_inode(inode)) {
734 struct nfs_server *server = NFS_SERVER(inode); 735 struct nfs_server *server = NFS_SERVER(inode);
735 736
736 nfs_readdirplus_parent_cache_miss(dentry); 737 nfs_readdirplus_parent_cache_miss(path->dentry);
737 err = __nfs_revalidate_inode(server, inode); 738 err = __nfs_revalidate_inode(server, inode);
738 } else 739 } else
739 nfs_readdirplus_parent_cache_hit(dentry); 740 nfs_readdirplus_parent_cache_hit(path->dentry);
740 if (!err) { 741 if (!err) {
741 generic_fillattr(inode, stat); 742 generic_fillattr(inode, stat);
742 stat->ino = nfs_compat_user_ino64(NFS_FILEID(inode)); 743 stat->ino = nfs_compat_user_ino64(NFS_FILEID(inode));