diff options
Diffstat (limited to 'include/linux/fs.h')
| -rw-r--r-- | include/linux/fs.h | 30 |
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 *); | |||
| 1046 | extern void locks_release_private(struct file_lock *); | 1046 | extern void locks_release_private(struct file_lock *); |
| 1047 | extern void posix_test_lock(struct file *, struct file_lock *); | 1047 | extern void posix_test_lock(struct file *, struct file_lock *); |
| 1048 | extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); | 1048 | extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); |
| 1049 | extern int posix_lock_file_wait(struct file *, struct file_lock *); | 1049 | extern int posix_lock_inode_wait(struct inode *, struct file_lock *); |
| 1050 | extern int posix_unblock_lock(struct file_lock *); | 1050 | extern int posix_unblock_lock(struct file_lock *); |
| 1051 | extern int vfs_test_lock(struct file *, struct file_lock *); | 1051 | extern int vfs_test_lock(struct file *, struct file_lock *); |
| 1052 | extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *); | 1052 | extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *); |
| 1053 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); | 1053 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); |
| 1054 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); | 1054 | extern int flock_lock_inode_wait(struct inode *inode, struct file_lock *fl); |
| 1055 | extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type); | 1055 | extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type); |
| 1056 | extern void lease_get_mtime(struct inode *, struct timespec *time); | 1056 | extern void lease_get_mtime(struct inode *, struct timespec *time); |
| 1057 | extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); | 1057 | extern 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 | ||
| 1140 | static inline int posix_lock_file_wait(struct file *filp, struct file_lock *fl) | 1140 | static 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 | ||
| 1166 | static inline int flock_lock_file_wait(struct file *filp, | 1167 | static 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 | ||
| 1206 | static inline struct inode *file_inode(const struct file *f) | ||
| 1207 | { | ||
| 1208 | return f->f_inode; | ||
| 1209 | } | ||
| 1210 | |||
| 1211 | static 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 | |||
| 1216 | static 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 | ||
| 1206 | struct fasync_struct { | 1221 | struct fasync_struct { |
| 1207 | spinlock_t fa_lock; | 1222 | spinlock_t fa_lock; |
| @@ -2011,11 +2026,6 @@ extern void ihold(struct inode * inode); | |||
| 2011 | extern void iput(struct inode *); | 2026 | extern void iput(struct inode *); |
| 2012 | extern int generic_update_time(struct inode *, struct timespec *, int); | 2027 | extern int generic_update_time(struct inode *, struct timespec *, int); |
| 2013 | 2028 | ||
| 2014 | static inline struct inode *file_inode(const struct file *f) | ||
| 2015 | { | ||
| 2016 | return f->f_inode; | ||
| 2017 | } | ||
| 2018 | |||
| 2019 | /* /sys/fs */ | 2029 | /* /sys/fs */ |
| 2020 | extern struct kobject *fs_kobj; | 2030 | extern struct kobject *fs_kobj; |
| 2021 | 2031 | ||
