@@ -92,7 +92,7 @@ static void fuse_dentry_settime(struct dentry *dentry, u64 time)
92
92
/*
93
93
* Calculate the time in jiffies until a dentry/attributes are valid
94
94
*/
95
- static u64 time_to_jiffies (u64 sec , u32 nsec )
95
+ u64 fuse_time_to_jiffies (u64 sec , u32 nsec )
96
96
{
97
97
if (sec || nsec ) {
98
98
struct timespec64 ts = {
@@ -112,17 +112,7 @@ static u64 time_to_jiffies(u64 sec, u32 nsec)
112
112
void fuse_change_entry_timeout (struct dentry * entry , struct fuse_entry_out * o )
113
113
{
114
114
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 ));
126
116
}
127
117
128
118
void fuse_invalidate_attr_mask (struct inode * inode , u32 mask )
@@ -266,7 +256,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)
266
256
267
257
forget_all_cached_acls (inode );
268
258
fuse_change_attributes (inode , & outarg .attr ,
269
- entry_attr_timeout (& outarg ),
259
+ ATTR_TIMEOUT (& outarg ),
270
260
attr_version );
271
261
fuse_change_entry_timeout (entry , & outarg );
272
262
} else if (inode ) {
@@ -399,7 +389,7 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name
399
389
goto out_put_forget ;
400
390
401
391
* inode = fuse_iget (sb , outarg -> nodeid , outarg -> generation ,
402
- & outarg -> attr , entry_attr_timeout (outarg ),
392
+ & outarg -> attr , ATTR_TIMEOUT (outarg ),
403
393
attr_version );
404
394
err = - ENOMEM ;
405
395
if (!* inode ) {
@@ -686,7 +676,7 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry,
686
676
ff -> nodeid = outentry .nodeid ;
687
677
ff -> open_flags = outopen .open_flags ;
688
678
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 );
690
680
if (!inode ) {
691
681
flags &= ~(O_CREAT | O_EXCL | O_TRUNC );
692
682
fuse_sync_release (NULL , ff , flags );
@@ -813,7 +803,7 @@ static int create_new_entry(struct fuse_mount *fm, struct fuse_args *args,
813
803
goto out_put_forget_req ;
814
804
815
805
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 );
817
807
if (!inode ) {
818
808
fuse_queue_forget (fm -> fc , forget , outarg .nodeid , 1 );
819
809
return - ENOMEM ;
@@ -1190,7 +1180,7 @@ static int fuse_do_getattr(struct inode *inode, struct kstat *stat,
1190
1180
err = - EIO ;
1191
1181
} else {
1192
1182
fuse_change_attributes (inode , & outarg .attr ,
1193
- attr_timeout (& outarg ),
1183
+ ATTR_TIMEOUT (& outarg ),
1194
1184
attr_version );
1195
1185
if (stat )
1196
1186
fuse_fillattr (inode , & outarg .attr , stat );
@@ -1867,7 +1857,7 @@ int fuse_do_setattr(struct dentry *dentry, struct iattr *attr,
1867
1857
}
1868
1858
1869
1859
fuse_change_attributes_common (inode , & outarg .attr ,
1870
- attr_timeout (& outarg ),
1860
+ ATTR_TIMEOUT (& outarg ),
1871
1861
fuse_get_cache_mask (inode ));
1872
1862
oldsize = inode -> i_size ;
1873
1863
/* see the comment in fuse_change_attributes() */
0 commit comments