diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-02-19 20:03:30 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-03-05 15:44:56 -0500 |
commit | 1cda707d52e51a6cafac0aef12d2bd7052d572e6 (patch) | |
tree | 7a63b005631cca98f62ea199fef739eddce85d32 /fs/nfs/inode.c | |
parent | 5cf95214ccb915591e2214f81de4659302d3e452 (diff) |
NFS: Remove requirement for inode->i_mutex from nfs_invalidate_mapping
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index e8b41170d295..dbaaf7d2a188 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -754,7 +754,7 @@ int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | |||
754 | return __nfs_revalidate_inode(server, inode); | 754 | return __nfs_revalidate_inode(server, inode); |
755 | } | 755 | } |
756 | 756 | ||
757 | static int nfs_invalidate_mapping_nolock(struct inode *inode, struct address_space *mapping) | 757 | static int nfs_invalidate_mapping(struct inode *inode, struct address_space *mapping) |
758 | { | 758 | { |
759 | struct nfs_inode *nfsi = NFS_I(inode); | 759 | struct nfs_inode *nfsi = NFS_I(inode); |
760 | 760 | ||
@@ -775,49 +775,10 @@ static int nfs_invalidate_mapping_nolock(struct inode *inode, struct address_spa | |||
775 | return 0; | 775 | return 0; |
776 | } | 776 | } |
777 | 777 | ||
778 | static int nfs_invalidate_mapping(struct inode *inode, struct address_space *mapping) | ||
779 | { | ||
780 | int ret = 0; | ||
781 | |||
782 | mutex_lock(&inode->i_mutex); | ||
783 | if (NFS_I(inode)->cache_validity & NFS_INO_INVALID_DATA) { | ||
784 | ret = nfs_sync_mapping(mapping); | ||
785 | if (ret == 0) | ||
786 | ret = nfs_invalidate_mapping_nolock(inode, mapping); | ||
787 | } | ||
788 | mutex_unlock(&inode->i_mutex); | ||
789 | return ret; | ||
790 | } | ||
791 | |||
792 | /** | ||
793 | * nfs_revalidate_mapping_nolock - Revalidate the pagecache | ||
794 | * @inode - pointer to host inode | ||
795 | * @mapping - pointer to mapping | ||
796 | */ | ||
797 | int nfs_revalidate_mapping_nolock(struct inode *inode, struct address_space *mapping) | ||
798 | { | ||
799 | struct nfs_inode *nfsi = NFS_I(inode); | ||
800 | int ret = 0; | ||
801 | |||
802 | if ((nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE) | ||
803 | || nfs_attribute_timeout(inode) || NFS_STALE(inode)) { | ||
804 | ret = __nfs_revalidate_inode(NFS_SERVER(inode), inode); | ||
805 | if (ret < 0) | ||
806 | goto out; | ||
807 | } | ||
808 | if (nfsi->cache_validity & NFS_INO_INVALID_DATA) | ||
809 | ret = nfs_invalidate_mapping_nolock(inode, mapping); | ||
810 | out: | ||
811 | return ret; | ||
812 | } | ||
813 | |||
814 | /** | 778 | /** |
815 | * nfs_revalidate_mapping - Revalidate the pagecache | 779 | * nfs_revalidate_mapping - Revalidate the pagecache |
816 | * @inode - pointer to host inode | 780 | * @inode - pointer to host inode |
817 | * @mapping - pointer to mapping | 781 | * @mapping - pointer to mapping |
818 | * | ||
819 | * This version of the function will take the inode->i_mutex and attempt to | ||
820 | * flush out all dirty data if it needs to invalidate the page cache. | ||
821 | */ | 782 | */ |
822 | int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping) | 783 | int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping) |
823 | { | 784 | { |