diff options
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 126 |
1 files changed, 73 insertions, 53 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 177b4ddea418..dbd860af0804 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -102,6 +102,9 @@ struct inodes_stat_t { | |||
102 | /* File is huge (eg. /dev/kmem): treat loff_t as unsigned */ | 102 | /* File is huge (eg. /dev/kmem): treat loff_t as unsigned */ |
103 | #define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000) | 103 | #define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000) |
104 | 104 | ||
105 | /* File is opened with O_PATH; almost nothing can be done with it */ | ||
106 | #define FMODE_PATH ((__force fmode_t)0x4000) | ||
107 | |||
105 | /* File was opened by fanotify and shouldn't generate fanotify events */ | 108 | /* File was opened by fanotify and shouldn't generate fanotify events */ |
106 | #define FMODE_NONOTIFY ((__force fmode_t)0x1000000) | 109 | #define FMODE_NONOTIFY ((__force fmode_t)0x1000000) |
107 | 110 | ||
@@ -135,16 +138,10 @@ struct inodes_stat_t { | |||
135 | * block layer could (in theory) choose to ignore this | 138 | * block layer could (in theory) choose to ignore this |
136 | * request if it runs into resource problems. | 139 | * request if it runs into resource problems. |
137 | * WRITE A normal async write. Device will be plugged. | 140 | * WRITE A normal async write. Device will be plugged. |
138 | * WRITE_SYNC_PLUG Synchronous write. Identical to WRITE, but passes down | 141 | * WRITE_SYNC Synchronous write. Identical to WRITE, but passes down |
139 | * the hint that someone will be waiting on this IO | 142 | * the hint that someone will be waiting on this IO |
140 | * shortly. The device must still be unplugged explicitly, | 143 | * shortly. The write equivalent of READ_SYNC. |
141 | * WRITE_SYNC_PLUG does not do this as we could be | 144 | * WRITE_ODIRECT Special case write for O_DIRECT only. |
142 | * submitting more writes before we actually wait on any | ||
143 | * of them. | ||
144 | * WRITE_SYNC Like WRITE_SYNC_PLUG, but also unplugs the device | ||
145 | * immediately after submission. The write equivalent | ||
146 | * of READ_SYNC. | ||
147 | * WRITE_ODIRECT_PLUG Special case write for O_DIRECT only. | ||
148 | * WRITE_FLUSH Like WRITE_SYNC but with preceding cache flush. | 145 | * WRITE_FLUSH Like WRITE_SYNC but with preceding cache flush. |
149 | * WRITE_FUA Like WRITE_SYNC but data is guaranteed to be on | 146 | * WRITE_FUA Like WRITE_SYNC but data is guaranteed to be on |
150 | * non-volatile media on completion. | 147 | * non-volatile media on completion. |
@@ -160,18 +157,14 @@ struct inodes_stat_t { | |||
160 | #define WRITE RW_MASK | 157 | #define WRITE RW_MASK |
161 | #define READA RWA_MASK | 158 | #define READA RWA_MASK |
162 | 159 | ||
163 | #define READ_SYNC (READ | REQ_SYNC | REQ_UNPLUG) | 160 | #define READ_SYNC (READ | REQ_SYNC) |
164 | #define READ_META (READ | REQ_META) | 161 | #define READ_META (READ | REQ_META) |
165 | #define WRITE_SYNC_PLUG (WRITE | REQ_SYNC | REQ_NOIDLE) | 162 | #define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE) |
166 | #define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG) | 163 | #define WRITE_ODIRECT (WRITE | REQ_SYNC) |
167 | #define WRITE_ODIRECT_PLUG (WRITE | REQ_SYNC) | ||
168 | #define WRITE_META (WRITE | REQ_META) | 164 | #define WRITE_META (WRITE | REQ_META) |
169 | #define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ | 165 | #define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH) |
170 | REQ_FLUSH) | 166 | #define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA) |
171 | #define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ | 167 | #define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) |
172 | REQ_FUA) | ||
173 | #define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ | ||
174 | REQ_FLUSH | REQ_FUA) | ||
175 | 168 | ||
176 | #define SEL_IN 1 | 169 | #define SEL_IN 1 |
177 | #define SEL_OUT 2 | 170 | #define SEL_OUT 2 |
@@ -364,6 +357,8 @@ struct inodes_stat_t { | |||
364 | #define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ | 357 | #define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ |
365 | #define FS_EXTENT_FL 0x00080000 /* Extents */ | 358 | #define FS_EXTENT_FL 0x00080000 /* Extents */ |
366 | #define FS_DIRECTIO_FL 0x00100000 /* Use direct i/o */ | 359 | #define FS_DIRECTIO_FL 0x00100000 /* Use direct i/o */ |
360 | #define FS_NOCOW_FL 0x00800000 /* Do not cow file */ | ||
361 | #define FS_COW_FL 0x02000000 /* Cow file */ | ||
367 | #define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ | 362 | #define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ |
368 | 363 | ||
369 | #define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ | 364 | #define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ |
@@ -470,7 +465,7 @@ struct iattr { | |||
470 | struct timespec ia_ctime; | 465 | struct timespec ia_ctime; |
471 | 466 | ||
472 | /* | 467 | /* |
473 | * Not an attribute, but an auxilary info for filesystems wanting to | 468 | * Not an attribute, but an auxiliary info for filesystems wanting to |
474 | * implement an ftruncate() like method. NOTE: filesystem should | 469 | * implement an ftruncate() like method. NOTE: filesystem should |
475 | * check for (ia_valid & ATTR_FILE), and not for (ia_file != NULL). | 470 | * check for (ia_valid & ATTR_FILE), and not for (ia_file != NULL). |
476 | */ | 471 | */ |
@@ -583,7 +578,6 @@ typedef int (*read_actor_t)(read_descriptor_t *, struct page *, | |||
583 | struct address_space_operations { | 578 | struct address_space_operations { |
584 | int (*writepage)(struct page *page, struct writeback_control *wbc); | 579 | int (*writepage)(struct page *page, struct writeback_control *wbc); |
585 | int (*readpage)(struct file *, struct page *); | 580 | int (*readpage)(struct file *, struct page *); |
586 | void (*sync_page)(struct page *); | ||
587 | 581 | ||
588 | /* Write back some dirty pages from this mapping. */ | 582 | /* Write back some dirty pages from this mapping. */ |
589 | int (*writepages)(struct address_space *, struct writeback_control *); | 583 | int (*writepages)(struct address_space *, struct writeback_control *); |
@@ -619,6 +613,8 @@ struct address_space_operations { | |||
619 | int (*error_remove_page)(struct address_space *, struct page *); | 613 | int (*error_remove_page)(struct address_space *, struct page *); |
620 | }; | 614 | }; |
621 | 615 | ||
616 | extern const struct address_space_operations empty_aops; | ||
617 | |||
622 | /* | 618 | /* |
623 | * pagecache_write_begin/pagecache_write_end must be used by general code | 619 | * pagecache_write_begin/pagecache_write_end must be used by general code |
624 | * to write into the pagecache. | 620 | * to write into the pagecache. |
@@ -649,18 +645,19 @@ struct address_space { | |||
649 | spinlock_t private_lock; /* for use by the address_space */ | 645 | spinlock_t private_lock; /* for use by the address_space */ |
650 | struct list_head private_list; /* ditto */ | 646 | struct list_head private_list; /* ditto */ |
651 | struct address_space *assoc_mapping; /* ditto */ | 647 | struct address_space *assoc_mapping; /* ditto */ |
648 | struct mutex unmap_mutex; /* to protect unmapping */ | ||
652 | } __attribute__((aligned(sizeof(long)))); | 649 | } __attribute__((aligned(sizeof(long)))); |
653 | /* | 650 | /* |
654 | * On most architectures that alignment is already the case; but | 651 | * On most architectures that alignment is already the case; but |
655 | * must be enforced here for CRIS, to let the least signficant bit | 652 | * must be enforced here for CRIS, to let the least significant bit |
656 | * of struct page's "mapping" pointer be used for PAGE_MAPPING_ANON. | 653 | * of struct page's "mapping" pointer be used for PAGE_MAPPING_ANON. |
657 | */ | 654 | */ |
658 | 655 | ||
659 | struct block_device { | 656 | struct block_device { |
660 | dev_t bd_dev; /* not a kdev_t - it's a search key */ | 657 | dev_t bd_dev; /* not a kdev_t - it's a search key */ |
658 | int bd_openers; | ||
661 | struct inode * bd_inode; /* will die */ | 659 | struct inode * bd_inode; /* will die */ |
662 | struct super_block * bd_super; | 660 | struct super_block * bd_super; |
663 | int bd_openers; | ||
664 | struct mutex bd_mutex; /* open/close mutex */ | 661 | struct mutex bd_mutex; /* open/close mutex */ |
665 | struct list_head bd_inodes; | 662 | struct list_head bd_inodes; |
666 | void * bd_claiming; | 663 | void * bd_claiming; |
@@ -797,8 +794,7 @@ struct inode { | |||
797 | #endif | 794 | #endif |
798 | 795 | ||
799 | #ifdef CONFIG_IMA | 796 | #ifdef CONFIG_IMA |
800 | /* protected by i_lock */ | 797 | atomic_t i_readcount; /* struct files open RO */ |
801 | unsigned int i_readcount; /* struct files open RO */ | ||
802 | #endif | 798 | #endif |
803 | atomic_t i_writecount; | 799 | atomic_t i_writecount; |
804 | #ifdef CONFIG_SECURITY | 800 | #ifdef CONFIG_SECURITY |
@@ -977,6 +973,13 @@ struct file { | |||
977 | #endif | 973 | #endif |
978 | }; | 974 | }; |
979 | 975 | ||
976 | struct file_handle { | ||
977 | __u32 handle_bytes; | ||
978 | int handle_type; | ||
979 | /* file identifier */ | ||
980 | unsigned char f_handle[0]; | ||
981 | }; | ||
982 | |||
980 | #define get_file(x) atomic_long_inc(&(x)->f_count) | 983 | #define get_file(x) atomic_long_inc(&(x)->f_count) |
981 | #define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1) | 984 | #define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1) |
982 | #define file_count(x) atomic_long_read(&(x)->f_count) | 985 | #define file_count(x) atomic_long_read(&(x)->f_count) |
@@ -1400,6 +1403,7 @@ struct super_block { | |||
1400 | wait_queue_head_t s_wait_unfrozen; | 1403 | wait_queue_head_t s_wait_unfrozen; |
1401 | 1404 | ||
1402 | char s_id[32]; /* Informational name */ | 1405 | char s_id[32]; /* Informational name */ |
1406 | u8 s_uuid[16]; /* UUID */ | ||
1403 | 1407 | ||
1404 | void *s_fs_info; /* Filesystem private info */ | 1408 | void *s_fs_info; /* Filesystem private info */ |
1405 | fmode_t s_mode; | 1409 | fmode_t s_mode; |
@@ -1446,8 +1450,13 @@ enum { | |||
1446 | #define put_fs_excl() atomic_dec(¤t->fs_excl) | 1450 | #define put_fs_excl() atomic_dec(¤t->fs_excl) |
1447 | #define has_fs_excl() atomic_read(¤t->fs_excl) | 1451 | #define has_fs_excl() atomic_read(¤t->fs_excl) |
1448 | 1452 | ||
1449 | #define is_owner_or_cap(inode) \ | 1453 | /* |
1450 | ((current_fsuid() == (inode)->i_uid) || capable(CAP_FOWNER)) | 1454 | * until VFS tracks user namespaces for inodes, just make all files |
1455 | * belong to init_user_ns | ||
1456 | */ | ||
1457 | extern struct user_namespace init_user_ns; | ||
1458 | #define inode_userns(inode) (&init_user_ns) | ||
1459 | extern bool inode_owner_or_capable(const struct inode *inode); | ||
1451 | 1460 | ||
1452 | /* not quite ready to be deprecated, but... */ | 1461 | /* not quite ready to be deprecated, but... */ |
1453 | extern void lock_super(struct super_block *); | 1462 | extern void lock_super(struct super_block *); |
@@ -1483,8 +1492,8 @@ struct fiemap_extent_info { | |||
1483 | unsigned int fi_flags; /* Flags as passed from user */ | 1492 | unsigned int fi_flags; /* Flags as passed from user */ |
1484 | unsigned int fi_extents_mapped; /* Number of mapped extents */ | 1493 | unsigned int fi_extents_mapped; /* Number of mapped extents */ |
1485 | unsigned int fi_extents_max; /* Size of fiemap_extent array */ | 1494 | unsigned int fi_extents_max; /* Size of fiemap_extent array */ |
1486 | struct fiemap_extent *fi_extents_start; /* Start of fiemap_extent | 1495 | struct fiemap_extent __user *fi_extents_start; /* Start of |
1487 | * array */ | 1496 | fiemap_extent array */ |
1488 | }; | 1497 | }; |
1489 | int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical, | 1498 | int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical, |
1490 | u64 phys, u64 len, u32 flags); | 1499 | u64 phys, u64 len, u32 flags); |
@@ -1552,6 +1561,8 @@ struct file_operations { | |||
1552 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); | 1561 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); |
1553 | ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); | 1562 | ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); |
1554 | int (*setlease)(struct file *, long, struct file_lock **); | 1563 | int (*setlease)(struct file *, long, struct file_lock **); |
1564 | long (*fallocate)(struct file *file, int mode, loff_t offset, | ||
1565 | loff_t len); | ||
1555 | }; | 1566 | }; |
1556 | 1567 | ||
1557 | #define IPERM_FLAG_RCU 0x0001 | 1568 | #define IPERM_FLAG_RCU 0x0001 |
@@ -1582,8 +1593,6 @@ struct inode_operations { | |||
1582 | ssize_t (*listxattr) (struct dentry *, char *, size_t); | 1593 | ssize_t (*listxattr) (struct dentry *, char *, size_t); |
1583 | int (*removexattr) (struct dentry *, const char *); | 1594 | int (*removexattr) (struct dentry *, const char *); |
1584 | void (*truncate_range)(struct inode *, loff_t, loff_t); | 1595 | void (*truncate_range)(struct inode *, loff_t, loff_t); |
1585 | long (*fallocate)(struct inode *inode, int mode, loff_t offset, | ||
1586 | loff_t len); | ||
1587 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, | 1596 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, |
1588 | u64 len); | 1597 | u64 len); |
1589 | } ____cacheline_aligned; | 1598 | } ____cacheline_aligned; |
@@ -1620,6 +1629,8 @@ struct super_operations { | |||
1620 | void (*umount_begin) (struct super_block *); | 1629 | void (*umount_begin) (struct super_block *); |
1621 | 1630 | ||
1622 | int (*show_options)(struct seq_file *, struct vfsmount *); | 1631 | int (*show_options)(struct seq_file *, struct vfsmount *); |
1632 | int (*show_devname)(struct seq_file *, struct vfsmount *); | ||
1633 | int (*show_path)(struct seq_file *, struct vfsmount *); | ||
1623 | int (*show_stats)(struct seq_file *, struct vfsmount *); | 1634 | int (*show_stats)(struct seq_file *, struct vfsmount *); |
1624 | #ifdef CONFIG_QUOTA | 1635 | #ifdef CONFIG_QUOTA |
1625 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); | 1636 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); |
@@ -1629,7 +1640,7 @@ struct super_operations { | |||
1629 | }; | 1640 | }; |
1630 | 1641 | ||
1631 | /* | 1642 | /* |
1632 | * Inode state bits. Protected by inode_lock. | 1643 | * Inode state bits. Protected by inode->i_lock |
1633 | * | 1644 | * |
1634 | * Three bits determine the dirty state of the inode, I_DIRTY_SYNC, | 1645 | * Three bits determine the dirty state of the inode, I_DIRTY_SYNC, |
1635 | * I_DIRTY_DATASYNC and I_DIRTY_PAGES. | 1646 | * I_DIRTY_DATASYNC and I_DIRTY_PAGES. |
@@ -1783,8 +1794,6 @@ int sync_inode_metadata(struct inode *inode, int wait); | |||
1783 | struct file_system_type { | 1794 | struct file_system_type { |
1784 | const char *name; | 1795 | const char *name; |
1785 | int fs_flags; | 1796 | int fs_flags; |
1786 | int (*get_sb) (struct file_system_type *, int, | ||
1787 | const char *, void *, struct vfsmount *); | ||
1788 | struct dentry *(*mount) (struct file_system_type *, int, | 1797 | struct dentry *(*mount) (struct file_system_type *, int, |
1789 | const char *, void *); | 1798 | const char *, void *); |
1790 | void (*kill_sb) (struct super_block *); | 1799 | void (*kill_sb) (struct super_block *); |
@@ -1807,24 +1816,12 @@ extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags, | |||
1807 | extern struct dentry *mount_bdev(struct file_system_type *fs_type, | 1816 | extern struct dentry *mount_bdev(struct file_system_type *fs_type, |
1808 | int flags, const char *dev_name, void *data, | 1817 | int flags, const char *dev_name, void *data, |
1809 | int (*fill_super)(struct super_block *, void *, int)); | 1818 | int (*fill_super)(struct super_block *, void *, int)); |
1810 | extern int get_sb_bdev(struct file_system_type *fs_type, | ||
1811 | int flags, const char *dev_name, void *data, | ||
1812 | int (*fill_super)(struct super_block *, void *, int), | ||
1813 | struct vfsmount *mnt); | ||
1814 | extern struct dentry *mount_single(struct file_system_type *fs_type, | 1819 | extern struct dentry *mount_single(struct file_system_type *fs_type, |
1815 | int flags, void *data, | 1820 | int flags, void *data, |
1816 | int (*fill_super)(struct super_block *, void *, int)); | 1821 | int (*fill_super)(struct super_block *, void *, int)); |
1817 | extern int get_sb_single(struct file_system_type *fs_type, | ||
1818 | int flags, void *data, | ||
1819 | int (*fill_super)(struct super_block *, void *, int), | ||
1820 | struct vfsmount *mnt); | ||
1821 | extern struct dentry *mount_nodev(struct file_system_type *fs_type, | 1822 | extern struct dentry *mount_nodev(struct file_system_type *fs_type, |
1822 | int flags, void *data, | 1823 | int flags, void *data, |
1823 | int (*fill_super)(struct super_block *, void *, int)); | 1824 | int (*fill_super)(struct super_block *, void *, int)); |
1824 | extern int get_sb_nodev(struct file_system_type *fs_type, | ||
1825 | int flags, void *data, | ||
1826 | int (*fill_super)(struct super_block *, void *, int), | ||
1827 | struct vfsmount *mnt); | ||
1828 | void generic_shutdown_super(struct super_block *sb); | 1825 | void generic_shutdown_super(struct super_block *sb); |
1829 | void kill_block_super(struct super_block *sb); | 1826 | void kill_block_super(struct super_block *sb); |
1830 | void kill_anon_super(struct super_block *sb); | 1827 | void kill_anon_super(struct super_block *sb); |
@@ -1840,7 +1837,6 @@ extern struct dentry *mount_pseudo(struct file_system_type *, char *, | |||
1840 | const struct super_operations *ops, | 1837 | const struct super_operations *ops, |
1841 | const struct dentry_operations *dops, | 1838 | const struct dentry_operations *dops, |
1842 | unsigned long); | 1839 | unsigned long); |
1843 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); | ||
1844 | 1840 | ||
1845 | static inline void sb_mark_dirty(struct super_block *sb) | 1841 | static inline void sb_mark_dirty(struct super_block *sb) |
1846 | { | 1842 | { |
@@ -1873,6 +1869,8 @@ extern void drop_collected_mounts(struct vfsmount *); | |||
1873 | extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *, | 1869 | extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *, |
1874 | struct vfsmount *); | 1870 | struct vfsmount *); |
1875 | extern int vfs_statfs(struct path *, struct kstatfs *); | 1871 | extern int vfs_statfs(struct path *, struct kstatfs *); |
1872 | extern int user_statfs(const char __user *, struct kstatfs *); | ||
1873 | extern int fd_statfs(int, struct kstatfs *); | ||
1876 | extern int statfs_by_dentry(struct dentry *, struct kstatfs *); | 1874 | extern int statfs_by_dentry(struct dentry *, struct kstatfs *); |
1877 | extern int freeze_super(struct super_block *super); | 1875 | extern int freeze_super(struct super_block *super); |
1878 | extern int thaw_super(struct super_block *super); | 1876 | extern int thaw_super(struct super_block *super); |
@@ -1989,6 +1987,8 @@ extern int do_fallocate(struct file *file, int mode, loff_t offset, | |||
1989 | extern long do_sys_open(int dfd, const char __user *filename, int flags, | 1987 | extern long do_sys_open(int dfd, const char __user *filename, int flags, |
1990 | int mode); | 1988 | int mode); |
1991 | extern struct file *filp_open(const char *, int, int); | 1989 | extern struct file *filp_open(const char *, int, int); |
1990 | extern struct file *file_open_root(struct dentry *, struct vfsmount *, | ||
1991 | const char *, int); | ||
1992 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, | 1992 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, |
1993 | const struct cred *); | 1993 | const struct cred *); |
1994 | extern int filp_close(struct file *, fl_owner_t id); | 1994 | extern int filp_close(struct file *, fl_owner_t id); |
@@ -2139,7 +2139,7 @@ extern void check_disk_size_change(struct gendisk *disk, | |||
2139 | struct block_device *bdev); | 2139 | struct block_device *bdev); |
2140 | extern int revalidate_disk(struct gendisk *); | 2140 | extern int revalidate_disk(struct gendisk *); |
2141 | extern int check_disk_change(struct block_device *); | 2141 | extern int check_disk_change(struct block_device *); |
2142 | extern int __invalidate_device(struct block_device *); | 2142 | extern int __invalidate_device(struct block_device *, bool); |
2143 | extern int invalidate_partition(struct gendisk *, int); | 2143 | extern int invalidate_partition(struct gendisk *, int); |
2144 | #endif | 2144 | #endif |
2145 | unsigned long invalidate_mapping_pages(struct address_space *mapping, | 2145 | unsigned long invalidate_mapping_pages(struct address_space *mapping, |
@@ -2199,15 +2199,31 @@ static inline void allow_write_access(struct file *file) | |||
2199 | if (file) | 2199 | if (file) |
2200 | atomic_inc(&file->f_path.dentry->d_inode->i_writecount); | 2200 | atomic_inc(&file->f_path.dentry->d_inode->i_writecount); |
2201 | } | 2201 | } |
2202 | #ifdef CONFIG_IMA | ||
2203 | static inline void i_readcount_dec(struct inode *inode) | ||
2204 | { | ||
2205 | BUG_ON(!atomic_read(&inode->i_readcount)); | ||
2206 | atomic_dec(&inode->i_readcount); | ||
2207 | } | ||
2208 | static inline void i_readcount_inc(struct inode *inode) | ||
2209 | { | ||
2210 | atomic_inc(&inode->i_readcount); | ||
2211 | } | ||
2212 | #else | ||
2213 | static inline void i_readcount_dec(struct inode *inode) | ||
2214 | { | ||
2215 | return; | ||
2216 | } | ||
2217 | static inline void i_readcount_inc(struct inode *inode) | ||
2218 | { | ||
2219 | return; | ||
2220 | } | ||
2221 | #endif | ||
2202 | extern int do_pipe_flags(int *, int); | 2222 | extern int do_pipe_flags(int *, int); |
2203 | extern struct file *create_read_pipe(struct file *f, int flags); | 2223 | extern struct file *create_read_pipe(struct file *f, int flags); |
2204 | extern struct file *create_write_pipe(int flags); | 2224 | extern struct file *create_write_pipe(int flags); |
2205 | extern void free_write_pipe(struct file *); | 2225 | extern void free_write_pipe(struct file *); |
2206 | 2226 | ||
2207 | extern struct file *do_filp_open(int dfd, const char *pathname, | ||
2208 | int open_flag, int mode, int acc_mode); | ||
2209 | extern int may_open(struct path *, int, int); | ||
2210 | |||
2211 | extern int kernel_read(struct file *, loff_t, char *, unsigned long); | 2227 | extern int kernel_read(struct file *, loff_t, char *, unsigned long); |
2212 | extern struct file * open_exec(const char *); | 2228 | extern struct file * open_exec(const char *); |
2213 | 2229 | ||
@@ -2225,6 +2241,7 @@ extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); | |||
2225 | 2241 | ||
2226 | extern int inode_init_always(struct super_block *, struct inode *); | 2242 | extern int inode_init_always(struct super_block *, struct inode *); |
2227 | extern void inode_init_once(struct inode *); | 2243 | extern void inode_init_once(struct inode *); |
2244 | extern void address_space_init_once(struct address_space *mapping); | ||
2228 | extern void ihold(struct inode * inode); | 2245 | extern void ihold(struct inode * inode); |
2229 | extern void iput(struct inode *); | 2246 | extern void iput(struct inode *); |
2230 | extern struct inode * igrab(struct inode *); | 2247 | extern struct inode * igrab(struct inode *); |
@@ -2555,9 +2572,12 @@ int proc_nr_inodes(struct ctl_table *table, int write, | |||
2555 | void __user *buffer, size_t *lenp, loff_t *ppos); | 2572 | void __user *buffer, size_t *lenp, loff_t *ppos); |
2556 | int __init get_filesystem_list(char *buf); | 2573 | int __init get_filesystem_list(char *buf); |
2557 | 2574 | ||
2575 | #define __FMODE_EXEC ((__force int) FMODE_EXEC) | ||
2576 | #define __FMODE_NONOTIFY ((__force int) FMODE_NONOTIFY) | ||
2577 | |||
2558 | #define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) | 2578 | #define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) |
2559 | #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \ | 2579 | #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \ |
2560 | (flag & FMODE_NONOTIFY))) | 2580 | (flag & __FMODE_NONOTIFY))) |
2561 | 2581 | ||
2562 | #endif /* __KERNEL__ */ | 2582 | #endif /* __KERNEL__ */ |
2563 | #endif /* _LINUX_FS_H */ | 2583 | #endif /* _LINUX_FS_H */ |