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.h139
1 files changed, 95 insertions, 44 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 63d069bd80b7..334d68a17108 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -9,6 +9,7 @@
9#include <linux/limits.h> 9#include <linux/limits.h>
10#include <linux/ioctl.h> 10#include <linux/ioctl.h>
11#include <linux/blk_types.h> 11#include <linux/blk_types.h>
12#include <linux/types.h>
12 13
13/* 14/*
14 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change 15 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
@@ -32,11 +33,17 @@
32#define SEEK_END 2 /* seek relative to end of file */ 33#define SEEK_END 2 /* seek relative to end of file */
33#define SEEK_MAX SEEK_END 34#define SEEK_MAX SEEK_END
34 35
36struct fstrim_range {
37 uint64_t start;
38 uint64_t len;
39 uint64_t minlen;
40};
41
35/* And dynamically-tunable limits and defaults: */ 42/* And dynamically-tunable limits and defaults: */
36struct files_stat_struct { 43struct files_stat_struct {
37 int nr_files; /* read only */ 44 unsigned long nr_files; /* read only */
38 int nr_free_files; /* read only */ 45 unsigned long nr_free_files; /* read only */
39 int max_files; /* tunable */ 46 unsigned long max_files; /* tunable */
40}; 47};
41 48
42struct inodes_stat_t { 49struct inodes_stat_t {
@@ -92,6 +99,9 @@ struct inodes_stat_t {
92/* Expect random access pattern */ 99/* Expect random access pattern */
93#define FMODE_RANDOM ((__force fmode_t)0x1000) 100#define FMODE_RANDOM ((__force fmode_t)0x1000)
94 101
102/* File is huge (eg. /dev/kmem): treat loff_t as unsigned */
103#define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000)
104
95/* File was opened by fanotify and shouldn't generate fanotify events */ 105/* File was opened by fanotify and shouldn't generate fanotify events */
96#define FMODE_NONOTIFY ((__force fmode_t)0x1000000) 106#define FMODE_NONOTIFY ((__force fmode_t)0x1000000)
97 107
@@ -135,12 +145,12 @@ struct inodes_stat_t {
135 * immediately after submission. The write equivalent 145 * immediately after submission. The write equivalent
136 * of READ_SYNC. 146 * of READ_SYNC.
137 * WRITE_ODIRECT_PLUG Special case write for O_DIRECT only. 147 * WRITE_ODIRECT_PLUG Special case write for O_DIRECT only.
138 * WRITE_BARRIER Like WRITE_SYNC, but tells the block layer that all 148 * WRITE_FLUSH Like WRITE_SYNC but with preceding cache flush.
139 * previously submitted writes must be safely on storage 149 * WRITE_FUA Like WRITE_SYNC but data is guaranteed to be on
140 * before this one is started. Also guarantees that when 150 * non-volatile media on completion.
141 * this write is complete, it itself is also safely on 151 * WRITE_FLUSH_FUA Combination of WRITE_FLUSH and FUA. The IO is preceded
142 * storage. Prevents reordering of writes on both sides 152 * by a cache flush and data is guaranteed to be on
143 * of this IO. 153 * non-volatile media on completion.
144 * 154 *
145 */ 155 */
146#define RW_MASK REQ_WRITE 156#define RW_MASK REQ_WRITE
@@ -156,16 +166,12 @@ struct inodes_stat_t {
156#define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG) 166#define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG)
157#define WRITE_ODIRECT_PLUG (WRITE | REQ_SYNC) 167#define WRITE_ODIRECT_PLUG (WRITE | REQ_SYNC)
158#define WRITE_META (WRITE | REQ_META) 168#define WRITE_META (WRITE | REQ_META)
159#define WRITE_BARRIER (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ 169#define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \
160 REQ_HARDBARRIER) 170 REQ_FLUSH)
161 171#define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \
162/* 172 REQ_FUA)
163 * These aren't really reads or writes, they pass down information about 173#define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \
164 * parts of device that are now unused by the file system. 174 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 175
170#define SEL_IN 1 176#define SEL_IN 1
171#define SEL_OUT 2 177#define SEL_OUT 2
@@ -235,6 +241,7 @@ struct inodes_stat_t {
235#define S_NOCMTIME 128 /* Do not update file c/mtime */ 241#define S_NOCMTIME 128 /* Do not update file c/mtime */
236#define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */ 242#define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */
237#define S_PRIVATE 512 /* Inode is fs-internal */ 243#define S_PRIVATE 512 /* Inode is fs-internal */
244#define S_IMA 1024 /* Inode has an associated IMA struct */
238 245
239/* 246/*
240 * Note that nosuid etc flags are inode-specific: setting some file-system 247 * Note that nosuid etc flags are inode-specific: setting some file-system
@@ -269,6 +276,7 @@ struct inodes_stat_t {
269#define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME) 276#define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME)
270#define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE) 277#define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE)
271#define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE) 278#define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE)
279#define IS_IMA(inode) ((inode)->i_flags & S_IMA)
272 280
273/* the read-only stuff doesn't really belong here, but any other place is 281/* the read-only stuff doesn't really belong here, but any other place is
274 probably as bad and I don't want to create yet another include file. */ 282 probably as bad and I don't want to create yet another include file. */
@@ -316,6 +324,7 @@ struct inodes_stat_t {
316#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ 324#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */
317#define FIFREEZE _IOWR('X', 119, int) /* Freeze */ 325#define FIFREEZE _IOWR('X', 119, int) /* Freeze */
318#define FITHAW _IOWR('X', 120, int) /* Thaw */ 326#define FITHAW _IOWR('X', 120, int) /* Thaw */
327#define FITRIM _IOWR('X', 121, struct fstrim_range) /* Trim */
319 328
320#define FS_IOC_GETFLAGS _IOR('f', 1, long) 329#define FS_IOC_GETFLAGS _IOR('f', 1, long)
321#define FS_IOC_SETFLAGS _IOW('f', 2, long) 330#define FS_IOC_SETFLAGS _IOW('f', 2, long)
@@ -404,7 +413,7 @@ extern void __init inode_init_early(void);
404extern void __init files_init(unsigned long); 413extern void __init files_init(unsigned long);
405 414
406extern struct files_stat_struct files_stat; 415extern struct files_stat_struct files_stat;
407extern int get_max_files(void); 416extern unsigned long get_max_files(void);
408extern int sysctl_nr_open; 417extern int sysctl_nr_open;
409extern struct inodes_stat_t inodes_stat; 418extern struct inodes_stat_t inodes_stat;
410extern int leases_enable, lease_break_time; 419extern int leases_enable, lease_break_time;
@@ -724,7 +733,8 @@ struct posix_acl;
724 733
725struct inode { 734struct inode {
726 struct hlist_node i_hash; 735 struct hlist_node i_hash;
727 struct list_head i_list; /* backing dev IO list */ 736 struct list_head i_wb_list; /* backing dev IO list */
737 struct list_head i_lru; /* inode LRU list */
728 struct list_head i_sb_list; 738 struct list_head i_sb_list;
729 struct list_head i_dentry; 739 struct list_head i_dentry;
730 unsigned long i_ino; 740 unsigned long i_ino;
@@ -776,6 +786,10 @@ struct inode {
776 786
777 unsigned int i_flags; 787 unsigned int i_flags;
778 788
789#ifdef CONFIG_IMA
790 /* protected by i_lock */
791 unsigned int i_readcount; /* struct files open RO */
792#endif
779 atomic_t i_writecount; 793 atomic_t i_writecount;
780#ifdef CONFIG_SECURITY 794#ifdef CONFIG_SECURITY
781 void *i_security; 795 void *i_security;
@@ -787,6 +801,11 @@ struct inode {
787 void *i_private; /* fs or device private pointer */ 801 void *i_private; /* fs or device private pointer */
788}; 802};
789 803
804static inline int inode_unhashed(struct inode *inode)
805{
806 return hlist_unhashed(&inode->i_hash);
807}
808
790/* 809/*
791 * inode->i_mutex nesting subclasses for the lock validator: 810 * inode->i_mutex nesting subclasses for the lock validator:
792 * 811 *
@@ -1037,7 +1056,6 @@ struct lock_manager_operations {
1037 int (*fl_compare_owner)(struct file_lock *, struct file_lock *); 1056 int (*fl_compare_owner)(struct file_lock *, struct file_lock *);
1038 void (*fl_notify)(struct file_lock *); /* unblock callback */ 1057 void (*fl_notify)(struct file_lock *); /* unblock callback */
1039 int (*fl_grant)(struct file_lock *, struct file_lock *, int); 1058 int (*fl_grant)(struct file_lock *, struct file_lock *, int);
1040 void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
1041 void (*fl_release_private)(struct file_lock *); 1059 void (*fl_release_private)(struct file_lock *);
1042 void (*fl_break)(struct file_lock *); 1060 void (*fl_break)(struct file_lock *);
1043 int (*fl_mylease)(struct file_lock *, struct file_lock *); 1061 int (*fl_mylease)(struct file_lock *, struct file_lock *);
@@ -1093,10 +1111,6 @@ struct file_lock {
1093 1111
1094#include <linux/fcntl.h> 1112#include <linux/fcntl.h>
1095 1113
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); 1114extern void send_sigio(struct fown_struct *fown, int fd, int band);
1101 1115
1102#ifdef CONFIG_FILE_LOCKING 1116#ifdef CONFIG_FILE_LOCKING
@@ -1114,7 +1128,9 @@ extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
1114extern int fcntl_getlease(struct file *filp); 1128extern int fcntl_getlease(struct file *filp);
1115 1129
1116/* fs/locks.c */ 1130/* fs/locks.c */
1131void locks_free_lock(struct file_lock *fl);
1117extern void locks_init_lock(struct file_lock *); 1132extern void locks_init_lock(struct file_lock *);
1133extern struct file_lock * locks_alloc_lock(void);
1118extern void locks_copy_lock(struct file_lock *, struct file_lock *); 1134extern void locks_copy_lock(struct file_lock *, struct file_lock *);
1119extern void __locks_copy_lock(struct file_lock *, const struct file_lock *); 1135extern void __locks_copy_lock(struct file_lock *, const struct file_lock *);
1120extern void locks_remove_posix(struct file *, fl_owner_t); 1136extern void locks_remove_posix(struct file *, fl_owner_t);
@@ -1135,6 +1151,8 @@ extern int vfs_setlease(struct file *, long, struct file_lock **);
1135extern int lease_modify(struct file_lock **, int); 1151extern int lease_modify(struct file_lock **, int);
1136extern int lock_may_read(struct inode *, loff_t start, unsigned long count); 1152extern 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); 1153extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
1154extern void lock_flocks(void);
1155extern void unlock_flocks(void);
1138#else /* !CONFIG_FILE_LOCKING */ 1156#else /* !CONFIG_FILE_LOCKING */
1139static inline int fcntl_getlk(struct file *file, struct flock __user *user) 1157static inline int fcntl_getlk(struct file *file, struct flock __user *user)
1140{ 1158{
@@ -1277,6 +1295,14 @@ static inline int lock_may_write(struct inode *inode, loff_t start,
1277 return 1; 1295 return 1;
1278} 1296}
1279 1297
1298static inline void lock_flocks(void)
1299{
1300}
1301
1302static inline void unlock_flocks(void)
1303{
1304}
1305
1280#endif /* !CONFIG_FILE_LOCKING */ 1306#endif /* !CONFIG_FILE_LOCKING */
1281 1307
1282 1308
@@ -1293,6 +1319,11 @@ struct fasync_struct {
1293 1319
1294/* SMP safe fasync helpers: */ 1320/* SMP safe fasync helpers: */
1295extern int fasync_helper(int, struct file *, int, struct fasync_struct **); 1321extern int fasync_helper(int, struct file *, int, struct fasync_struct **);
1322extern struct fasync_struct *fasync_insert_entry(int, struct file *, struct fasync_struct **, struct fasync_struct *);
1323extern int fasync_remove_entry(struct file *, struct fasync_struct **);
1324extern struct fasync_struct *fasync_alloc(void);
1325extern void fasync_free(struct fasync_struct *);
1326
1296/* can be called from interrupts */ 1327/* can be called from interrupts */
1297extern void kill_fasync(struct fasync_struct **, int, int); 1328extern void kill_fasync(struct fasync_struct **, int, int);
1298 1329
@@ -1384,7 +1415,7 @@ struct super_block {
1384 * Saved mount options for lazy filesystems using 1415 * Saved mount options for lazy filesystems using
1385 * generic_show_options() 1416 * generic_show_options()
1386 */ 1417 */
1387 char *s_options; 1418 char __rcu *s_options;
1388}; 1419};
1389 1420
1390extern struct timespec current_fs_time(struct super_block *sb); 1421extern struct timespec current_fs_time(struct super_block *sb);
@@ -1581,6 +1612,7 @@ struct super_operations {
1581 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); 1612 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
1582#endif 1613#endif
1583 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); 1614 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
1615 int (*trim_fs) (struct super_block *, struct fstrim_range *);
1584}; 1616};
1585 1617
1586/* 1618/*
@@ -1631,16 +1663,17 @@ struct super_operations {
1631 * 1663 *
1632 * Q: What is the difference between I_WILL_FREE and I_FREEING? 1664 * Q: What is the difference between I_WILL_FREE and I_FREEING?
1633 */ 1665 */
1634#define I_DIRTY_SYNC 1 1666#define I_DIRTY_SYNC (1 << 0)
1635#define I_DIRTY_DATASYNC 2 1667#define I_DIRTY_DATASYNC (1 << 1)
1636#define I_DIRTY_PAGES 4 1668#define I_DIRTY_PAGES (1 << 2)
1637#define __I_NEW 3 1669#define __I_NEW 3
1638#define I_NEW (1 << __I_NEW) 1670#define I_NEW (1 << __I_NEW)
1639#define I_WILL_FREE 16 1671#define I_WILL_FREE (1 << 4)
1640#define I_FREEING 32 1672#define I_FREEING (1 << 5)
1641#define I_CLEAR 64 1673#define I_CLEAR (1 << 6)
1642#define __I_SYNC 7 1674#define __I_SYNC 7
1643#define I_SYNC (1 << __I_SYNC) 1675#define I_SYNC (1 << __I_SYNC)
1676#define I_REFERENCED (1 << 8)
1644 1677
1645#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) 1678#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
1646 1679
@@ -1732,12 +1765,15 @@ static inline void file_accessed(struct file *file)
1732} 1765}
1733 1766
1734int sync_inode(struct inode *inode, struct writeback_control *wbc); 1767int sync_inode(struct inode *inode, struct writeback_control *wbc);
1768int sync_inode_metadata(struct inode *inode, int wait);
1735 1769
1736struct file_system_type { 1770struct file_system_type {
1737 const char *name; 1771 const char *name;
1738 int fs_flags; 1772 int fs_flags;
1739 int (*get_sb) (struct file_system_type *, int, 1773 int (*get_sb) (struct file_system_type *, int,
1740 const char *, void *, struct vfsmount *); 1774 const char *, void *, struct vfsmount *);
1775 struct dentry *(*mount) (struct file_system_type *, int,
1776 const char *, void *);
1741 void (*kill_sb) (struct super_block *); 1777 void (*kill_sb) (struct super_block *);
1742 struct module *owner; 1778 struct module *owner;
1743 struct file_system_type * next; 1779 struct file_system_type * next;
@@ -1753,17 +1789,25 @@ struct file_system_type {
1753 struct lock_class_key i_alloc_sem_key; 1789 struct lock_class_key i_alloc_sem_key;
1754}; 1790};
1755 1791
1756extern int get_sb_ns(struct file_system_type *fs_type, int flags, void *data, 1792extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
1757 int (*fill_super)(struct super_block *, void *, int), 1793 void *data, int (*fill_super)(struct super_block *, void *, int));
1758 struct vfsmount *mnt); 1794extern struct dentry *mount_bdev(struct file_system_type *fs_type,
1795 int flags, const char *dev_name, void *data,
1796 int (*fill_super)(struct super_block *, void *, int));
1759extern int get_sb_bdev(struct file_system_type *fs_type, 1797extern int get_sb_bdev(struct file_system_type *fs_type,
1760 int flags, const char *dev_name, void *data, 1798 int flags, const char *dev_name, void *data,
1761 int (*fill_super)(struct super_block *, void *, int), 1799 int (*fill_super)(struct super_block *, void *, int),
1762 struct vfsmount *mnt); 1800 struct vfsmount *mnt);
1801extern struct dentry *mount_single(struct file_system_type *fs_type,
1802 int flags, void *data,
1803 int (*fill_super)(struct super_block *, void *, int));
1763extern int get_sb_single(struct file_system_type *fs_type, 1804extern int get_sb_single(struct file_system_type *fs_type,
1764 int flags, void *data, 1805 int flags, void *data,
1765 int (*fill_super)(struct super_block *, void *, int), 1806 int (*fill_super)(struct super_block *, void *, int),
1766 struct vfsmount *mnt); 1807 struct vfsmount *mnt);
1808extern struct dentry *mount_nodev(struct file_system_type *fs_type,
1809 int flags, void *data,
1810 int (*fill_super)(struct super_block *, void *, int));
1767extern int get_sb_nodev(struct file_system_type *fs_type, 1811extern int get_sb_nodev(struct file_system_type *fs_type,
1768 int flags, void *data, 1812 int flags, void *data,
1769 int (*fill_super)(struct super_block *, void *, int), 1813 int (*fill_super)(struct super_block *, void *, int),
@@ -1779,9 +1823,8 @@ struct super_block *sget(struct file_system_type *type,
1779 int (*test)(struct super_block *,void *), 1823 int (*test)(struct super_block *,void *),
1780 int (*set)(struct super_block *,void *), 1824 int (*set)(struct super_block *,void *),
1781 void *data); 1825 void *data);
1782extern int get_sb_pseudo(struct file_system_type *, char *, 1826extern struct dentry *mount_pseudo(struct file_system_type *, char *,
1783 const struct super_operations *ops, unsigned long, 1827 const struct super_operations *ops, unsigned long);
1784 struct vfsmount *mnt);
1785extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); 1828extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
1786 1829
1787static inline void sb_mark_dirty(struct super_block *sb) 1830static inline void sb_mark_dirty(struct super_block *sb)
@@ -1824,6 +1867,7 @@ extern int current_umask(void);
1824/* /sys/fs */ 1867/* /sys/fs */
1825extern struct kobject *fs_kobj; 1868extern struct kobject *fs_kobj;
1826 1869
1870#define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK)
1827extern int rw_verify_area(int, struct file *, loff_t *, size_t); 1871extern int rw_verify_area(int, struct file *, loff_t *, size_t);
1828 1872
1829#define FLOCK_VERIFY_READ 1 1873#define FLOCK_VERIFY_READ 1
@@ -2076,7 +2120,6 @@ extern int check_disk_change(struct block_device *);
2076extern int __invalidate_device(struct block_device *); 2120extern int __invalidate_device(struct block_device *);
2077extern int invalidate_partition(struct gendisk *, int); 2121extern int invalidate_partition(struct gendisk *, int);
2078#endif 2122#endif
2079extern int invalidate_inodes(struct super_block *);
2080unsigned long invalidate_mapping_pages(struct address_space *mapping, 2123unsigned long invalidate_mapping_pages(struct address_space *mapping,
2081 pgoff_t start, pgoff_t end); 2124 pgoff_t start, pgoff_t end);
2082 2125
@@ -2160,7 +2203,7 @@ extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin);
2160 2203
2161extern int inode_init_always(struct super_block *, struct inode *); 2204extern int inode_init_always(struct super_block *, struct inode *);
2162extern void inode_init_once(struct inode *); 2205extern void inode_init_once(struct inode *);
2163extern void inode_add_to_lists(struct super_block *, struct inode *); 2206extern void ihold(struct inode * inode);
2164extern void iput(struct inode *); 2207extern void iput(struct inode *);
2165extern struct inode * igrab(struct inode *); 2208extern struct inode * igrab(struct inode *);
2166extern ino_t iunique(struct super_block *, ino_t); 2209extern ino_t iunique(struct super_block *, ino_t);
@@ -2180,11 +2223,11 @@ extern struct inode * iget_locked(struct super_block *, unsigned long);
2180extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *); 2223extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *);
2181extern int insert_inode_locked(struct inode *); 2224extern int insert_inode_locked(struct inode *);
2182extern void unlock_new_inode(struct inode *); 2225extern void unlock_new_inode(struct inode *);
2226extern unsigned int get_next_ino(void);
2183 2227
2184extern void __iget(struct inode * inode); 2228extern void __iget(struct inode * inode);
2185extern void iget_failed(struct inode *); 2229extern void iget_failed(struct inode *);
2186extern void end_writeback(struct inode *); 2230extern void end_writeback(struct inode *);
2187extern void destroy_inode(struct inode *);
2188extern void __destroy_inode(struct inode *); 2231extern void __destroy_inode(struct inode *);
2189extern struct inode *new_inode(struct super_block *); 2232extern struct inode *new_inode(struct super_block *);
2190extern int should_remove_suid(struct dentry *); 2233extern int should_remove_suid(struct dentry *);
@@ -2192,9 +2235,11 @@ extern int file_remove_suid(struct file *);
2192 2235
2193extern void __insert_inode_hash(struct inode *, unsigned long hashval); 2236extern void __insert_inode_hash(struct inode *, unsigned long hashval);
2194extern void remove_inode_hash(struct inode *); 2237extern void remove_inode_hash(struct inode *);
2195static inline void insert_inode_hash(struct inode *inode) { 2238static inline void insert_inode_hash(struct inode *inode)
2239{
2196 __insert_inode_hash(inode, inode->i_ino); 2240 __insert_inode_hash(inode, inode->i_ino);
2197} 2241}
2242extern void inode_sb_list_add(struct inode *inode);
2198 2243
2199#ifdef CONFIG_BLOCK 2244#ifdef CONFIG_BLOCK
2200extern void submit_bio(int, struct bio *); 2245extern void submit_bio(int, struct bio *);
@@ -2378,6 +2423,8 @@ extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos,
2378 2423
2379extern int generic_file_fsync(struct file *, int); 2424extern int generic_file_fsync(struct file *, int);
2380 2425
2426extern int generic_check_addressable(unsigned, u64);
2427
2381#ifdef CONFIG_MIGRATION 2428#ifdef CONFIG_MIGRATION
2382extern int buffer_migrate_page(struct address_space *, 2429extern int buffer_migrate_page(struct address_space *,
2383 struct page *, struct page *); 2430 struct page *, struct page *);
@@ -2454,6 +2501,7 @@ static const struct file_operations __fops = { \
2454 .release = simple_attr_release, \ 2501 .release = simple_attr_release, \
2455 .read = simple_attr_read, \ 2502 .read = simple_attr_read, \
2456 .write = simple_attr_write, \ 2503 .write = simple_attr_write, \
2504 .llseek = generic_file_llseek, \
2457}; 2505};
2458 2506
2459static inline void __attribute__((format(printf, 1, 2))) 2507static inline void __attribute__((format(printf, 1, 2)))
@@ -2474,7 +2522,10 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf,
2474struct ctl_table; 2522struct ctl_table;
2475int proc_nr_files(struct ctl_table *table, int write, 2523int proc_nr_files(struct ctl_table *table, int write,
2476 void __user *buffer, size_t *lenp, loff_t *ppos); 2524 void __user *buffer, size_t *lenp, loff_t *ppos);
2477 2525int proc_nr_dentry(struct ctl_table *table, int write,
2526 void __user *buffer, size_t *lenp, loff_t *ppos);
2527int proc_nr_inodes(struct ctl_table *table, int write,
2528 void __user *buffer, size_t *lenp, loff_t *ppos);
2478int __init get_filesystem_list(char *buf); 2529int __init get_filesystem_list(char *buf);
2479 2530
2480#define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) 2531#define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE])