aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorJeff Layton <jeff.layton@primarydata.com>2015-07-11 06:43:03 -0400
committerJeff Layton <jeff.layton@primarydata.com>2015-07-13 06:29:11 -0400
commitee296d7c5709440f8abd36b5b65c6b3e388538d9 (patch)
treedf7ad7994f512987b2b10102dea5b2586b14efcd /include/linux/fs.h
parent83bfff23e9ed19f37c4ef0bba84e75bd88e5cf21 (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.h32
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 *);
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_inode_wait(struct inode *, struct file_lock *); 1049extern int posix_lock_inode_wait(struct inode *, struct file_lock *);
1050extern int posix_lock_file_wait(struct file *, struct file_lock *);
1051extern int posix_unblock_lock(struct file_lock *); 1050extern int posix_unblock_lock(struct file_lock *);
1052extern int vfs_test_lock(struct file *, struct file_lock *); 1051extern int vfs_test_lock(struct file *, struct file_lock *);
1053extern 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 *);
1054extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); 1053extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
1055extern int flock_lock_inode_wait(struct inode *inode, struct file_lock *fl); 1054extern int flock_lock_inode_wait(struct inode *inode, struct file_lock *fl);
1056extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
1057extern 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);
1058extern void lease_get_mtime(struct inode *, struct timespec *time); 1056extern void lease_get_mtime(struct inode *, struct timespec *time);
1059extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); 1057extern 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
1148static inline int posix_lock_file_wait(struct file *filp, struct file_lock *fl)
1149{
1150 return -ENOLCK;
1151}
1152
1153static inline int posix_unblock_lock(struct file_lock *waiter) 1146static 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
1180static inline int flock_lock_file_wait(struct file *filp,
1181 struct file_lock *request)
1182{
1183 return -ENOLCK;
1184}
1185
1186static inline int __break_lease(struct inode *inode, unsigned int mode, unsigned int type) 1173static 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
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}
1219 1220
1220struct fasync_struct { 1221struct fasync_struct {
1221 spinlock_t fa_lock; 1222 spinlock_t fa_lock;
@@ -2025,11 +2026,6 @@ extern void ihold(struct inode * inode);
2025extern void iput(struct inode *); 2026extern void iput(struct inode *);
2026extern int generic_update_time(struct inode *, struct timespec *, int); 2027extern int generic_update_time(struct inode *, struct timespec *, int);
2027 2028
2028static inline struct inode *file_inode(const struct file *f)
2029{
2030 return f->f_inode;
2031}
2032
2033/* /sys/fs */ 2029/* /sys/fs */
2034extern struct kobject *fs_kobj; 2030extern struct kobject *fs_kobj;
2035 2031