Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 69181
b: refs/heads/master
c: c7e1596
h: refs/heads/master
i:
  69179: e209996
v: v3
  • Loading branch information
Fabio Olive Leite authored and Trond Myklebust committed Oct 9, 2007
1 parent e66441e commit 05b40e7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4e769b934e7638038e232c05b64f644e7269a90f
refs/heads/master: c7e15961115028b99f6142266b5fb08acca0e8dd
2 changes: 1 addition & 1 deletion trunk/fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,7 @@ int nfs_access_get_cached(struct inode *inode, struct rpc_cred *cred, struct nfs
cache = nfs_access_search_rbtree(inode, cred);
if (cache == NULL)
goto out;
if (time_after(jiffies, cache->jiffies + NFS_ATTRTIMEO(inode)))
if (!time_in_range(jiffies, cache->jiffies, cache->jiffies + NFS_ATTRTIMEO(inode)))
goto out_stale;
res->jiffies = cache->jiffies;
res->cred = cache->cred;
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ int nfs_attribute_timeout(struct inode *inode)

if (nfs_have_delegation(inode, FMODE_READ))
return 0;
return time_after(jiffies, nfsi->read_cache_jiffies+nfsi->attrtimeo);
return !time_in_range(jiffies, nfsi->read_cache_jiffies, nfsi->read_cache_jiffies + nfsi->attrtimeo);
}

/**
Expand Down Expand Up @@ -1055,7 +1055,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
nfs_inc_stats(inode, NFSIOS_ATTRINVALIDATE);
nfsi->attrtimeo = NFS_MINATTRTIMEO(inode);
nfsi->attrtimeo_timestamp = now;
} else if (time_after(now, nfsi->attrtimeo_timestamp+nfsi->attrtimeo)) {
} else if (!time_in_range(now, nfsi->attrtimeo_timestamp, nfsi->attrtimeo_timestamp + nfsi->attrtimeo)) {
if ((nfsi->attrtimeo <<= 1) > NFS_MAXATTRTIMEO(inode))
nfsi->attrtimeo = NFS_MAXATTRTIMEO(inode);
nfsi->attrtimeo_timestamp = now;
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/jiffies.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ static inline u64 get_jiffies_64(void)
((long)(a) - (long)(b) >= 0))
#define time_before_eq(a,b) time_after_eq(b,a)

#define time_in_range(a,b,c) \
(time_after_eq(a,b) && \
time_before_eq(a,c))

/* Same as above, but does so with platform independent 64bit types.
* These must be used when utilizing jiffies_64 (i.e. return value of
* get_jiffies_64() */
Expand Down

0 comments on commit 05b40e7

Please sign in to comment.