@@ -92,7 +92,7 @@ static void fuse_dentry_settime(struct dentry *dentry, u64 time)
9292/*
9393 * Calculate the time in jiffies until a dentry/attributes are valid
9494 */
95- static u64 time_to_jiffies (u64 sec , u32 nsec )
95+ u64 fuse_time_to_jiffies (u64 sec , u32 nsec )
9696{
9797 if (sec || nsec ) {
9898 struct timespec64 ts = {
@@ -112,17 +112,7 @@ static u64 time_to_jiffies(u64 sec, u32 nsec)
112112void fuse_change_entry_timeout (struct dentry * entry , struct fuse_entry_out * o )
113113{
114114 fuse_dentry_settime (entry ,
115- time_to_jiffies (o -> entry_valid , o -> entry_valid_nsec ));
116- }
117-
118- static u64 attr_timeout (struct fuse_attr_out * o )
119- {
120- return time_to_jiffies (o -> attr_valid , o -> attr_valid_nsec );
121- }
122-
123- u64 entry_attr_timeout (struct fuse_entry_out * o )
124- {
125- return time_to_jiffies (o -> attr_valid , o -> attr_valid_nsec );
115+ fuse_time_to_jiffies (o -> entry_valid , o -> entry_valid_nsec ));
126116}
127117
128118void fuse_invalidate_attr_mask (struct inode * inode , u32 mask )
@@ -266,7 +256,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)
266256
267257 forget_all_cached_acls (inode );
268258 fuse_change_attributes (inode , & outarg .attr ,
269- entry_attr_timeout (& outarg ),
259+ ATTR_TIMEOUT (& outarg ),
270260 attr_version );
271261 fuse_change_entry_timeout (entry , & outarg );
272262 } else if (inode ) {
@@ -399,7 +389,7 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name
399389 goto out_put_forget ;
400390
401391 * inode = fuse_iget (sb , outarg -> nodeid , outarg -> generation ,
402- & outarg -> attr , entry_attr_timeout (outarg ),
392+ & outarg -> attr , ATTR_TIMEOUT (outarg ),
403393 attr_version );
404394 err = - ENOMEM ;
405395 if (!* inode ) {
@@ -686,7 +676,7 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry,
686676 ff -> nodeid = outentry .nodeid ;
687677 ff -> open_flags = outopen .open_flags ;
688678 inode = fuse_iget (dir -> i_sb , outentry .nodeid , outentry .generation ,
689- & outentry .attr , entry_attr_timeout (& outentry ), 0 );
679+ & outentry .attr , ATTR_TIMEOUT (& outentry ), 0 );
690680 if (!inode ) {
691681 flags &= ~(O_CREAT | O_EXCL | O_TRUNC );
692682 fuse_sync_release (NULL , ff , flags );
@@ -813,7 +803,7 @@ static int create_new_entry(struct fuse_mount *fm, struct fuse_args *args,
813803 goto out_put_forget_req ;
814804
815805 inode = fuse_iget (dir -> i_sb , outarg .nodeid , outarg .generation ,
816- & outarg .attr , entry_attr_timeout (& outarg ), 0 );
806+ & outarg .attr , ATTR_TIMEOUT (& outarg ), 0 );
817807 if (!inode ) {
818808 fuse_queue_forget (fm -> fc , forget , outarg .nodeid , 1 );
819809 return - ENOMEM ;
@@ -1190,7 +1180,7 @@ static int fuse_do_getattr(struct inode *inode, struct kstat *stat,
11901180 err = - EIO ;
11911181 } else {
11921182 fuse_change_attributes (inode , & outarg .attr ,
1193- attr_timeout (& outarg ),
1183+ ATTR_TIMEOUT (& outarg ),
11941184 attr_version );
11951185 if (stat )
11961186 fuse_fillattr (inode , & outarg .attr , stat );
@@ -1867,7 +1857,7 @@ int fuse_do_setattr(struct dentry *dentry, struct iattr *attr,
18671857 }
18681858
18691859 fuse_change_attributes_common (inode , & outarg .attr ,
1870- attr_timeout (& outarg ),
1860+ ATTR_TIMEOUT (& outarg ),
18711861 fuse_get_cache_mask (inode ));
18721862 oldsize = inode -> i_size ;
18731863 /* see the comment in fuse_change_attributes() */
0 commit comments