diff options
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 59 |
1 files changed, 38 insertions, 21 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index a3e8f02b727d..af5bd7a629e5 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -242,6 +242,7 @@ struct inodes_stat_t { | |||
242 | #define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */ | 242 | #define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */ |
243 | #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 */ | 244 | #define S_IMA 1024 /* Inode has an associated IMA struct */ |
245 | #define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */ | ||
245 | 246 | ||
246 | /* | 247 | /* |
247 | * Note that nosuid etc flags are inode-specific: setting some file-system | 248 | * Note that nosuid etc flags are inode-specific: setting some file-system |
@@ -277,6 +278,7 @@ struct inodes_stat_t { | |||
277 | #define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE) | 278 | #define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE) |
278 | #define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE) | 279 | #define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE) |
279 | #define IS_IMA(inode) ((inode)->i_flags & S_IMA) | 280 | #define IS_IMA(inode) ((inode)->i_flags & S_IMA) |
281 | #define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT) | ||
280 | 282 | ||
281 | /* the read-only stuff doesn't really belong here, but any other place is | 283 | /* the read-only stuff doesn't really belong here, but any other place is |
282 | probably as bad and I don't want to create yet another include file. */ | 284 | probably as bad and I don't want to create yet another include file. */ |
@@ -382,7 +384,6 @@ struct inodes_stat_t { | |||
382 | #include <linux/path.h> | 384 | #include <linux/path.h> |
383 | #include <linux/stat.h> | 385 | #include <linux/stat.h> |
384 | #include <linux/cache.h> | 386 | #include <linux/cache.h> |
385 | #include <linux/kobject.h> | ||
386 | #include <linux/list.h> | 387 | #include <linux/list.h> |
387 | #include <linux/radix-tree.h> | 388 | #include <linux/radix-tree.h> |
388 | #include <linux/prio_tree.h> | 389 | #include <linux/prio_tree.h> |
@@ -402,6 +403,7 @@ struct hd_geometry; | |||
402 | struct iovec; | 403 | struct iovec; |
403 | struct nameidata; | 404 | struct nameidata; |
404 | struct kiocb; | 405 | struct kiocb; |
406 | struct kobject; | ||
405 | struct pipe_inode_info; | 407 | struct pipe_inode_info; |
406 | struct poll_table_struct; | 408 | struct poll_table_struct; |
407 | struct kstatfs; | 409 | struct kstatfs; |
@@ -647,6 +649,7 @@ struct address_space { | |||
647 | spinlock_t private_lock; /* for use by the address_space */ | 649 | spinlock_t private_lock; /* for use by the address_space */ |
648 | struct list_head private_list; /* ditto */ | 650 | struct list_head private_list; /* ditto */ |
649 | struct address_space *assoc_mapping; /* ditto */ | 651 | struct address_space *assoc_mapping; /* ditto */ |
652 | struct mutex unmap_mutex; /* to protect unmapping */ | ||
650 | } __attribute__((aligned(sizeof(long)))); | 653 | } __attribute__((aligned(sizeof(long)))); |
651 | /* | 654 | /* |
652 | * On most architectures that alignment is already the case; but | 655 | * On most architectures that alignment is already the case; but |
@@ -664,8 +667,9 @@ struct block_device { | |||
664 | void * bd_claiming; | 667 | void * bd_claiming; |
665 | void * bd_holder; | 668 | void * bd_holder; |
666 | int bd_holders; | 669 | int bd_holders; |
670 | bool bd_write_holder; | ||
667 | #ifdef CONFIG_SYSFS | 671 | #ifdef CONFIG_SYSFS |
668 | struct list_head bd_holder_list; | 672 | struct list_head bd_holder_disks; |
669 | #endif | 673 | #endif |
670 | struct block_device * bd_contains; | 674 | struct block_device * bd_contains; |
671 | unsigned bd_block_size; | 675 | unsigned bd_block_size; |
@@ -1064,7 +1068,6 @@ struct lock_manager_operations { | |||
1064 | int (*fl_grant)(struct file_lock *, struct file_lock *, int); | 1068 | int (*fl_grant)(struct file_lock *, struct file_lock *, int); |
1065 | void (*fl_release_private)(struct file_lock *); | 1069 | void (*fl_release_private)(struct file_lock *); |
1066 | void (*fl_break)(struct file_lock *); | 1070 | void (*fl_break)(struct file_lock *); |
1067 | int (*fl_mylease)(struct file_lock *, struct file_lock *); | ||
1068 | int (*fl_change)(struct file_lock **, int); | 1071 | int (*fl_change)(struct file_lock **, int); |
1069 | }; | 1072 | }; |
1070 | 1073 | ||
@@ -1422,6 +1425,7 @@ struct super_block { | |||
1422 | * generic_show_options() | 1425 | * generic_show_options() |
1423 | */ | 1426 | */ |
1424 | char __rcu *s_options; | 1427 | char __rcu *s_options; |
1428 | const struct dentry_operations *s_d_op; /* default d_op for dentries */ | ||
1425 | }; | 1429 | }; |
1426 | 1430 | ||
1427 | extern struct timespec current_fs_time(struct super_block *sb); | 1431 | extern struct timespec current_fs_time(struct super_block *sb); |
@@ -1479,8 +1483,8 @@ struct fiemap_extent_info { | |||
1479 | unsigned int fi_flags; /* Flags as passed from user */ | 1483 | unsigned int fi_flags; /* Flags as passed from user */ |
1480 | unsigned int fi_extents_mapped; /* Number of mapped extents */ | 1484 | unsigned int fi_extents_mapped; /* Number of mapped extents */ |
1481 | unsigned int fi_extents_max; /* Size of fiemap_extent array */ | 1485 | unsigned int fi_extents_max; /* Size of fiemap_extent array */ |
1482 | struct fiemap_extent *fi_extents_start; /* Start of fiemap_extent | 1486 | struct fiemap_extent __user *fi_extents_start; /* Start of |
1483 | * array */ | 1487 | fiemap_extent array */ |
1484 | }; | 1488 | }; |
1485 | int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical, | 1489 | int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical, |
1486 | u64 phys, u64 len, u32 flags); | 1490 | u64 phys, u64 len, u32 flags); |
@@ -1548,6 +1552,8 @@ struct file_operations { | |||
1548 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); | 1552 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); |
1549 | ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); | 1553 | ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); |
1550 | int (*setlease)(struct file *, long, struct file_lock **); | 1554 | int (*setlease)(struct file *, long, struct file_lock **); |
1555 | long (*fallocate)(struct file *file, int mode, loff_t offset, | ||
1556 | loff_t len); | ||
1551 | }; | 1557 | }; |
1552 | 1558 | ||
1553 | #define IPERM_FLAG_RCU 0x0001 | 1559 | #define IPERM_FLAG_RCU 0x0001 |
@@ -1578,8 +1584,6 @@ struct inode_operations { | |||
1578 | ssize_t (*listxattr) (struct dentry *, char *, size_t); | 1584 | ssize_t (*listxattr) (struct dentry *, char *, size_t); |
1579 | int (*removexattr) (struct dentry *, const char *); | 1585 | int (*removexattr) (struct dentry *, const char *); |
1580 | void (*truncate_range)(struct inode *, loff_t, loff_t); | 1586 | void (*truncate_range)(struct inode *, loff_t, loff_t); |
1581 | long (*fallocate)(struct inode *inode, int mode, loff_t offset, | ||
1582 | loff_t len); | ||
1583 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, | 1587 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, |
1584 | u64 len); | 1588 | u64 len); |
1585 | } ____cacheline_aligned; | 1589 | } ____cacheline_aligned; |
@@ -1833,7 +1837,9 @@ struct super_block *sget(struct file_system_type *type, | |||
1833 | int (*set)(struct super_block *,void *), | 1837 | int (*set)(struct super_block *,void *), |
1834 | void *data); | 1838 | void *data); |
1835 | extern struct dentry *mount_pseudo(struct file_system_type *, char *, | 1839 | extern struct dentry *mount_pseudo(struct file_system_type *, char *, |
1836 | const struct super_operations *ops, unsigned long); | 1840 | const struct super_operations *ops, |
1841 | const struct dentry_operations *dops, | ||
1842 | unsigned long); | ||
1837 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); | 1843 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); |
1838 | 1844 | ||
1839 | static inline void sb_mark_dirty(struct super_block *sb) | 1845 | static inline void sb_mark_dirty(struct super_block *sb) |
@@ -2015,7 +2021,6 @@ extern struct block_device *bdgrab(struct block_device *bdev); | |||
2015 | extern void bd_set_size(struct block_device *, loff_t size); | 2021 | extern void bd_set_size(struct block_device *, loff_t size); |
2016 | extern void bd_forget(struct inode *inode); | 2022 | extern void bd_forget(struct inode *inode); |
2017 | extern void bdput(struct block_device *); | 2023 | extern void bdput(struct block_device *); |
2018 | extern struct block_device *open_by_devnum(dev_t, fmode_t); | ||
2019 | extern void invalidate_bdev(struct block_device *); | 2024 | extern void invalidate_bdev(struct block_device *); |
2020 | extern int sync_blockdev(struct block_device *bdev); | 2025 | extern int sync_blockdev(struct block_device *bdev); |
2021 | extern struct super_block *freeze_bdev(struct block_device *); | 2026 | extern struct super_block *freeze_bdev(struct block_device *); |
@@ -2046,16 +2051,26 @@ extern const struct file_operations def_fifo_fops; | |||
2046 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); | 2051 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); |
2047 | extern int blkdev_ioctl(struct block_device *, fmode_t, unsigned, unsigned long); | 2052 | extern int blkdev_ioctl(struct block_device *, fmode_t, unsigned, unsigned long); |
2048 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | 2053 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); |
2049 | extern int blkdev_get(struct block_device *, fmode_t); | 2054 | extern int blkdev_get(struct block_device *bdev, fmode_t mode, void *holder); |
2050 | extern int blkdev_put(struct block_device *, fmode_t); | 2055 | extern struct block_device *blkdev_get_by_path(const char *path, fmode_t mode, |
2051 | extern int bd_claim(struct block_device *, void *); | 2056 | void *holder); |
2052 | extern void bd_release(struct block_device *); | 2057 | extern struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode, |
2058 | void *holder); | ||
2059 | extern int blkdev_put(struct block_device *bdev, fmode_t mode); | ||
2053 | #ifdef CONFIG_SYSFS | 2060 | #ifdef CONFIG_SYSFS |
2054 | extern int bd_claim_by_disk(struct block_device *, void *, struct gendisk *); | 2061 | extern int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk); |
2055 | extern void bd_release_from_disk(struct block_device *, struct gendisk *); | 2062 | extern void bd_unlink_disk_holder(struct block_device *bdev, |
2063 | struct gendisk *disk); | ||
2056 | #else | 2064 | #else |
2057 | #define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder) | 2065 | static inline int bd_link_disk_holder(struct block_device *bdev, |
2058 | #define bd_release_from_disk(bdev, disk) bd_release(bdev) | 2066 | struct gendisk *disk) |
2067 | { | ||
2068 | return 0; | ||
2069 | } | ||
2070 | static inline void bd_unlink_disk_holder(struct block_device *bdev, | ||
2071 | struct gendisk *disk) | ||
2072 | { | ||
2073 | } | ||
2059 | #endif | 2074 | #endif |
2060 | #endif | 2075 | #endif |
2061 | 2076 | ||
@@ -2091,8 +2106,6 @@ static inline void unregister_chrdev(unsigned int major, const char *name) | |||
2091 | extern const char *__bdevname(dev_t, char *buffer); | 2106 | extern const char *__bdevname(dev_t, char *buffer); |
2092 | extern const char *bdevname(struct block_device *bdev, char *buffer); | 2107 | extern const char *bdevname(struct block_device *bdev, char *buffer); |
2093 | extern struct block_device *lookup_bdev(const char *); | 2108 | extern struct block_device *lookup_bdev(const char *); |
2094 | extern struct block_device *open_bdev_exclusive(const char *, fmode_t, void *); | ||
2095 | extern void close_bdev_exclusive(struct block_device *, fmode_t); | ||
2096 | extern void blkdev_show(struct seq_file *,off_t); | 2109 | extern void blkdev_show(struct seq_file *,off_t); |
2097 | 2110 | ||
2098 | #else | 2111 | #else |
@@ -2126,7 +2139,7 @@ extern void check_disk_size_change(struct gendisk *disk, | |||
2126 | struct block_device *bdev); | 2139 | struct block_device *bdev); |
2127 | extern int revalidate_disk(struct gendisk *); | 2140 | extern int revalidate_disk(struct gendisk *); |
2128 | extern int check_disk_change(struct block_device *); | 2141 | extern int check_disk_change(struct block_device *); |
2129 | extern int __invalidate_device(struct block_device *); | 2142 | extern int __invalidate_device(struct block_device *, bool); |
2130 | extern int invalidate_partition(struct gendisk *, int); | 2143 | extern int invalidate_partition(struct gendisk *, int); |
2131 | #endif | 2144 | #endif |
2132 | unsigned long invalidate_mapping_pages(struct address_space *mapping, | 2145 | unsigned long invalidate_mapping_pages(struct address_space *mapping, |
@@ -2232,6 +2245,7 @@ extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); | |||
2232 | 2245 | ||
2233 | extern int inode_init_always(struct super_block *, struct inode *); | 2246 | extern int inode_init_always(struct super_block *, struct inode *); |
2234 | extern void inode_init_once(struct inode *); | 2247 | extern void inode_init_once(struct inode *); |
2248 | extern void address_space_init_once(struct address_space *mapping); | ||
2235 | extern void ihold(struct inode * inode); | 2249 | extern void ihold(struct inode * inode); |
2236 | extern void iput(struct inode *); | 2250 | extern void iput(struct inode *); |
2237 | extern struct inode * igrab(struct inode *); | 2251 | extern struct inode * igrab(struct inode *); |
@@ -2562,9 +2576,12 @@ int proc_nr_inodes(struct ctl_table *table, int write, | |||
2562 | void __user *buffer, size_t *lenp, loff_t *ppos); | 2576 | void __user *buffer, size_t *lenp, loff_t *ppos); |
2563 | int __init get_filesystem_list(char *buf); | 2577 | int __init get_filesystem_list(char *buf); |
2564 | 2578 | ||
2579 | #define __FMODE_EXEC ((__force int) FMODE_EXEC) | ||
2580 | #define __FMODE_NONOTIFY ((__force int) FMODE_NONOTIFY) | ||
2581 | |||
2565 | #define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) | 2582 | #define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) |
2566 | #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \ | 2583 | #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \ |
2567 | (flag & FMODE_NONOTIFY))) | 2584 | (flag & __FMODE_NONOTIFY))) |
2568 | 2585 | ||
2569 | #endif /* __KERNEL__ */ | 2586 | #endif /* __KERNEL__ */ |
2570 | #endif /* _LINUX_FS_H */ | 2587 | #endif /* _LINUX_FS_H */ |