aboutsummaryrefslogtreecommitdiff
path: root/fs/nfs/inode.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-18 15:32:44 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-18 15:32:44 -0700
commit161fb0cf5c7e94cd0490e4bd04edcf1e24d1d288 (patch)
tree38b0da03ce66f053e8cfed6c081c62aef22a544d /fs/nfs/inode.c
parentb8291ad07a7f3b5b990900f0001198ac23ba893e (diff)
parentb4528762ca92261c6ed3f03e76adeb1dc587aacb (diff)
Merge branch 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
* 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: SUNRPC: AUTH_SYS "machine creds" shouldn't use negative valued uid/gid nfs: make nfs4_drop_state_owner() static nfs: path_{get,put}() cleanups nfs: replace remaining __FUNCTION__ occurrences nfs/lsm: make NFSv4 set LSM mount options NFSv4: Check the return value of decode_compound_hdr_arg() nfs: fix race in nfs_dirty_request NFS: Ensure that 'noac' and/or 'actimeo=0' turn off attribute caching
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r--fs/nfs/inode.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 5cb3345eb69..596c5d8e86f 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -541,8 +541,7 @@ static void __put_nfs_open_context(struct nfs_open_context *ctx, int wait)
}
if (ctx->cred != NULL)
put_rpccred(ctx->cred);
- dput(ctx->path.dentry);
- mntput(ctx->path.mnt);
+ path_put(&ctx->path);
kfree(ctx);
}
@@ -707,6 +706,13 @@ int nfs_attribute_timeout(struct inode *inode)
if (nfs_have_delegation(inode, FMODE_READ))
return 0;
+ /*
+ * Special case: if the attribute timeout is set to 0, then always
+ * treat the cache as having expired (unless holding
+ * a delegation).
+ */
+ if (nfsi->attrtimeo == 0)
+ return 1;
return !time_in_range(jiffies, nfsi->read_cache_jiffies, nfsi->read_cache_jiffies + nfsi->attrtimeo);
}
@@ -995,7 +1001,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
unsigned long now = jiffies;
dfprintk(VFS, "NFS: %s(%s/%ld ct=%d info=0x%x)\n",
- __FUNCTION__, inode->i_sb->s_id, inode->i_ino,
+ __func__, inode->i_sb->s_id, inode->i_ino,
atomic_read(&inode->i_count), fattr->valid);
if (nfsi->fileid != fattr->fileid)
@@ -1119,7 +1125,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
* Big trouble! The inode has become a different object.
*/
printk(KERN_DEBUG "%s: inode %ld mode changed, %07o to %07o\n",
- __FUNCTION__, inode->i_ino, inode->i_mode, fattr->mode);
+ __func__, inode->i_ino, inode->i_mode, fattr->mode);
out_err:
/*
* No need to worry about unhashing the dentry, as the