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.h39
1 files changed, 32 insertions, 7 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 240eb1d4f876..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,6 +33,12 @@
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 unsigned long nr_files; /* read only */ 44 unsigned long nr_files; /* read only */
@@ -317,6 +324,7 @@ struct inodes_stat_t {
317#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 */
318#define FIFREEZE _IOWR('X', 119, int) /* Freeze */ 325#define FIFREEZE _IOWR('X', 119, int) /* Freeze */
319#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 */
320 328
321#define FS_IOC_GETFLAGS _IOR('f', 1, long) 329#define FS_IOC_GETFLAGS _IOR('f', 1, long)
322#define FS_IOC_SETFLAGS _IOW('f', 2, long) 330#define FS_IOC_SETFLAGS _IOW('f', 2, long)
@@ -1048,7 +1056,6 @@ struct lock_manager_operations {
1048 int (*fl_compare_owner)(struct file_lock *, struct file_lock *); 1056 int (*fl_compare_owner)(struct file_lock *, struct file_lock *);
1049 void (*fl_notify)(struct file_lock *); /* unblock callback */ 1057 void (*fl_notify)(struct file_lock *); /* unblock callback */
1050 int (*fl_grant)(struct file_lock *, struct file_lock *, int); 1058 int (*fl_grant)(struct file_lock *, struct file_lock *, int);
1051 void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
1052 void (*fl_release_private)(struct file_lock *); 1059 void (*fl_release_private)(struct file_lock *);
1053 void (*fl_break)(struct file_lock *); 1060 void (*fl_break)(struct file_lock *);
1054 int (*fl_mylease)(struct file_lock *, struct file_lock *); 1061 int (*fl_mylease)(struct file_lock *, struct file_lock *);
@@ -1121,7 +1128,9 @@ extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
1121extern int fcntl_getlease(struct file *filp); 1128extern int fcntl_getlease(struct file *filp);
1122 1129
1123/* fs/locks.c */ 1130/* fs/locks.c */
1131void locks_free_lock(struct file_lock *fl);
1124extern void locks_init_lock(struct file_lock *); 1132extern void locks_init_lock(struct file_lock *);
1133extern struct file_lock * locks_alloc_lock(void);
1125extern void locks_copy_lock(struct file_lock *, struct file_lock *); 1134extern void locks_copy_lock(struct file_lock *, struct file_lock *);
1126extern void __locks_copy_lock(struct file_lock *, const struct file_lock *); 1135extern void __locks_copy_lock(struct file_lock *, const struct file_lock *);
1127extern void locks_remove_posix(struct file *, fl_owner_t); 1136extern void locks_remove_posix(struct file *, fl_owner_t);
@@ -1310,6 +1319,11 @@ struct fasync_struct {
1310 1319
1311/* SMP safe fasync helpers: */ 1320/* SMP safe fasync helpers: */
1312extern 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
1313/* can be called from interrupts */ 1327/* can be called from interrupts */
1314extern void kill_fasync(struct fasync_struct **, int, int); 1328extern void kill_fasync(struct fasync_struct **, int, int);
1315 1329
@@ -1598,6 +1612,7 @@ struct super_operations {
1598 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);
1599#endif 1613#endif
1600 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 *);
1601}; 1616};
1602 1617
1603/* 1618/*
@@ -1757,6 +1772,8 @@ struct file_system_type {
1757 int fs_flags; 1772 int fs_flags;
1758 int (*get_sb) (struct file_system_type *, int, 1773 int (*get_sb) (struct file_system_type *, int,
1759 const char *, void *, struct vfsmount *); 1774 const char *, void *, struct vfsmount *);
1775 struct dentry *(*mount) (struct file_system_type *, int,
1776 const char *, void *);
1760 void (*kill_sb) (struct super_block *); 1777 void (*kill_sb) (struct super_block *);
1761 struct module *owner; 1778 struct module *owner;
1762 struct file_system_type * next; 1779 struct file_system_type * next;
@@ -1772,17 +1789,25 @@ struct file_system_type {
1772 struct lock_class_key i_alloc_sem_key; 1789 struct lock_class_key i_alloc_sem_key;
1773}; 1790};
1774 1791
1775extern 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,
1776 int (*fill_super)(struct super_block *, void *, int), 1793 void *data, int (*fill_super)(struct super_block *, void *, int));
1777 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));
1778extern int get_sb_bdev(struct file_system_type *fs_type, 1797extern int get_sb_bdev(struct file_system_type *fs_type,
1779 int flags, const char *dev_name, void *data, 1798 int flags, const char *dev_name, void *data,
1780 int (*fill_super)(struct super_block *, void *, int), 1799 int (*fill_super)(struct super_block *, void *, int),
1781 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));
1782extern int get_sb_single(struct file_system_type *fs_type, 1804extern int get_sb_single(struct file_system_type *fs_type,
1783 int flags, void *data, 1805 int flags, void *data,
1784 int (*fill_super)(struct super_block *, void *, int), 1806 int (*fill_super)(struct super_block *, void *, int),
1785 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));
1786extern int get_sb_nodev(struct file_system_type *fs_type, 1811extern int get_sb_nodev(struct file_system_type *fs_type,
1787 int flags, void *data, 1812 int flags, void *data,
1788 int (*fill_super)(struct super_block *, void *, int), 1813 int (*fill_super)(struct super_block *, void *, int),
@@ -1798,9 +1823,8 @@ struct super_block *sget(struct file_system_type *type,
1798 int (*test)(struct super_block *,void *), 1823 int (*test)(struct super_block *,void *),
1799 int (*set)(struct super_block *,void *), 1824 int (*set)(struct super_block *,void *),
1800 void *data); 1825 void *data);
1801extern int get_sb_pseudo(struct file_system_type *, char *, 1826extern struct dentry *mount_pseudo(struct file_system_type *, char *,
1802 const struct super_operations *ops, unsigned long, 1827 const struct super_operations *ops, unsigned long);
1803 struct vfsmount *mnt);
1804extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); 1828extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
1805 1829
1806static inline void sb_mark_dirty(struct super_block *sb) 1830static inline void sb_mark_dirty(struct super_block *sb)
@@ -1843,6 +1867,7 @@ extern int current_umask(void);
1843/* /sys/fs */ 1867/* /sys/fs */
1844extern struct kobject *fs_kobj; 1868extern struct kobject *fs_kobj;
1845 1869
1870#define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK)
1846extern int rw_verify_area(int, struct file *, loff_t *, size_t); 1871extern int rw_verify_area(int, struct file *, loff_t *, size_t);
1847 1872
1848#define FLOCK_VERIFY_READ 1 1873#define FLOCK_VERIFY_READ 1