diff options
author | David Howells <dhowells@redhat.com> | 2009-04-03 11:42:43 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2009-04-03 11:42:43 -0400 |
commit | ef79c097bbe9724e13937271b3457df560e00370 (patch) | |
tree | a8671781cc0c9deb85fa76a8b4211c5e693b4343 /fs/nfs/inode.c | |
parent | 10329a5d48f5abc14a37d30b706e330f8598297a (diff) |
NFS: Use local disk inode cache
Bind data storage objects in the local cache to NFS inodes.
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index cd29f410e941..64f87194d390 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -122,6 +122,7 @@ void nfs_clear_inode(struct inode *inode) | |||
122 | BUG_ON(!list_empty(&NFS_I(inode)->open_files)); | 122 | BUG_ON(!list_empty(&NFS_I(inode)->open_files)); |
123 | nfs_zap_acl_cache(inode); | 123 | nfs_zap_acl_cache(inode); |
124 | nfs_access_zap_cache(inode); | 124 | nfs_access_zap_cache(inode); |
125 | nfs_fscache_release_inode_cookie(inode); | ||
125 | } | 126 | } |
126 | 127 | ||
127 | /** | 128 | /** |
@@ -356,6 +357,8 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
356 | nfsi->attrtimeo_timestamp = now; | 357 | nfsi->attrtimeo_timestamp = now; |
357 | nfsi->access_cache = RB_ROOT; | 358 | nfsi->access_cache = RB_ROOT; |
358 | 359 | ||
360 | nfs_fscache_init_inode_cookie(inode); | ||
361 | |||
359 | unlock_new_inode(inode); | 362 | unlock_new_inode(inode); |
360 | } else | 363 | } else |
361 | nfs_refresh_inode(inode, fattr); | 364 | nfs_refresh_inode(inode, fattr); |
@@ -687,6 +690,7 @@ int nfs_open(struct inode *inode, struct file *filp) | |||
687 | ctx->mode = filp->f_mode; | 690 | ctx->mode = filp->f_mode; |
688 | nfs_file_set_open_context(filp, ctx); | 691 | nfs_file_set_open_context(filp, ctx); |
689 | put_nfs_open_context(ctx); | 692 | put_nfs_open_context(ctx); |
693 | nfs_fscache_set_inode_cookie(inode, filp); | ||
690 | return 0; | 694 | return 0; |
691 | } | 695 | } |
692 | 696 | ||
@@ -787,6 +791,7 @@ static int nfs_invalidate_mapping_nolock(struct inode *inode, struct address_spa | |||
787 | memset(nfsi->cookieverf, 0, sizeof(nfsi->cookieverf)); | 791 | memset(nfsi->cookieverf, 0, sizeof(nfsi->cookieverf)); |
788 | spin_unlock(&inode->i_lock); | 792 | spin_unlock(&inode->i_lock); |
789 | nfs_inc_stats(inode, NFSIOS_DATAINVALIDATE); | 793 | nfs_inc_stats(inode, NFSIOS_DATAINVALIDATE); |
794 | nfs_fscache_reset_inode_cookie(inode); | ||
790 | dfprintk(PAGECACHE, "NFS: (%s/%Ld) data cache invalidated\n", | 795 | dfprintk(PAGECACHE, "NFS: (%s/%Ld) data cache invalidated\n", |
791 | inode->i_sb->s_id, (long long)NFS_FILEID(inode)); | 796 | inode->i_sb->s_id, (long long)NFS_FILEID(inode)); |
792 | return 0; | 797 | return 0; |
@@ -1031,6 +1036,7 @@ int nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1031 | spin_lock(&inode->i_lock); | 1036 | spin_lock(&inode->i_lock); |
1032 | status = nfs_refresh_inode_locked(inode, fattr); | 1037 | status = nfs_refresh_inode_locked(inode, fattr); |
1033 | spin_unlock(&inode->i_lock); | 1038 | spin_unlock(&inode->i_lock); |
1039 | |||
1034 | return status; | 1040 | return status; |
1035 | } | 1041 | } |
1036 | 1042 | ||