aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a0653e560c26..cc008c338f5a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1046,12 +1046,12 @@ extern void locks_remove_file(struct file *);
1046extern void locks_release_private(struct file_lock *); 1046extern void locks_release_private(struct file_lock *);
1047extern void posix_test_lock(struct file *, struct file_lock *); 1047extern void posix_test_lock(struct file *, struct file_lock *);
1048extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); 1048extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
1049extern int posix_lock_file_wait(struct file *, struct file_lock *); 1049extern int posix_lock_inode_wait(struct inode *, struct file_lock *);
1050extern int posix_unblock_lock(struct file_lock *); 1050extern int posix_unblock_lock(struct file_lock *);
1051extern int vfs_test_lock(struct file *, struct file_lock *); 1051extern int vfs_test_lock(struct file *, struct file_lock *);
1052extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *); 1052extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *);
1053extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); 1053extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
1054extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); 1054extern int flock_lock_inode_wait(struct inode *inode, struct file_lock *fl);
1055extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type); 1055extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type);
1056extern void lease_get_mtime(struct inode *, struct timespec *time); 1056extern void lease_get_mtime(struct inode *, struct timespec *time);
1057extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); 1057extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
@@ -1137,7 +1137,8 @@ static inline int posix_lock_file(struct file *filp, struct file_lock *fl,
1137 return -ENOLCK; 1137 return -ENOLCK;
1138} 1138}
1139 1139
1140static inline int posix_lock_file_wait(struct file *filp, struct file_lock *fl) 1140static inline int posix_lock_inode_wait(struct inode *inode,
1141 struct file_lock *fl)
1141{ 1142{
1142 return -ENOLCK; 1143 return -ENOLCK;
1143} 1144}
@@ -1163,8 +1164,8 @@ static inline int vfs_cancel_lock(struct file *filp, struct file_lock *fl)
1163 return 0; 1164 return 0;
1164} 1165}
1165 1166
1166static inline int flock_lock_file_wait(struct file *filp, 1167static inline int flock_lock_inode_wait(struct inode *inode,
1167 struct file_lock *request) 1168 struct file_lock *request)
1168{ 1169{
1169 return -ENOLCK; 1170 return -ENOLCK;
1170} 1171}
@@ -1202,6 +1203,20 @@ static inline void show_fd_locks(struct seq_file *f,
1202 struct file *filp, struct files_struct *files) {} 1203 struct file *filp, struct files_struct *files) {}
1203#endif /* !CONFIG_FILE_LOCKING */ 1204#endif /* !CONFIG_FILE_LOCKING */
1204 1205
1206static inline struct inode *file_inode(const struct file *f)
1207{
1208 return f->f_inode;
1209}
1210
1211static inline int posix_lock_file_wait(struct file *filp, struct file_lock *fl)
1212{
1213 return posix_lock_inode_wait(file_inode(filp), fl);
1214}
1215
1216static inline int flock_lock_file_wait(struct file *filp, struct file_lock *fl)
1217{
1218 return flock_lock_inode_wait(file_inode(filp), fl);
1219}
1205 1220
1206struct fasync_struct { 1221struct fasync_struct {
1207 spinlock_t fa_lock; 1222 spinlock_t fa_lock;
@@ -2011,11 +2026,6 @@ extern void ihold(struct inode * inode);
2011extern void iput(struct inode *); 2026extern void iput(struct inode *);
2012extern int generic_update_time(struct inode *, struct timespec *, int); 2027extern int generic_update_time(struct inode *, struct timespec *, int);
2013 2028
2014static inline struct inode *file_inode(const struct file *f)
2015{
2016 return f->f_inode;
2017}
2018
2019/* /sys/fs */ 2029/* /sys/fs */
2020extern struct kobject *fs_kobj; 2030extern struct kobject *fs_kobj;
2021 2031