diff options
Diffstat (limited to 'include/linux/fs.h')
| -rw-r--r-- | include/linux/fs.h | 204 |
1 files changed, 177 insertions, 27 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 17fd887c798f..aa110476a95b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -165,6 +165,8 @@ struct inodes_stat_t { | |||
| 165 | #define READ 0 | 165 | #define READ 0 |
| 166 | #define WRITE RW_MASK | 166 | #define WRITE RW_MASK |
| 167 | #define READA RWA_MASK | 167 | #define READA RWA_MASK |
| 168 | #define KERNEL_READ (READ|REQ_KERNEL) | ||
| 169 | #define KERNEL_WRITE (WRITE|REQ_KERNEL) | ||
| 168 | 170 | ||
| 169 | #define READ_SYNC (READ | REQ_SYNC) | 171 | #define READ_SYNC (READ | REQ_SYNC) |
| 170 | #define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE) | 172 | #define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE) |
| @@ -412,6 +414,7 @@ struct inodes_stat_t { | |||
| 412 | #include <linux/shrinker.h> | 414 | #include <linux/shrinker.h> |
| 413 | #include <linux/migrate_mode.h> | 415 | #include <linux/migrate_mode.h> |
| 414 | #include <linux/uidgid.h> | 416 | #include <linux/uidgid.h> |
| 417 | #include <linux/lockdep.h> | ||
| 415 | 418 | ||
| 416 | #include <asm/byteorder.h> | 419 | #include <asm/byteorder.h> |
| 417 | 420 | ||
| @@ -427,6 +430,7 @@ struct kstatfs; | |||
| 427 | struct vm_area_struct; | 430 | struct vm_area_struct; |
| 428 | struct vfsmount; | 431 | struct vfsmount; |
| 429 | struct cred; | 432 | struct cred; |
| 433 | struct swap_info_struct; | ||
| 430 | 434 | ||
| 431 | extern void __init inode_init(void); | 435 | extern void __init inode_init(void); |
| 432 | extern void __init inode_init_early(void); | 436 | extern void __init inode_init_early(void); |
| @@ -437,6 +441,8 @@ extern unsigned long get_max_files(void); | |||
| 437 | extern int sysctl_nr_open; | 441 | extern int sysctl_nr_open; |
| 438 | extern struct inodes_stat_t inodes_stat; | 442 | extern struct inodes_stat_t inodes_stat; |
| 439 | extern int leases_enable, lease_break_time; | 443 | extern int leases_enable, lease_break_time; |
| 444 | extern int sysctl_protected_symlinks; | ||
| 445 | extern int sysctl_protected_hardlinks; | ||
| 440 | 446 | ||
| 441 | struct buffer_head; | 447 | struct buffer_head; |
| 442 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, | 448 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, |
| @@ -636,6 +642,11 @@ struct address_space_operations { | |||
| 636 | int (*is_partially_uptodate) (struct page *, read_descriptor_t *, | 642 | int (*is_partially_uptodate) (struct page *, read_descriptor_t *, |
| 637 | unsigned long); | 643 | unsigned long); |
| 638 | int (*error_remove_page)(struct address_space *, struct page *); | 644 | int (*error_remove_page)(struct address_space *, struct page *); |
| 645 | |||
| 646 | /* swapfile support */ | ||
| 647 | int (*swap_activate)(struct swap_info_struct *sis, struct file *file, | ||
| 648 | sector_t *span); | ||
| 649 | void (*swap_deactivate)(struct file *file); | ||
| 639 | }; | 650 | }; |
| 640 | 651 | ||
| 641 | extern const struct address_space_operations empty_aops; | 652 | extern const struct address_space_operations empty_aops; |
| @@ -826,7 +837,7 @@ struct inode { | |||
| 826 | struct list_head i_lru; /* inode LRU list */ | 837 | struct list_head i_lru; /* inode LRU list */ |
| 827 | struct list_head i_sb_list; | 838 | struct list_head i_sb_list; |
| 828 | union { | 839 | union { |
| 829 | struct list_head i_dentry; | 840 | struct hlist_head i_dentry; |
| 830 | struct rcu_head i_rcu; | 841 | struct rcu_head i_rcu; |
| 831 | }; | 842 | }; |
| 832 | u64 i_version; | 843 | u64 i_version; |
| @@ -1154,7 +1165,6 @@ struct lock_manager_operations { | |||
| 1154 | int (*lm_compare_owner)(struct file_lock *, struct file_lock *); | 1165 | int (*lm_compare_owner)(struct file_lock *, struct file_lock *); |
| 1155 | void (*lm_notify)(struct file_lock *); /* unblock callback */ | 1166 | void (*lm_notify)(struct file_lock *); /* unblock callback */ |
| 1156 | int (*lm_grant)(struct file_lock *, struct file_lock *, int); | 1167 | int (*lm_grant)(struct file_lock *, struct file_lock *, int); |
| 1157 | void (*lm_release_private)(struct file_lock *); | ||
| 1158 | void (*lm_break)(struct file_lock *); | 1168 | void (*lm_break)(struct file_lock *); |
| 1159 | int (*lm_change)(struct file_lock **, int); | 1169 | int (*lm_change)(struct file_lock **, int); |
| 1160 | }; | 1170 | }; |
| @@ -1163,9 +1173,10 @@ struct lock_manager { | |||
| 1163 | struct list_head list; | 1173 | struct list_head list; |
| 1164 | }; | 1174 | }; |
| 1165 | 1175 | ||
| 1166 | void locks_start_grace(struct lock_manager *); | 1176 | struct net; |
| 1177 | void locks_start_grace(struct net *, struct lock_manager *); | ||
| 1167 | void locks_end_grace(struct lock_manager *); | 1178 | void locks_end_grace(struct lock_manager *); |
| 1168 | int locks_in_grace(void); | 1179 | int locks_in_grace(struct net *); |
| 1169 | 1180 | ||
| 1170 | /* that will die - we need it for nfs_lock_info */ | 1181 | /* that will die - we need it for nfs_lock_info */ |
| 1171 | #include <linux/nfs_fs_i.h> | 1182 | #include <linux/nfs_fs_i.h> |
| @@ -1437,6 +1448,8 @@ extern void f_delown(struct file *filp); | |||
| 1437 | extern pid_t f_getown(struct file *filp); | 1448 | extern pid_t f_getown(struct file *filp); |
| 1438 | extern int send_sigurg(struct fown_struct *fown); | 1449 | extern int send_sigurg(struct fown_struct *fown); |
| 1439 | 1450 | ||
| 1451 | struct mm_struct; | ||
| 1452 | |||
| 1440 | /* | 1453 | /* |
| 1441 | * Umount options | 1454 | * Umount options |
| 1442 | */ | 1455 | */ |
| @@ -1450,10 +1463,34 @@ extern int send_sigurg(struct fown_struct *fown); | |||
| 1450 | extern struct list_head super_blocks; | 1463 | extern struct list_head super_blocks; |
| 1451 | extern spinlock_t sb_lock; | 1464 | extern spinlock_t sb_lock; |
| 1452 | 1465 | ||
| 1466 | /* Possible states of 'frozen' field */ | ||
| 1467 | enum { | ||
| 1468 | SB_UNFROZEN = 0, /* FS is unfrozen */ | ||
| 1469 | SB_FREEZE_WRITE = 1, /* Writes, dir ops, ioctls frozen */ | ||
| 1470 | SB_FREEZE_PAGEFAULT = 2, /* Page faults stopped as well */ | ||
| 1471 | SB_FREEZE_FS = 3, /* For internal FS use (e.g. to stop | ||
| 1472 | * internal threads if needed) */ | ||
| 1473 | SB_FREEZE_COMPLETE = 4, /* ->freeze_fs finished successfully */ | ||
| 1474 | }; | ||
| 1475 | |||
| 1476 | #define SB_FREEZE_LEVELS (SB_FREEZE_COMPLETE - 1) | ||
| 1477 | |||
| 1478 | struct sb_writers { | ||
| 1479 | /* Counters for counting writers at each level */ | ||
| 1480 | struct percpu_counter counter[SB_FREEZE_LEVELS]; | ||
| 1481 | wait_queue_head_t wait; /* queue for waiting for | ||
| 1482 | writers / faults to finish */ | ||
| 1483 | int frozen; /* Is sb frozen? */ | ||
| 1484 | wait_queue_head_t wait_unfrozen; /* queue for waiting for | ||
| 1485 | sb to be thawed */ | ||
| 1486 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 1487 | struct lockdep_map lock_map[SB_FREEZE_LEVELS]; | ||
| 1488 | #endif | ||
| 1489 | }; | ||
| 1490 | |||
| 1453 | struct super_block { | 1491 | struct super_block { |
| 1454 | struct list_head s_list; /* Keep this first */ | 1492 | struct list_head s_list; /* Keep this first */ |
| 1455 | dev_t s_dev; /* search index; _not_ kdev_t */ | 1493 | dev_t s_dev; /* search index; _not_ kdev_t */ |
| 1456 | unsigned char s_dirt; | ||
| 1457 | unsigned char s_blocksize_bits; | 1494 | unsigned char s_blocksize_bits; |
| 1458 | unsigned long s_blocksize; | 1495 | unsigned long s_blocksize; |
| 1459 | loff_t s_maxbytes; /* Max file size */ | 1496 | loff_t s_maxbytes; /* Max file size */ |
| @@ -1497,8 +1534,7 @@ struct super_block { | |||
| 1497 | struct hlist_node s_instances; | 1534 | struct hlist_node s_instances; |
| 1498 | struct quota_info s_dquot; /* Diskquota specific options */ | 1535 | struct quota_info s_dquot; /* Diskquota specific options */ |
| 1499 | 1536 | ||
| 1500 | int s_frozen; | 1537 | struct sb_writers s_writers; |
| 1501 | wait_queue_head_t s_wait_unfrozen; | ||
| 1502 | 1538 | ||
| 1503 | char s_id[32]; /* Informational name */ | 1539 | char s_id[32]; /* Informational name */ |
| 1504 | u8 s_uuid[16]; /* UUID */ | 1540 | u8 s_uuid[16]; /* UUID */ |
| @@ -1553,14 +1589,117 @@ extern struct timespec current_fs_time(struct super_block *sb); | |||
| 1553 | /* | 1589 | /* |
| 1554 | * Snapshotting support. | 1590 | * Snapshotting support. |
| 1555 | */ | 1591 | */ |
| 1556 | enum { | ||
| 1557 | SB_UNFROZEN = 0, | ||
| 1558 | SB_FREEZE_WRITE = 1, | ||
| 1559 | SB_FREEZE_TRANS = 2, | ||
| 1560 | }; | ||
| 1561 | 1592 | ||
| 1562 | #define vfs_check_frozen(sb, level) \ | 1593 | void __sb_end_write(struct super_block *sb, int level); |
| 1563 | wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level))) | 1594 | int __sb_start_write(struct super_block *sb, int level, bool wait); |
| 1595 | |||
| 1596 | /** | ||
| 1597 | * sb_end_write - drop write access to a superblock | ||
| 1598 | * @sb: the super we wrote to | ||
| 1599 | * | ||
| 1600 | * Decrement number of writers to the filesystem. Wake up possible waiters | ||
| 1601 | * wanting to freeze the filesystem. | ||
| 1602 | */ | ||
| 1603 | static inline void sb_end_write(struct super_block *sb) | ||
| 1604 | { | ||
| 1605 | __sb_end_write(sb, SB_FREEZE_WRITE); | ||
| 1606 | } | ||
| 1607 | |||
| 1608 | /** | ||
| 1609 | * sb_end_pagefault - drop write access to a superblock from a page fault | ||
| 1610 | * @sb: the super we wrote to | ||
| 1611 | * | ||
| 1612 | * Decrement number of processes handling write page fault to the filesystem. | ||
| 1613 | * Wake up possible waiters wanting to freeze the filesystem. | ||
| 1614 | */ | ||
| 1615 | static inline void sb_end_pagefault(struct super_block *sb) | ||
| 1616 | { | ||
| 1617 | __sb_end_write(sb, SB_FREEZE_PAGEFAULT); | ||
| 1618 | } | ||
| 1619 | |||
| 1620 | /** | ||
| 1621 | * sb_end_intwrite - drop write access to a superblock for internal fs purposes | ||
| 1622 | * @sb: the super we wrote to | ||
| 1623 | * | ||
| 1624 | * Decrement fs-internal number of writers to the filesystem. Wake up possible | ||
| 1625 | * waiters wanting to freeze the filesystem. | ||
| 1626 | */ | ||
| 1627 | static inline void sb_end_intwrite(struct super_block *sb) | ||
| 1628 | { | ||
| 1629 | __sb_end_write(sb, SB_FREEZE_FS); | ||
| 1630 | } | ||
| 1631 | |||
| 1632 | /** | ||
| 1633 | * sb_start_write - get write access to a superblock | ||
| 1634 | * @sb: the super we write to | ||
| 1635 | * | ||
| 1636 | * When a process wants to write data or metadata to a file system (i.e. dirty | ||
| 1637 | * a page or an inode), it should embed the operation in a sb_start_write() - | ||
| 1638 | * sb_end_write() pair to get exclusion against file system freezing. This | ||
| 1639 | * function increments number of writers preventing freezing. If the file | ||
| 1640 | * system is already frozen, the function waits until the file system is | ||
| 1641 | * thawed. | ||
| 1642 | * | ||
| 1643 | * Since freeze protection behaves as a lock, users have to preserve | ||
| 1644 | * ordering of freeze protection and other filesystem locks. Generally, | ||
| 1645 | * freeze protection should be the outermost lock. In particular, we have: | ||
| 1646 | * | ||
| 1647 | * sb_start_write | ||
| 1648 | * -> i_mutex (write path, truncate, directory ops, ...) | ||
| 1649 | * -> s_umount (freeze_super, thaw_super) | ||
| 1650 | */ | ||
| 1651 | static inline void sb_start_write(struct super_block *sb) | ||
| 1652 | { | ||
| 1653 | __sb_start_write(sb, SB_FREEZE_WRITE, true); | ||
| 1654 | } | ||
| 1655 | |||
| 1656 | static inline int sb_start_write_trylock(struct super_block *sb) | ||
| 1657 | { | ||
| 1658 | return __sb_start_write(sb, SB_FREEZE_WRITE, false); | ||
| 1659 | } | ||
| 1660 | |||
| 1661 | /** | ||
| 1662 | * sb_start_pagefault - get write access to a superblock from a page fault | ||
| 1663 | * @sb: the super we write to | ||
| 1664 | * | ||
| 1665 | * When a process starts handling write page fault, it should embed the | ||
| 1666 | * operation into sb_start_pagefault() - sb_end_pagefault() pair to get | ||
| 1667 | * exclusion against file system freezing. This is needed since the page fault | ||
| 1668 | * is going to dirty a page. This function increments number of running page | ||
| 1669 | * faults preventing freezing. If the file system is already frozen, the | ||
| 1670 | * function waits until the file system is thawed. | ||
| 1671 | * | ||
| 1672 | * Since page fault freeze protection behaves as a lock, users have to preserve | ||
| 1673 | * ordering of freeze protection and other filesystem locks. It is advised to | ||
| 1674 | * put sb_start_pagefault() close to mmap_sem in lock ordering. Page fault | ||
| 1675 | * handling code implies lock dependency: | ||
| 1676 | * | ||
| 1677 | * mmap_sem | ||
| 1678 | * -> sb_start_pagefault | ||
| 1679 | */ | ||
| 1680 | static inline void sb_start_pagefault(struct super_block *sb) | ||
| 1681 | { | ||
| 1682 | __sb_start_write(sb, SB_FREEZE_PAGEFAULT, true); | ||
| 1683 | } | ||
| 1684 | |||
| 1685 | /* | ||
| 1686 | * sb_start_intwrite - get write access to a superblock for internal fs purposes | ||
| 1687 | * @sb: the super we write to | ||
| 1688 | * | ||
| 1689 | * This is the third level of protection against filesystem freezing. It is | ||
| 1690 | * free for use by a filesystem. The only requirement is that it must rank | ||
| 1691 | * below sb_start_pagefault. | ||
| 1692 | * | ||
| 1693 | * For example filesystem can call sb_start_intwrite() when starting a | ||
| 1694 | * transaction which somewhat eases handling of freezing for internal sources | ||
| 1695 | * of filesystem changes (internal fs threads, discarding preallocation on file | ||
| 1696 | * close, etc.). | ||
| 1697 | */ | ||
| 1698 | static inline void sb_start_intwrite(struct super_block *sb) | ||
| 1699 | { | ||
| 1700 | __sb_start_write(sb, SB_FREEZE_FS, true); | ||
| 1701 | } | ||
| 1702 | |||
| 1564 | 1703 | ||
| 1565 | extern bool inode_owner_or_capable(const struct inode *inode); | 1704 | extern bool inode_owner_or_capable(const struct inode *inode); |
| 1566 | 1705 | ||
| @@ -1571,7 +1710,7 @@ extern void unlock_super(struct super_block *); | |||
| 1571 | /* | 1710 | /* |
| 1572 | * VFS helper functions.. | 1711 | * VFS helper functions.. |
| 1573 | */ | 1712 | */ |
| 1574 | extern int vfs_create(struct inode *, struct dentry *, umode_t, struct nameidata *); | 1713 | extern int vfs_create(struct inode *, struct dentry *, umode_t, bool); |
| 1575 | extern int vfs_mkdir(struct inode *, struct dentry *, umode_t); | 1714 | extern int vfs_mkdir(struct inode *, struct dentry *, umode_t); |
| 1576 | extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t); | 1715 | extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t); |
| 1577 | extern int vfs_symlink(struct inode *, struct dentry *, const char *); | 1716 | extern int vfs_symlink(struct inode *, struct dentry *, const char *); |
| @@ -1666,7 +1805,7 @@ struct file_operations { | |||
| 1666 | }; | 1805 | }; |
| 1667 | 1806 | ||
| 1668 | struct inode_operations { | 1807 | struct inode_operations { |
| 1669 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); | 1808 | struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int); |
| 1670 | void * (*follow_link) (struct dentry *, struct nameidata *); | 1809 | void * (*follow_link) (struct dentry *, struct nameidata *); |
| 1671 | int (*permission) (struct inode *, int); | 1810 | int (*permission) (struct inode *, int); |
| 1672 | struct posix_acl * (*get_acl)(struct inode *, int); | 1811 | struct posix_acl * (*get_acl)(struct inode *, int); |
| @@ -1674,7 +1813,7 @@ struct inode_operations { | |||
| 1674 | int (*readlink) (struct dentry *, char __user *,int); | 1813 | int (*readlink) (struct dentry *, char __user *,int); |
| 1675 | void (*put_link) (struct dentry *, struct nameidata *, void *); | 1814 | void (*put_link) (struct dentry *, struct nameidata *, void *); |
| 1676 | 1815 | ||
| 1677 | int (*create) (struct inode *,struct dentry *,umode_t,struct nameidata *); | 1816 | int (*create) (struct inode *,struct dentry *, umode_t, bool); |
| 1678 | int (*link) (struct dentry *,struct inode *,struct dentry *); | 1817 | int (*link) (struct dentry *,struct inode *,struct dentry *); |
| 1679 | int (*unlink) (struct inode *,struct dentry *); | 1818 | int (*unlink) (struct inode *,struct dentry *); |
| 1680 | int (*symlink) (struct inode *,struct dentry *,const char *); | 1819 | int (*symlink) (struct inode *,struct dentry *,const char *); |
| @@ -1693,6 +1832,9 @@ struct inode_operations { | |||
| 1693 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, | 1832 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, |
| 1694 | u64 len); | 1833 | u64 len); |
| 1695 | int (*update_time)(struct inode *, struct timespec *, int); | 1834 | int (*update_time)(struct inode *, struct timespec *, int); |
| 1835 | int (*atomic_open)(struct inode *, struct dentry *, | ||
| 1836 | struct file *, unsigned open_flag, | ||
| 1837 | umode_t create_mode, int *opened); | ||
| 1696 | } ____cacheline_aligned; | 1838 | } ____cacheline_aligned; |
| 1697 | 1839 | ||
| 1698 | struct seq_file; | 1840 | struct seq_file; |
| @@ -1718,7 +1860,6 @@ struct super_operations { | |||
| 1718 | int (*drop_inode) (struct inode *); | 1860 | int (*drop_inode) (struct inode *); |
| 1719 | void (*evict_inode) (struct inode *); | 1861 | void (*evict_inode) (struct inode *); |
| 1720 | void (*put_super) (struct super_block *); | 1862 | void (*put_super) (struct super_block *); |
| 1721 | void (*write_super) (struct super_block *); | ||
| 1722 | int (*sync_fs)(struct super_block *sb, int wait); | 1863 | int (*sync_fs)(struct super_block *sb, int wait); |
| 1723 | int (*freeze_fs) (struct super_block *); | 1864 | int (*freeze_fs) (struct super_block *); |
| 1724 | int (*unfreeze_fs) (struct super_block *); | 1865 | int (*unfreeze_fs) (struct super_block *); |
| @@ -1881,6 +2022,7 @@ struct file_system_type { | |||
| 1881 | struct lock_class_key s_lock_key; | 2022 | struct lock_class_key s_lock_key; |
| 1882 | struct lock_class_key s_umount_key; | 2023 | struct lock_class_key s_umount_key; |
| 1883 | struct lock_class_key s_vfs_rename_key; | 2024 | struct lock_class_key s_vfs_rename_key; |
| 2025 | struct lock_class_key s_writers_key[SB_FREEZE_LEVELS]; | ||
| 1884 | 2026 | ||
| 1885 | struct lock_class_key i_lock_key; | 2027 | struct lock_class_key i_lock_key; |
| 1886 | struct lock_class_key i_mutex_key; | 2028 | struct lock_class_key i_mutex_key; |
| @@ -1911,7 +2053,7 @@ void free_anon_bdev(dev_t); | |||
| 1911 | struct super_block *sget(struct file_system_type *type, | 2053 | struct super_block *sget(struct file_system_type *type, |
| 1912 | int (*test)(struct super_block *,void *), | 2054 | int (*test)(struct super_block *,void *), |
| 1913 | int (*set)(struct super_block *,void *), | 2055 | int (*set)(struct super_block *,void *), |
| 1914 | void *data); | 2056 | int flags, void *data); |
| 1915 | extern struct dentry *mount_pseudo(struct file_system_type *, char *, | 2057 | extern struct dentry *mount_pseudo(struct file_system_type *, char *, |
| 1916 | const struct super_operations *ops, | 2058 | const struct super_operations *ops, |
| 1917 | const struct dentry_operations *dops, | 2059 | const struct dentry_operations *dops, |
| @@ -2057,10 +2199,17 @@ extern long do_sys_open(int dfd, const char __user *filename, int flags, | |||
| 2057 | extern struct file *filp_open(const char *, int, umode_t); | 2199 | extern struct file *filp_open(const char *, int, umode_t); |
| 2058 | extern struct file *file_open_root(struct dentry *, struct vfsmount *, | 2200 | extern struct file *file_open_root(struct dentry *, struct vfsmount *, |
| 2059 | const char *, int); | 2201 | const char *, int); |
| 2060 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, | 2202 | extern struct file * dentry_open(const struct path *, int, const struct cred *); |
| 2061 | const struct cred *); | ||
| 2062 | extern int filp_close(struct file *, fl_owner_t id); | 2203 | extern int filp_close(struct file *, fl_owner_t id); |
| 2063 | extern char * getname(const char __user *); | 2204 | extern char * getname(const char __user *); |
| 2205 | enum { | ||
| 2206 | FILE_CREATED = 1, | ||
| 2207 | FILE_OPENED = 2 | ||
| 2208 | }; | ||
| 2209 | extern int finish_open(struct file *file, struct dentry *dentry, | ||
| 2210 | int (*open)(struct inode *, struct file *), | ||
| 2211 | int *opened); | ||
| 2212 | extern int finish_no_open(struct file *file, struct dentry *dentry); | ||
| 2064 | 2213 | ||
| 2065 | /* fs/ioctl.c */ | 2214 | /* fs/ioctl.c */ |
| 2066 | 2215 | ||
| @@ -2091,6 +2240,7 @@ extern sector_t blkdev_max_block(struct block_device *bdev); | |||
| 2091 | extern void bd_forget(struct inode *inode); | 2240 | extern void bd_forget(struct inode *inode); |
| 2092 | extern void bdput(struct block_device *); | 2241 | extern void bdput(struct block_device *); |
| 2093 | extern void invalidate_bdev(struct block_device *); | 2242 | extern void invalidate_bdev(struct block_device *); |
| 2243 | extern void iterate_bdevs(void (*)(struct block_device *, void *), void *); | ||
| 2094 | extern int sync_blockdev(struct block_device *bdev); | 2244 | extern int sync_blockdev(struct block_device *bdev); |
| 2095 | extern void kill_bdev(struct block_device *); | 2245 | extern void kill_bdev(struct block_device *); |
| 2096 | extern struct super_block *freeze_bdev(struct block_device *); | 2246 | extern struct super_block *freeze_bdev(struct block_device *); |
| @@ -2112,6 +2262,10 @@ static inline int thaw_bdev(struct block_device *bdev, struct super_block *sb) | |||
| 2112 | { | 2262 | { |
| 2113 | return 0; | 2263 | return 0; |
| 2114 | } | 2264 | } |
| 2265 | |||
| 2266 | static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void *arg) | ||
| 2267 | { | ||
| 2268 | } | ||
| 2115 | #endif | 2269 | #endif |
| 2116 | extern int sync_filesystem(struct super_block *); | 2270 | extern int sync_filesystem(struct super_block *); |
| 2117 | extern const struct file_operations def_blk_fops; | 2271 | extern const struct file_operations def_blk_fops; |
| @@ -2241,7 +2395,6 @@ extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end, | |||
| 2241 | int datasync); | 2395 | int datasync); |
| 2242 | extern int vfs_fsync(struct file *file, int datasync); | 2396 | extern int vfs_fsync(struct file *file, int datasync); |
| 2243 | extern int generic_write_sync(struct file *file, loff_t pos, loff_t count); | 2397 | extern int generic_write_sync(struct file *file, loff_t pos, loff_t count); |
| 2244 | extern void sync_supers(void); | ||
| 2245 | extern void emergency_sync(void); | 2398 | extern void emergency_sync(void); |
| 2246 | extern void emergency_remount(void); | 2399 | extern void emergency_remount(void); |
| 2247 | #ifdef CONFIG_BLOCK | 2400 | #ifdef CONFIG_BLOCK |
| @@ -2311,9 +2464,6 @@ static inline void i_readcount_inc(struct inode *inode) | |||
| 2311 | } | 2464 | } |
| 2312 | #endif | 2465 | #endif |
| 2313 | extern int do_pipe_flags(int *, int); | 2466 | extern int do_pipe_flags(int *, int); |
| 2314 | extern struct file *create_read_pipe(struct file *f, int flags); | ||
| 2315 | extern struct file *create_write_pipe(int flags); | ||
| 2316 | extern void free_write_pipe(struct file *); | ||
| 2317 | 2467 | ||
| 2318 | extern int kernel_read(struct file *, loff_t, char *, unsigned long); | 2468 | extern int kernel_read(struct file *, loff_t, char *, unsigned long); |
| 2319 | extern struct file * open_exec(const char *); | 2469 | extern struct file * open_exec(const char *); |
| @@ -2438,7 +2588,7 @@ extern loff_t noop_llseek(struct file *file, loff_t offset, int origin); | |||
| 2438 | extern loff_t no_llseek(struct file *file, loff_t offset, int origin); | 2588 | extern loff_t no_llseek(struct file *file, loff_t offset, int origin); |
| 2439 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); | 2589 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); |
| 2440 | extern loff_t generic_file_llseek_size(struct file *file, loff_t offset, | 2590 | extern loff_t generic_file_llseek_size(struct file *file, loff_t offset, |
| 2441 | int origin, loff_t maxsize); | 2591 | int origin, loff_t maxsize, loff_t eof); |
| 2442 | extern int generic_file_open(struct inode * inode, struct file * filp); | 2592 | extern int generic_file_open(struct inode * inode, struct file * filp); |
| 2443 | extern int nonseekable_open(struct inode * inode, struct file * filp); | 2593 | extern int nonseekable_open(struct inode * inode, struct file * filp); |
| 2444 | 2594 | ||
| @@ -2560,7 +2710,7 @@ extern int simple_write_end(struct file *file, struct address_space *mapping, | |||
| 2560 | loff_t pos, unsigned len, unsigned copied, | 2710 | loff_t pos, unsigned len, unsigned copied, |
| 2561 | struct page *page, void *fsdata); | 2711 | struct page *page, void *fsdata); |
| 2562 | 2712 | ||
| 2563 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); | 2713 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags); |
| 2564 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); | 2714 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); |
| 2565 | extern const struct file_operations simple_dir_operations; | 2715 | extern const struct file_operations simple_dir_operations; |
| 2566 | extern const struct inode_operations simple_dir_inode_operations; | 2716 | extern const struct inode_operations simple_dir_inode_operations; |
