diff options
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 220 |
1 files changed, 185 insertions, 35 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 1cd44f727dac..42436ae42f70 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1064,34 +1064,147 @@ extern int lease_modify(struct file_lock **, int); | |||
1064 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); | 1064 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); |
1065 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); | 1065 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); |
1066 | #else /* !CONFIG_FILE_LOCKING */ | 1066 | #else /* !CONFIG_FILE_LOCKING */ |
1067 | #define fcntl_getlk(a, b) ({ -EINVAL; }) | 1067 | static inline int fcntl_getlk(struct file *file, struct flock __user *user) |
1068 | #define fcntl_setlk(a, b, c, d) ({ -EACCES; }) | 1068 | { |
1069 | return -EINVAL; | ||
1070 | } | ||
1071 | |||
1072 | static inline int fcntl_setlk(unsigned int fd, struct file *file, | ||
1073 | unsigned int cmd, struct flock __user *user) | ||
1074 | { | ||
1075 | return -EACCES; | ||
1076 | } | ||
1077 | |||
1069 | #if BITS_PER_LONG == 32 | 1078 | #if BITS_PER_LONG == 32 |
1070 | #define fcntl_getlk64(a, b) ({ -EINVAL; }) | 1079 | static inline int fcntl_getlk64(struct file *file, struct flock64 __user *user) |
1071 | #define fcntl_setlk64(a, b, c, d) ({ -EACCES; }) | 1080 | { |
1081 | return -EINVAL; | ||
1082 | } | ||
1083 | |||
1084 | static inline int fcntl_setlk64(unsigned int fd, struct file *file, | ||
1085 | unsigned int cmd, struct flock64 __user *user) | ||
1086 | { | ||
1087 | return -EACCES; | ||
1088 | } | ||
1072 | #endif | 1089 | #endif |
1073 | #define fcntl_setlease(a, b, c) ({ 0; }) | 1090 | static inline int fcntl_setlease(unsigned int fd, struct file *filp, long arg) |
1074 | #define fcntl_getlease(a) ({ 0; }) | 1091 | { |
1075 | #define locks_init_lock(a) ({ }) | 1092 | return 0; |
1076 | #define __locks_copy_lock(a, b) ({ }) | 1093 | } |
1077 | #define locks_copy_lock(a, b) ({ }) | 1094 | |
1078 | #define locks_remove_posix(a, b) ({ }) | 1095 | static inline int fcntl_getlease(struct file *filp) |
1079 | #define locks_remove_flock(a) ({ }) | 1096 | { |
1080 | #define posix_test_lock(a, b) ({ 0; }) | 1097 | return 0; |
1081 | #define posix_lock_file(a, b, c) ({ -ENOLCK; }) | 1098 | } |
1082 | #define posix_lock_file_wait(a, b) ({ -ENOLCK; }) | 1099 | |
1083 | #define posix_unblock_lock(a, b) (-ENOENT) | 1100 | static inline void locks_init_lock(struct file_lock *fl) |
1084 | #define vfs_test_lock(a, b) ({ 0; }) | 1101 | { |
1085 | #define vfs_lock_file(a, b, c, d) (-ENOLCK) | 1102 | return; |
1086 | #define vfs_cancel_lock(a, b) ({ 0; }) | 1103 | } |
1087 | #define flock_lock_file_wait(a, b) ({ -ENOLCK; }) | 1104 | |
1088 | #define __break_lease(a, b) ({ 0; }) | 1105 | static inline void __locks_copy_lock(struct file_lock *new, struct file_lock *fl) |
1089 | #define lease_get_mtime(a, b) ({ }) | 1106 | { |
1090 | #define generic_setlease(a, b, c) ({ -EINVAL; }) | 1107 | return; |
1091 | #define vfs_setlease(a, b, c) ({ -EINVAL; }) | 1108 | } |
1092 | #define lease_modify(a, b) ({ -EINVAL; }) | 1109 | |
1093 | #define lock_may_read(a, b, c) ({ 1; }) | 1110 | static inline void locks_copy_lock(struct file_lock *new, struct file_lock *fl) |
1094 | #define lock_may_write(a, b, c) ({ 1; }) | 1111 | { |
1112 | return; | ||
1113 | } | ||
1114 | |||
1115 | static inline void locks_remove_posix(struct file *filp, fl_owner_t owner) | ||
1116 | { | ||
1117 | return; | ||
1118 | } | ||
1119 | |||
1120 | static inline void locks_remove_flock(struct file *filp) | ||
1121 | { | ||
1122 | return; | ||
1123 | } | ||
1124 | |||
1125 | static inline void posix_test_lock(struct file *filp, struct file_lock *fl) | ||
1126 | { | ||
1127 | return; | ||
1128 | } | ||
1129 | |||
1130 | static inline int posix_lock_file(struct file *filp, struct file_lock *fl, | ||
1131 | struct file_lock *conflock) | ||
1132 | { | ||
1133 | return -ENOLCK; | ||
1134 | } | ||
1135 | |||
1136 | static inline int posix_lock_file_wait(struct file *filp, struct file_lock *fl) | ||
1137 | { | ||
1138 | return -ENOLCK; | ||
1139 | } | ||
1140 | |||
1141 | static inline int posix_unblock_lock(struct file *filp, | ||
1142 | struct file_lock *waiter) | ||
1143 | { | ||
1144 | return -ENOENT; | ||
1145 | } | ||
1146 | |||
1147 | static inline int vfs_test_lock(struct file *filp, struct file_lock *fl) | ||
1148 | { | ||
1149 | return 0; | ||
1150 | } | ||
1151 | |||
1152 | static inline int vfs_lock_file(struct file *filp, unsigned int cmd, | ||
1153 | struct file_lock *fl, struct file_lock *conf) | ||
1154 | { | ||
1155 | return -ENOLCK; | ||
1156 | } | ||
1157 | |||
1158 | static inline int vfs_cancel_lock(struct file *filp, struct file_lock *fl) | ||
1159 | { | ||
1160 | return 0; | ||
1161 | } | ||
1162 | |||
1163 | static inline int flock_lock_file_wait(struct file *filp, | ||
1164 | struct file_lock *request) | ||
1165 | { | ||
1166 | return -ENOLCK; | ||
1167 | } | ||
1168 | |||
1169 | static inline int __break_lease(struct inode *inode, unsigned int mode) | ||
1170 | { | ||
1171 | return 0; | ||
1172 | } | ||
1173 | |||
1174 | static inline void lease_get_mtime(struct inode *inode, struct timespec *time) | ||
1175 | { | ||
1176 | return; | ||
1177 | } | ||
1178 | |||
1179 | static inline int generic_setlease(struct file *filp, long arg, | ||
1180 | struct file_lock **flp) | ||
1181 | { | ||
1182 | return -EINVAL; | ||
1183 | } | ||
1184 | |||
1185 | static inline int vfs_setlease(struct file *filp, long arg, | ||
1186 | struct file_lock **lease) | ||
1187 | { | ||
1188 | return -EINVAL; | ||
1189 | } | ||
1190 | |||
1191 | static inline int lease_modify(struct file_lock **before, int arg) | ||
1192 | { | ||
1193 | return -EINVAL; | ||
1194 | } | ||
1195 | |||
1196 | static inline int lock_may_read(struct inode *inode, loff_t start, | ||
1197 | unsigned long len) | ||
1198 | { | ||
1199 | return 1; | ||
1200 | } | ||
1201 | |||
1202 | static inline int lock_may_write(struct inode *inode, loff_t start, | ||
1203 | unsigned long len) | ||
1204 | { | ||
1205 | return 1; | ||
1206 | } | ||
1207 | |||
1095 | #endif /* !CONFIG_FILE_LOCKING */ | 1208 | #endif /* !CONFIG_FILE_LOCKING */ |
1096 | 1209 | ||
1097 | 1210 | ||
@@ -1607,7 +1720,7 @@ struct super_block *sget(struct file_system_type *type, | |||
1607 | extern int get_sb_pseudo(struct file_system_type *, char *, | 1720 | extern int get_sb_pseudo(struct file_system_type *, char *, |
1608 | const struct super_operations *ops, unsigned long, | 1721 | const struct super_operations *ops, unsigned long, |
1609 | struct vfsmount *mnt); | 1722 | struct vfsmount *mnt); |
1610 | extern int simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); | 1723 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); |
1611 | int __put_super_and_need_restart(struct super_block *sb); | 1724 | int __put_super_and_need_restart(struct super_block *sb); |
1612 | 1725 | ||
1613 | /* Alas, no aliases. Too much hassle with bringing module.h everywhere */ | 1726 | /* Alas, no aliases. Too much hassle with bringing module.h everywhere */ |
@@ -1688,13 +1801,44 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
1688 | return 0; | 1801 | return 0; |
1689 | } | 1802 | } |
1690 | #else /* !CONFIG_FILE_LOCKING */ | 1803 | #else /* !CONFIG_FILE_LOCKING */ |
1691 | #define locks_mandatory_locked(a) ({ 0; }) | 1804 | static inline int locks_mandatory_locked(struct inode *inode) |
1692 | #define locks_mandatory_area(a, b, c, d, e) ({ 0; }) | 1805 | { |
1693 | #define __mandatory_lock(a) ({ 0; }) | 1806 | return 0; |
1694 | #define mandatory_lock(a) ({ 0; }) | 1807 | } |
1695 | #define locks_verify_locked(a) ({ 0; }) | 1808 | |
1696 | #define locks_verify_truncate(a, b, c) ({ 0; }) | 1809 | static inline int locks_mandatory_area(int rw, struct inode *inode, |
1697 | #define break_lease(a, b) ({ 0; }) | 1810 | struct file *filp, loff_t offset, |
1811 | size_t count) | ||
1812 | { | ||
1813 | return 0; | ||
1814 | } | ||
1815 | |||
1816 | static inline int __mandatory_lock(struct inode *inode) | ||
1817 | { | ||
1818 | return 0; | ||
1819 | } | ||
1820 | |||
1821 | static inline int mandatory_lock(struct inode *inode) | ||
1822 | { | ||
1823 | return 0; | ||
1824 | } | ||
1825 | |||
1826 | static inline int locks_verify_locked(struct inode *inode) | ||
1827 | { | ||
1828 | return 0; | ||
1829 | } | ||
1830 | |||
1831 | static inline int locks_verify_truncate(struct inode *inode, struct file *filp, | ||
1832 | size_t size) | ||
1833 | { | ||
1834 | return 0; | ||
1835 | } | ||
1836 | |||
1837 | static inline int break_lease(struct inode *inode, unsigned int mode) | ||
1838 | { | ||
1839 | return 0; | ||
1840 | } | ||
1841 | |||
1698 | #endif /* CONFIG_FILE_LOCKING */ | 1842 | #endif /* CONFIG_FILE_LOCKING */ |
1699 | 1843 | ||
1700 | /* fs/open.c */ | 1844 | /* fs/open.c */ |
@@ -1731,6 +1875,13 @@ extern void bd_set_size(struct block_device *, loff_t size); | |||
1731 | extern void bd_forget(struct inode *inode); | 1875 | extern void bd_forget(struct inode *inode); |
1732 | extern void bdput(struct block_device *); | 1876 | extern void bdput(struct block_device *); |
1733 | extern struct block_device *open_by_devnum(dev_t, fmode_t); | 1877 | extern struct block_device *open_by_devnum(dev_t, fmode_t); |
1878 | extern void invalidate_bdev(struct block_device *); | ||
1879 | extern int sync_blockdev(struct block_device *bdev); | ||
1880 | extern struct super_block *freeze_bdev(struct block_device *); | ||
1881 | extern int thaw_bdev(struct block_device *bdev, struct super_block *sb); | ||
1882 | extern int fsync_bdev(struct block_device *); | ||
1883 | extern int fsync_super(struct super_block *); | ||
1884 | extern int fsync_no_super(struct block_device *); | ||
1734 | #else | 1885 | #else |
1735 | static inline void bd_forget(struct inode *inode) {} | 1886 | static inline void bd_forget(struct inode *inode) {} |
1736 | #endif | 1887 | #endif |
@@ -1882,7 +2033,6 @@ static inline void allow_write_access(struct file *file) | |||
1882 | if (file) | 2033 | if (file) |
1883 | atomic_inc(&file->f_path.dentry->d_inode->i_writecount); | 2034 | atomic_inc(&file->f_path.dentry->d_inode->i_writecount); |
1884 | } | 2035 | } |
1885 | extern int do_pipe(int *); | ||
1886 | extern int do_pipe_flags(int *, int); | 2036 | extern int do_pipe_flags(int *, int); |
1887 | extern struct file *create_read_pipe(struct file *f, int flags); | 2037 | extern struct file *create_read_pipe(struct file *f, int flags); |
1888 | extern struct file *create_write_pipe(int flags); | 2038 | extern struct file *create_write_pipe(int flags); |