diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2011-03-17 03:44:08 -0400 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2011-03-17 03:44:08 -0400 |
| commit | 1d2a1959fe534279cf37aba20b08c24c20840e52 (patch) | |
| tree | 67c0b9aa7fe22a44bf0b4af88947799203eb8f67 /include/linux/fs.h | |
| parent | 5a79ce76e9bb8f4b2cd8106ee36d15ee05013bcf (diff) | |
| parent | 054cfaacf88865bff1dd58d305443d5d6c068a08 (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into sh-latest
Diffstat (limited to 'include/linux/fs.h')
| -rw-r--r-- | include/linux/fs.h | 62 |
1 files changed, 41 insertions, 21 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index bd3215940c37..92f7e04aea11 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 | ||
| @@ -649,6 +652,7 @@ struct address_space { | |||
| 649 | spinlock_t private_lock; /* for use by the address_space */ | 652 | spinlock_t private_lock; /* for use by the address_space */ |
| 650 | struct list_head private_list; /* ditto */ | 653 | struct list_head private_list; /* ditto */ |
| 651 | struct address_space *assoc_mapping; /* ditto */ | 654 | struct address_space *assoc_mapping; /* ditto */ |
| 655 | struct mutex unmap_mutex; /* to protect unmapping */ | ||
| 652 | } __attribute__((aligned(sizeof(long)))); | 656 | } __attribute__((aligned(sizeof(long)))); |
| 653 | /* | 657 | /* |
| 654 | * On most architectures that alignment is already the case; but | 658 | * On most architectures that alignment is already the case; but |
| @@ -797,8 +801,7 @@ struct inode { | |||
| 797 | #endif | 801 | #endif |
| 798 | 802 | ||
| 799 | #ifdef CONFIG_IMA | 803 | #ifdef CONFIG_IMA |
| 800 | /* protected by i_lock */ | 804 | atomic_t i_readcount; /* struct files open RO */ |
| 801 | unsigned int i_readcount; /* struct files open RO */ | ||
| 802 | #endif | 805 | #endif |
| 803 | atomic_t i_writecount; | 806 | atomic_t i_writecount; |
| 804 | #ifdef CONFIG_SECURITY | 807 | #ifdef CONFIG_SECURITY |
| @@ -977,6 +980,13 @@ struct file { | |||
| 977 | #endif | 980 | #endif |
| 978 | }; | 981 | }; |
| 979 | 982 | ||
| 983 | struct file_handle { | ||
| 984 | __u32 handle_bytes; | ||
| 985 | int handle_type; | ||
| 986 | /* file identifier */ | ||
| 987 | unsigned char f_handle[0]; | ||
| 988 | }; | ||
| 989 | |||
| 980 | #define get_file(x) atomic_long_inc(&(x)->f_count) | 990 | #define get_file(x) atomic_long_inc(&(x)->f_count) |
| 981 | #define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1) | 991 | #define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1) |
| 982 | #define file_count(x) atomic_long_read(&(x)->f_count) | 992 | #define file_count(x) atomic_long_read(&(x)->f_count) |
| @@ -1400,6 +1410,7 @@ struct super_block { | |||
| 1400 | wait_queue_head_t s_wait_unfrozen; | 1410 | wait_queue_head_t s_wait_unfrozen; |
| 1401 | 1411 | ||
| 1402 | char s_id[32]; /* Informational name */ | 1412 | char s_id[32]; /* Informational name */ |
| 1413 | u8 s_uuid[16]; /* UUID */ | ||
| 1403 | 1414 | ||
| 1404 | void *s_fs_info; /* Filesystem private info */ | 1415 | void *s_fs_info; /* Filesystem private info */ |
| 1405 | fmode_t s_mode; | 1416 | fmode_t s_mode; |
| @@ -1620,6 +1631,8 @@ struct super_operations { | |||
| 1620 | void (*umount_begin) (struct super_block *); | 1631 | void (*umount_begin) (struct super_block *); |
| 1621 | 1632 | ||
| 1622 | int (*show_options)(struct seq_file *, struct vfsmount *); | 1633 | int (*show_options)(struct seq_file *, struct vfsmount *); |
| 1634 | int (*show_devname)(struct seq_file *, struct vfsmount *); | ||
| 1635 | int (*show_path)(struct seq_file *, struct vfsmount *); | ||
| 1623 | int (*show_stats)(struct seq_file *, struct vfsmount *); | 1636 | int (*show_stats)(struct seq_file *, struct vfsmount *); |
| 1624 | #ifdef CONFIG_QUOTA | 1637 | #ifdef CONFIG_QUOTA |
| 1625 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); | 1638 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); |
| @@ -1783,8 +1796,6 @@ int sync_inode_metadata(struct inode *inode, int wait); | |||
| 1783 | struct file_system_type { | 1796 | struct file_system_type { |
| 1784 | const char *name; | 1797 | const char *name; |
| 1785 | int fs_flags; | 1798 | 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, | 1799 | struct dentry *(*mount) (struct file_system_type *, int, |
| 1789 | const char *, void *); | 1800 | const char *, void *); |
| 1790 | void (*kill_sb) (struct super_block *); | 1801 | void (*kill_sb) (struct super_block *); |
| @@ -1807,24 +1818,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, | 1818 | extern struct dentry *mount_bdev(struct file_system_type *fs_type, |
| 1808 | int flags, const char *dev_name, void *data, | 1819 | int flags, const char *dev_name, void *data, |
| 1809 | int (*fill_super)(struct super_block *, void *, int)); | 1820 | 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, | 1821 | extern struct dentry *mount_single(struct file_system_type *fs_type, |
| 1815 | int flags, void *data, | 1822 | int flags, void *data, |
| 1816 | int (*fill_super)(struct super_block *, void *, int)); | 1823 | 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, | 1824 | extern struct dentry *mount_nodev(struct file_system_type *fs_type, |
| 1822 | int flags, void *data, | 1825 | int flags, void *data, |
| 1823 | int (*fill_super)(struct super_block *, void *, int)); | 1826 | 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); | 1827 | void generic_shutdown_super(struct super_block *sb); |
| 1829 | void kill_block_super(struct super_block *sb); | 1828 | void kill_block_super(struct super_block *sb); |
| 1830 | void kill_anon_super(struct super_block *sb); | 1829 | void kill_anon_super(struct super_block *sb); |
| @@ -1873,6 +1872,8 @@ extern void drop_collected_mounts(struct vfsmount *); | |||
| 1873 | extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *, | 1872 | extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *, |
| 1874 | struct vfsmount *); | 1873 | struct vfsmount *); |
| 1875 | extern int vfs_statfs(struct path *, struct kstatfs *); | 1874 | extern int vfs_statfs(struct path *, struct kstatfs *); |
| 1875 | extern int user_statfs(const char __user *, struct kstatfs *); | ||
| 1876 | extern int fd_statfs(int, struct kstatfs *); | ||
| 1876 | extern int statfs_by_dentry(struct dentry *, struct kstatfs *); | 1877 | extern int statfs_by_dentry(struct dentry *, struct kstatfs *); |
| 1877 | extern int freeze_super(struct super_block *super); | 1878 | extern int freeze_super(struct super_block *super); |
| 1878 | extern int thaw_super(struct super_block *super); | 1879 | extern int thaw_super(struct super_block *super); |
| @@ -1989,6 +1990,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, | 1990 | extern long do_sys_open(int dfd, const char __user *filename, int flags, |
| 1990 | int mode); | 1991 | int mode); |
| 1991 | extern struct file *filp_open(const char *, int, int); | 1992 | extern struct file *filp_open(const char *, int, int); |
| 1993 | extern struct file *file_open_root(struct dentry *, struct vfsmount *, | ||
| 1994 | const char *, int); | ||
| 1992 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, | 1995 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, |
| 1993 | const struct cred *); | 1996 | const struct cred *); |
| 1994 | extern int filp_close(struct file *, fl_owner_t id); | 1997 | extern int filp_close(struct file *, fl_owner_t id); |
| @@ -2139,7 +2142,7 @@ extern void check_disk_size_change(struct gendisk *disk, | |||
| 2139 | struct block_device *bdev); | 2142 | struct block_device *bdev); |
| 2140 | extern int revalidate_disk(struct gendisk *); | 2143 | extern int revalidate_disk(struct gendisk *); |
| 2141 | extern int check_disk_change(struct block_device *); | 2144 | extern int check_disk_change(struct block_device *); |
| 2142 | extern int __invalidate_device(struct block_device *); | 2145 | extern int __invalidate_device(struct block_device *, bool); |
| 2143 | extern int invalidate_partition(struct gendisk *, int); | 2146 | extern int invalidate_partition(struct gendisk *, int); |
| 2144 | #endif | 2147 | #endif |
| 2145 | unsigned long invalidate_mapping_pages(struct address_space *mapping, | 2148 | unsigned long invalidate_mapping_pages(struct address_space *mapping, |
| @@ -2199,15 +2202,31 @@ static inline void allow_write_access(struct file *file) | |||
| 2199 | if (file) | 2202 | if (file) |
| 2200 | atomic_inc(&file->f_path.dentry->d_inode->i_writecount); | 2203 | atomic_inc(&file->f_path.dentry->d_inode->i_writecount); |
| 2201 | } | 2204 | } |
| 2205 | #ifdef CONFIG_IMA | ||
| 2206 | static inline void i_readcount_dec(struct inode *inode) | ||
| 2207 | { | ||
| 2208 | BUG_ON(!atomic_read(&inode->i_readcount)); | ||
| 2209 | atomic_dec(&inode->i_readcount); | ||
| 2210 | } | ||
| 2211 | static inline void i_readcount_inc(struct inode *inode) | ||
| 2212 | { | ||
| 2213 | atomic_inc(&inode->i_readcount); | ||
| 2214 | } | ||
| 2215 | #else | ||
| 2216 | static inline void i_readcount_dec(struct inode *inode) | ||
| 2217 | { | ||
| 2218 | return; | ||
| 2219 | } | ||
| 2220 | static inline void i_readcount_inc(struct inode *inode) | ||
| 2221 | { | ||
| 2222 | return; | ||
| 2223 | } | ||
| 2224 | #endif | ||
| 2202 | extern int do_pipe_flags(int *, int); | 2225 | extern int do_pipe_flags(int *, int); |
| 2203 | extern struct file *create_read_pipe(struct file *f, int flags); | 2226 | extern struct file *create_read_pipe(struct file *f, int flags); |
| 2204 | extern struct file *create_write_pipe(int flags); | 2227 | extern struct file *create_write_pipe(int flags); |
| 2205 | extern void free_write_pipe(struct file *); | 2228 | extern void free_write_pipe(struct file *); |
| 2206 | 2229 | ||
| 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); | 2230 | extern int kernel_read(struct file *, loff_t, char *, unsigned long); |
| 2212 | extern struct file * open_exec(const char *); | 2231 | extern struct file * open_exec(const char *); |
| 2213 | 2232 | ||
| @@ -2225,6 +2244,7 @@ extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); | |||
| 2225 | 2244 | ||
| 2226 | extern int inode_init_always(struct super_block *, struct inode *); | 2245 | extern int inode_init_always(struct super_block *, struct inode *); |
| 2227 | extern void inode_init_once(struct inode *); | 2246 | extern void inode_init_once(struct inode *); |
| 2247 | extern void address_space_init_once(struct address_space *mapping); | ||
| 2228 | extern void ihold(struct inode * inode); | 2248 | extern void ihold(struct inode * inode); |
| 2229 | extern void iput(struct inode *); | 2249 | extern void iput(struct inode *); |
| 2230 | extern struct inode * igrab(struct inode *); | 2250 | extern struct inode * igrab(struct inode *); |
