dir.c (60bcc88ad185d512f5718f2f8dcccb483ea8fb73) | dir.c (f75fdf22b0a84702d1b72fc1ccd53dcdde121c16) |
---|---|
1/* 2 FUSE: Filesystem in Userspace 3 Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu> 4 5 This program can be distributed under the terms of the GNU GPL. 6 See the file COPYING. 7*/ 8 --- 25 unchanged lines hidden (view full) --- 34 35static void fuse_advise_use_readdirplus(struct inode *dir) 36{ 37 struct fuse_inode *fi = get_fuse_inode(dir); 38 39 set_bit(FUSE_I_ADVISE_RDPLUS, &fi->state); 40} 41 | 1/* 2 FUSE: Filesystem in Userspace 3 Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu> 4 5 This program can be distributed under the terms of the GNU GPL. 6 See the file COPYING. 7*/ 8 --- 25 unchanged lines hidden (view full) --- 34 35static void fuse_advise_use_readdirplus(struct inode *dir) 36{ 37 struct fuse_inode *fi = get_fuse_inode(dir); 38 39 set_bit(FUSE_I_ADVISE_RDPLUS, &fi->state); 40} 41 |
42#if BITS_PER_LONG >= 64 | 42union fuse_dentry { 43 u64 time; 44 struct rcu_head rcu; 45}; 46 |
43static inline void fuse_dentry_settime(struct dentry *entry, u64 time) 44{ | 47static inline void fuse_dentry_settime(struct dentry *entry, u64 time) 48{ |
45 entry->d_time = time; | 49 ((union fuse_dentry *) entry->d_fsdata)->time = time; |
46} 47 48static inline u64 fuse_dentry_time(struct dentry *entry) 49{ | 50} 51 52static inline u64 fuse_dentry_time(struct dentry *entry) 53{ |
50 return entry->d_time; | 54 return ((union fuse_dentry *) entry->d_fsdata)->time; |
51} | 55} |
52#else 53/* 54 * On 32 bit archs store the high 32 bits of time in d_fsdata 55 */ 56static void fuse_dentry_settime(struct dentry *entry, u64 time) 57{ 58 entry->d_time = time; 59 entry->d_fsdata = (void *) (unsigned long) (time >> 32); 60} | |
61 | 56 |
62static u64 fuse_dentry_time(struct dentry *entry) 63{ 64 return (u64) entry->d_time + 65 ((u64) (unsigned long) entry->d_fsdata << 32); 66} 67#endif 68 | |
69/* 70 * FUSE caches dentries and attributes with separate timeout. The 71 * time in jiffies until the dentry/attributes are valid is stored in | 57/* 58 * FUSE caches dentries and attributes with separate timeout. The 59 * time in jiffies until the dentry/attributes are valid is stored in |
72 * dentry->d_time and fuse_inode->i_time respectively. | 60 * dentry->d_fsdata and fuse_inode->i_time respectively. |
73 */ 74 75/* 76 * Calculate the time in jiffies until a dentry/attributes are valid 77 */ 78static u64 time_to_jiffies(unsigned long sec, unsigned long nsec) 79{ 80 if (sec || nsec) { --- 189 unchanged lines hidden (view full) --- 270 goto out; 271} 272 273static int invalid_nodeid(u64 nodeid) 274{ 275 return !nodeid || nodeid == FUSE_ROOT_ID; 276} 277 | 61 */ 62 63/* 64 * Calculate the time in jiffies until a dentry/attributes are valid 65 */ 66static u64 time_to_jiffies(unsigned long sec, unsigned long nsec) 67{ 68 if (sec || nsec) { --- 189 unchanged lines hidden (view full) --- 258 goto out; 259} 260 261static int invalid_nodeid(u64 nodeid) 262{ 263 return !nodeid || nodeid == FUSE_ROOT_ID; 264} 265 |
266static int fuse_dentry_init(struct dentry *dentry) 267{ 268 dentry->d_fsdata = kzalloc(sizeof(union fuse_dentry), GFP_KERNEL); 269 270 return dentry->d_fsdata ? 0 : -ENOMEM; 271} 272static void fuse_dentry_release(struct dentry *dentry) 273{ 274 union fuse_dentry *fd = dentry->d_fsdata; 275 276 kfree_rcu(fd, rcu); 277} 278 |
|
278const struct dentry_operations fuse_dentry_operations = { 279 .d_revalidate = fuse_dentry_revalidate, | 279const struct dentry_operations fuse_dentry_operations = { 280 .d_revalidate = fuse_dentry_revalidate, |
281 .d_init = fuse_dentry_init, 282 .d_release = fuse_dentry_release, |
|
280}; 281 282int fuse_valid_type(int m) 283{ 284 return S_ISREG(m) || S_ISDIR(m) || S_ISLNK(m) || S_ISCHR(m) || 285 S_ISBLK(m) || S_ISFIFO(m) || S_ISSOCK(m); 286} 287 --- 1565 unchanged lines hidden --- | 283}; 284 285int fuse_valid_type(int m) 286{ 287 return S_ISREG(m) || S_ISDIR(m) || S_ISLNK(m) || S_ISCHR(m) || 288 S_ISBLK(m) || S_ISFIFO(m) || S_ISSOCK(m); 289} 290 --- 1565 unchanged lines hidden --- |