Skip to content

Commit

Permalink
orangefs: don't use d_time
Browse files Browse the repository at this point in the history
Instead use d_fsdata which is the same size.  Hoping to get rid of d_time,
which is used by very few filesystems by this time.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Reviewed-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
  • Loading branch information
Miklos Szeredi authored and Mike Marshall committed Oct 24, 2016
1 parent d62a902 commit 804b173
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
5 changes: 3 additions & 2 deletions fs/orangefs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static int orangefs_revalidate_lookup(struct dentry *dentry)
}
}

dentry->d_time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000;
orangefs_set_timeout(dentry);
ret = 1;
out_release_op:
op_release(new_op);
Expand All @@ -94,8 +94,9 @@ static int orangefs_revalidate_lookup(struct dentry *dentry)
static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags)
{
int ret;
unsigned long time = (unsigned long) dentry->d_fsdata;

if (time_before(jiffies, dentry->d_time))
if (time_before(jiffies, time))
return 1;

if (flags & LOOKUP_RCU)
Expand Down
8 changes: 4 additions & 4 deletions fs/orangefs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static int orangefs_create(struct inode *dir,

d_instantiate(dentry, inode);
unlock_new_inode(inode);
dentry->d_time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000;
orangefs_set_timeout(dentry);
ORANGEFS_I(inode)->getattr_time = jiffies - 1;

gossip_debug(GOSSIP_NAME_DEBUG,
Expand Down Expand Up @@ -183,7 +183,7 @@ static struct dentry *orangefs_lookup(struct inode *dir, struct dentry *dentry,
goto out;
}

dentry->d_time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000;
orangefs_set_timeout(dentry);

inode = orangefs_iget(dir->i_sb, &new_op->downcall.resp.lookup.refn);
if (IS_ERR(inode)) {
Expand Down Expand Up @@ -322,7 +322,7 @@ static int orangefs_symlink(struct inode *dir,

d_instantiate(dentry, inode);
unlock_new_inode(inode);
dentry->d_time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000;
orangefs_set_timeout(dentry);
ORANGEFS_I(inode)->getattr_time = jiffies - 1;

gossip_debug(GOSSIP_NAME_DEBUG,
Expand Down Expand Up @@ -386,7 +386,7 @@ static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode

d_instantiate(dentry, inode);
unlock_new_inode(inode);
dentry->d_time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000;
orangefs_set_timeout(dentry);
ORANGEFS_I(inode)->getattr_time = jiffies - 1;

gossip_debug(GOSSIP_NAME_DEBUG,
Expand Down
7 changes: 7 additions & 0 deletions fs/orangefs/orangefs-kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -580,4 +580,11 @@ static inline void orangefs_i_size_write(struct inode *inode, loff_t i_size)
#endif
}

static inline void orangefs_set_timeout(struct dentry *dentry)
{
unsigned long time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000;

dentry->d_fsdata = (void *) time;
}

#endif /* __ORANGEFSKERNEL_H */

0 comments on commit 804b173

Please sign in to comment.