orangefs: don't use d_time
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>
This commit is contained in:
parent
d62a9025ae
commit
804b1737d7
@ -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;
|
ret = 1;
|
||||||
out_release_op:
|
out_release_op:
|
||||||
op_release(new_op);
|
op_release(new_op);
|
||||||
@ -94,8 +94,9 @@ out_drop:
|
|||||||
static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags)
|
static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
unsigned long time = (unsigned long) dentry->d_fsdata;
|
||||||
|
|
||||||
if (time_before(jiffies, dentry->d_time))
|
if (time_before(jiffies, time))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (flags & LOOKUP_RCU)
|
if (flags & LOOKUP_RCU)
|
||||||
|
@ -72,7 +72,7 @@ static int orangefs_create(struct inode *dir,
|
|||||||
|
|
||||||
d_instantiate(dentry, inode);
|
d_instantiate(dentry, inode);
|
||||||
unlock_new_inode(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;
|
ORANGEFS_I(inode)->getattr_time = jiffies - 1;
|
||||||
|
|
||||||
gossip_debug(GOSSIP_NAME_DEBUG,
|
gossip_debug(GOSSIP_NAME_DEBUG,
|
||||||
@ -183,7 +183,7 @@ static struct dentry *orangefs_lookup(struct inode *dir, struct dentry *dentry,
|
|||||||
goto out;
|
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);
|
inode = orangefs_iget(dir->i_sb, &new_op->downcall.resp.lookup.refn);
|
||||||
if (IS_ERR(inode)) {
|
if (IS_ERR(inode)) {
|
||||||
@ -322,7 +322,7 @@ static int orangefs_symlink(struct inode *dir,
|
|||||||
|
|
||||||
d_instantiate(dentry, inode);
|
d_instantiate(dentry, inode);
|
||||||
unlock_new_inode(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;
|
ORANGEFS_I(inode)->getattr_time = jiffies - 1;
|
||||||
|
|
||||||
gossip_debug(GOSSIP_NAME_DEBUG,
|
gossip_debug(GOSSIP_NAME_DEBUG,
|
||||||
@ -386,7 +386,7 @@ static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
|
|||||||
|
|
||||||
d_instantiate(dentry, inode);
|
d_instantiate(dentry, inode);
|
||||||
unlock_new_inode(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;
|
ORANGEFS_I(inode)->getattr_time = jiffies - 1;
|
||||||
|
|
||||||
gossip_debug(GOSSIP_NAME_DEBUG,
|
gossip_debug(GOSSIP_NAME_DEBUG,
|
||||||
|
@ -580,4 +580,11 @@ static inline void orangefs_i_size_write(struct inode *inode, loff_t i_size)
|
|||||||
#endif
|
#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 */
|
#endif /* __ORANGEFSKERNEL_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user