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.h47
1 files changed, 26 insertions, 21 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 63d069bd80b7..4f34ff6e5558 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -135,12 +135,12 @@ struct inodes_stat_t {
135 * immediately after submission. The write equivalent 135 * immediately after submission. The write equivalent
136 * of READ_SYNC. 136 * of READ_SYNC.
137 * WRITE_ODIRECT_PLUG Special case write for O_DIRECT only. 137 * WRITE_ODIRECT_PLUG Special case write for O_DIRECT only.
138 * WRITE_BARRIER Like WRITE_SYNC, but tells the block layer that all 138 * WRITE_FLUSH Like WRITE_SYNC but with preceding cache flush.
139 * previously submitted writes must be safely on storage 139 * WRITE_FUA Like WRITE_SYNC but data is guaranteed to be on
140 * before this one is started. Also guarantees that when 140 * non-volatile media on completion.
141 * this write is complete, it itself is also safely on 141 * WRITE_FLUSH_FUA Combination of WRITE_FLUSH and FUA. The IO is preceded
142 * storage. Prevents reordering of writes on both sides 142 * by a cache flush and data is guaranteed to be on
143 * of this IO. 143 * non-volatile media on completion.
144 * 144 *
145 */ 145 */
146#define RW_MASK REQ_WRITE 146#define RW_MASK REQ_WRITE
@@ -156,16 +156,12 @@ struct inodes_stat_t {
156#define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG) 156#define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG)
157#define WRITE_ODIRECT_PLUG (WRITE | REQ_SYNC) 157#define WRITE_ODIRECT_PLUG (WRITE | REQ_SYNC)
158#define WRITE_META (WRITE | REQ_META) 158#define WRITE_META (WRITE | REQ_META)
159#define WRITE_BARRIER (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ 159#define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \
160 REQ_HARDBARRIER) 160 REQ_FLUSH)
161 161#define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \
162/* 162 REQ_FUA)
163 * These aren't really reads or writes, they pass down information about 163#define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \
164 * parts of device that are now unused by the file system. 164 REQ_FLUSH | REQ_FUA)
165 */
166#define DISCARD_NOBARRIER (WRITE | REQ_DISCARD)
167#define DISCARD_BARRIER (WRITE | REQ_DISCARD | REQ_HARDBARRIER)
168#define DISCARD_SECURE (DISCARD_NOBARRIER | REQ_SECURE)
169 165
170#define SEL_IN 1 166#define SEL_IN 1
171#define SEL_OUT 2 167#define SEL_OUT 2
@@ -1093,10 +1089,6 @@ struct file_lock {
1093 1089
1094#include <linux/fcntl.h> 1090#include <linux/fcntl.h>
1095 1091
1096/* temporary stubs for BKL removal */
1097#define lock_flocks() lock_kernel()
1098#define unlock_flocks() unlock_kernel()
1099
1100extern void send_sigio(struct fown_struct *fown, int fd, int band); 1092extern void send_sigio(struct fown_struct *fown, int fd, int band);
1101 1093
1102#ifdef CONFIG_FILE_LOCKING 1094#ifdef CONFIG_FILE_LOCKING
@@ -1135,6 +1127,8 @@ extern int vfs_setlease(struct file *, long, struct file_lock **);
1135extern int lease_modify(struct file_lock **, int); 1127extern int lease_modify(struct file_lock **, int);
1136extern int lock_may_read(struct inode *, loff_t start, unsigned long count); 1128extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
1137extern int lock_may_write(struct inode *, loff_t start, unsigned long count); 1129extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
1130extern void lock_flocks(void);
1131extern void unlock_flocks(void);
1138#else /* !CONFIG_FILE_LOCKING */ 1132#else /* !CONFIG_FILE_LOCKING */
1139static inline int fcntl_getlk(struct file *file, struct flock __user *user) 1133static inline int fcntl_getlk(struct file *file, struct flock __user *user)
1140{ 1134{
@@ -1277,6 +1271,14 @@ static inline int lock_may_write(struct inode *inode, loff_t start,
1277 return 1; 1271 return 1;
1278} 1272}
1279 1273
1274static inline void lock_flocks(void)
1275{
1276}
1277
1278static inline void unlock_flocks(void)
1279{
1280}
1281
1280#endif /* !CONFIG_FILE_LOCKING */ 1282#endif /* !CONFIG_FILE_LOCKING */
1281 1283
1282 1284
@@ -1384,7 +1386,7 @@ struct super_block {
1384 * Saved mount options for lazy filesystems using 1386 * Saved mount options for lazy filesystems using
1385 * generic_show_options() 1387 * generic_show_options()
1386 */ 1388 */
1387 char *s_options; 1389 char __rcu *s_options;
1388}; 1390};
1389 1391
1390extern struct timespec current_fs_time(struct super_block *sb); 1392extern struct timespec current_fs_time(struct super_block *sb);
@@ -2378,6 +2380,8 @@ extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos,
2378 2380
2379extern int generic_file_fsync(struct file *, int); 2381extern int generic_file_fsync(struct file *, int);
2380 2382
2383extern int generic_check_addressable(unsigned, u64);
2384
2381#ifdef CONFIG_MIGRATION 2385#ifdef CONFIG_MIGRATION
2382extern int buffer_migrate_page(struct address_space *, 2386extern int buffer_migrate_page(struct address_space *,
2383 struct page *, struct page *); 2387 struct page *, struct page *);
@@ -2454,6 +2458,7 @@ static const struct file_operations __fops = { \
2454 .release = simple_attr_release, \ 2458 .release = simple_attr_release, \
2455 .read = simple_attr_read, \ 2459 .read = simple_attr_read, \
2456 .write = simple_attr_write, \ 2460 .write = simple_attr_write, \
2461 .llseek = generic_file_llseek, \
2457}; 2462};
2458 2463
2459static inline void __attribute__((format(printf, 1, 2))) 2464static inline void __attribute__((format(printf, 1, 2)))