diff options
author | Jeff Layton <jeff.layton@primarydata.com> | 2015-07-11 06:43:03 -0400 |
---|---|---|
committer | Jeff Layton <jeff.layton@primarydata.com> | 2015-07-13 06:29:11 -0400 |
commit | ee296d7c5709440f8abd36b5b65c6b3e388538d9 (patch) | |
tree | df7ad7994f512987b2b10102dea5b2586b14efcd /include/linux/fs.h | |
parent | 83bfff23e9ed19f37c4ef0bba84e75bd88e5cf21 (diff) |
locks: inline posix_lock_file_wait and flock_lock_file_wait
They just call file_inode and then the corresponding *_inode_file_wait
function. Just make them static inlines instead.
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 4c990edd1377..cc008c338f5a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1047,13 +1047,11 @@ 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_inode_wait(struct inode *, struct file_lock *); | 1049 | extern int posix_lock_inode_wait(struct inode *, struct file_lock *); |
1050 | extern int posix_lock_file_wait(struct file *, struct file_lock *); | ||
1051 | extern int posix_unblock_lock(struct file_lock *); | 1050 | extern int posix_unblock_lock(struct file_lock *); |
1052 | extern int vfs_test_lock(struct file *, struct file_lock *); | 1051 | extern int vfs_test_lock(struct file *, struct file_lock *); |
1053 | 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 *); |
1054 | 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); |
1055 | extern int flock_lock_inode_wait(struct inode *inode, struct file_lock *fl); | 1054 | extern int flock_lock_inode_wait(struct inode *inode, struct file_lock *fl); |
1056 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); | ||
1057 | 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); |
1058 | extern void lease_get_mtime(struct inode *, struct timespec *time); | 1056 | extern void lease_get_mtime(struct inode *, struct timespec *time); |
1059 | 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); |
@@ -1145,11 +1143,6 @@ static inline int posix_lock_inode_wait(struct inode *inode, | |||
1145 | return -ENOLCK; | 1143 | return -ENOLCK; |
1146 | } | 1144 | } |
1147 | 1145 | ||
1148 | static inline int posix_lock_file_wait(struct file *filp, struct file_lock *fl) | ||
1149 | { | ||
1150 | return -ENOLCK; | ||
1151 | } | ||
1152 | |||
1153 | static inline int posix_unblock_lock(struct file_lock *waiter) | 1146 | static inline int posix_unblock_lock(struct file_lock *waiter) |
1154 | { | 1147 | { |
1155 | return -ENOENT; | 1148 | return -ENOENT; |
@@ -1177,12 +1170,6 @@ static inline int flock_lock_inode_wait(struct inode *inode, | |||
1177 | return -ENOLCK; | 1170 | return -ENOLCK; |
1178 | } | 1171 | } |
1179 | 1172 | ||
1180 | static inline int flock_lock_file_wait(struct file *filp, | ||
1181 | struct file_lock *request) | ||
1182 | { | ||
1183 | return -ENOLCK; | ||
1184 | } | ||
1185 | |||
1186 | static inline int __break_lease(struct inode *inode, unsigned int mode, unsigned int type) | 1173 | static inline int __break_lease(struct inode *inode, unsigned int mode, unsigned int type) |
1187 | { | 1174 | { |
1188 | return 0; | 1175 | return 0; |
@@ -1216,6 +1203,20 @@ static inline void show_fd_locks(struct seq_file *f, | |||
1216 | struct file *filp, struct files_struct *files) {} | 1203 | struct file *filp, struct files_struct *files) {} |
1217 | #endif /* !CONFIG_FILE_LOCKING */ | 1204 | #endif /* !CONFIG_FILE_LOCKING */ |
1218 | 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 | } | ||
1219 | 1220 | ||
1220 | struct fasync_struct { | 1221 | struct fasync_struct { |
1221 | spinlock_t fa_lock; | 1222 | spinlock_t fa_lock; |
@@ -2025,11 +2026,6 @@ extern void ihold(struct inode * inode); | |||
2025 | extern void iput(struct inode *); | 2026 | extern void iput(struct inode *); |
2026 | extern int generic_update_time(struct inode *, struct timespec *, int); | 2027 | extern int generic_update_time(struct inode *, struct timespec *, int); |
2027 | 2028 | ||
2028 | static inline struct inode *file_inode(const struct file *f) | ||
2029 | { | ||
2030 | return f->f_inode; | ||
2031 | } | ||
2032 | |||
2033 | /* /sys/fs */ | 2029 | /* /sys/fs */ |
2034 | extern struct kobject *fs_kobj; | 2030 | extern struct kobject *fs_kobj; |
2035 | 2031 | ||