diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-04-27 13:48:17 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-01 15:42:42 -0400 |
commit | 4124bbc52118e7da6f7ad41cc247fa16f4b3f051 (patch) | |
tree | 9e3dde086a44b9eba347feb899bc1c96dd2d30cc /fs/nfs/inode.c | |
parent | 8d197a568fc337c66729b289c7fa0f28c14ba5ac (diff) |
NFS: Simplify nfs_fhget()
If the inode is being initialised, there is no point in
setting flags such as NFS_INO_INVALID_ACCESS,
NFS_INO_INVALID_ACL or NFS_INO_INVALID_DATA since there are
no cached access calls, acls or data caches to invalidate.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 81946e77647c..8d67e5e52310 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -285,9 +285,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
285 | inode->i_mode = fattr->mode; | 285 | inode->i_mode = fattr->mode; |
286 | if ((fattr->valid & NFS_ATTR_FATTR_MODE) == 0 | 286 | if ((fattr->valid & NFS_ATTR_FATTR_MODE) == 0 |
287 | && nfs_server_capable(inode, NFS_CAP_MODE)) | 287 | && nfs_server_capable(inode, NFS_CAP_MODE)) |
288 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 288 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
289 | | NFS_INO_INVALID_ACCESS | ||
290 | | NFS_INO_INVALID_ACL; | ||
291 | /* Why so? Because we want revalidate for devices/FIFOs, and | 289 | /* Why so? Because we want revalidate for devices/FIFOs, and |
292 | * that's precisely what we have in nfs_file_inode_operations. | 290 | * that's precisely what we have in nfs_file_inode_operations. |
293 | */ | 291 | */ |
@@ -337,24 +335,19 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
337 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) | 335 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) |
338 | inode->i_mtime = fattr->mtime; | 336 | inode->i_mtime = fattr->mtime; |
339 | else if (nfs_server_capable(inode, NFS_CAP_MTIME)) | 337 | else if (nfs_server_capable(inode, NFS_CAP_MTIME)) |
340 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 338 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
341 | | NFS_INO_INVALID_DATA; | ||
342 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) | 339 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) |
343 | inode->i_ctime = fattr->ctime; | 340 | inode->i_ctime = fattr->ctime; |
344 | else if (nfs_server_capable(inode, NFS_CAP_CTIME)) | 341 | else if (nfs_server_capable(inode, NFS_CAP_CTIME)) |
345 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 342 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
346 | | NFS_INO_INVALID_ACCESS | ||
347 | | NFS_INO_INVALID_ACL; | ||
348 | if (fattr->valid & NFS_ATTR_FATTR_CHANGE) | 343 | if (fattr->valid & NFS_ATTR_FATTR_CHANGE) |
349 | inode->i_version = fattr->change_attr; | 344 | inode->i_version = fattr->change_attr; |
350 | else if (nfs_server_capable(inode, NFS_CAP_CHANGE_ATTR)) | 345 | else if (nfs_server_capable(inode, NFS_CAP_CHANGE_ATTR)) |
351 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 346 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
352 | | NFS_INO_INVALID_DATA; | ||
353 | if (fattr->valid & NFS_ATTR_FATTR_SIZE) | 347 | if (fattr->valid & NFS_ATTR_FATTR_SIZE) |
354 | inode->i_size = nfs_size_to_loff_t(fattr->size); | 348 | inode->i_size = nfs_size_to_loff_t(fattr->size); |
355 | else | 349 | else |
356 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 350 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR |
357 | | NFS_INO_INVALID_DATA | ||
358 | | NFS_INO_REVAL_PAGECACHE; | 351 | | NFS_INO_REVAL_PAGECACHE; |
359 | if (fattr->valid & NFS_ATTR_FATTR_NLINK) | 352 | if (fattr->valid & NFS_ATTR_FATTR_NLINK) |
360 | set_nlink(inode, fattr->nlink); | 353 | set_nlink(inode, fattr->nlink); |
@@ -363,15 +356,11 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
363 | if (fattr->valid & NFS_ATTR_FATTR_OWNER) | 356 | if (fattr->valid & NFS_ATTR_FATTR_OWNER) |
364 | inode->i_uid = fattr->uid; | 357 | inode->i_uid = fattr->uid; |
365 | else if (nfs_server_capable(inode, NFS_CAP_OWNER)) | 358 | else if (nfs_server_capable(inode, NFS_CAP_OWNER)) |
366 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 359 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
367 | | NFS_INO_INVALID_ACCESS | ||
368 | | NFS_INO_INVALID_ACL; | ||
369 | if (fattr->valid & NFS_ATTR_FATTR_GROUP) | 360 | if (fattr->valid & NFS_ATTR_FATTR_GROUP) |
370 | inode->i_gid = fattr->gid; | 361 | inode->i_gid = fattr->gid; |
371 | else if (nfs_server_capable(inode, NFS_CAP_OWNER_GROUP)) | 362 | else if (nfs_server_capable(inode, NFS_CAP_OWNER_GROUP)) |
372 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 363 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
373 | | NFS_INO_INVALID_ACCESS | ||
374 | | NFS_INO_INVALID_ACL; | ||
375 | if (fattr->valid & NFS_ATTR_FATTR_BLOCKS_USED) | 364 | if (fattr->valid & NFS_ATTR_FATTR_BLOCKS_USED) |
376 | inode->i_blocks = fattr->du.nfs2.blocks; | 365 | inode->i_blocks = fattr->du.nfs2.blocks; |
377 | if (fattr->valid & NFS_ATTR_FATTR_SPACE_USED) { | 366 | if (fattr->valid & NFS_ATTR_FATTR_SPACE_USED) { |