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.h54
1 files changed, 30 insertions, 24 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 3b534e527e09..a36ffa5a77a4 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -710,6 +710,9 @@ static inline int mapping_writably_mapped(struct address_space *mapping)
710#define i_size_ordered_init(inode) do { } while (0) 710#define i_size_ordered_init(inode) do { } while (0)
711#endif 711#endif
712 712
713struct posix_acl;
714#define ACL_NOT_CACHED ((void *)(-1))
715
713struct inode { 716struct inode {
714 struct hlist_node i_hash; 717 struct hlist_node i_hash;
715 struct list_head i_list; 718 struct list_head i_list;
@@ -729,8 +732,8 @@ struct inode {
729 struct timespec i_atime; 732 struct timespec i_atime;
730 struct timespec i_mtime; 733 struct timespec i_mtime;
731 struct timespec i_ctime; 734 struct timespec i_ctime;
732 unsigned int i_blkbits;
733 blkcnt_t i_blocks; 735 blkcnt_t i_blocks;
736 unsigned int i_blkbits;
734 unsigned short i_bytes; 737 unsigned short i_bytes;
735 umode_t i_mode; 738 umode_t i_mode;
736 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ 739 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
@@ -751,13 +754,12 @@ struct inode {
751 struct block_device *i_bdev; 754 struct block_device *i_bdev;
752 struct cdev *i_cdev; 755 struct cdev *i_cdev;
753 }; 756 };
754 int i_cindex;
755 757
756 __u32 i_generation; 758 __u32 i_generation;
757 759
758#ifdef CONFIG_DNOTIFY 760#ifdef CONFIG_FSNOTIFY
759 unsigned long i_dnotify_mask; /* Directory notify events */ 761 __u32 i_fsnotify_mask; /* all events this inode cares about */
760 struct dnotify_struct *i_dnotify; /* for directory notifications */ 762 struct hlist_head i_fsnotify_mark_entries; /* fsnotify mark entries */
761#endif 763#endif
762 764
763#ifdef CONFIG_INOTIFY 765#ifdef CONFIG_INOTIFY
@@ -774,6 +776,10 @@ struct inode {
774#ifdef CONFIG_SECURITY 776#ifdef CONFIG_SECURITY
775 void *i_security; 777 void *i_security;
776#endif 778#endif
779#ifdef CONFIG_FS_POSIX_ACL
780 struct posix_acl *i_acl;
781 struct posix_acl *i_default_acl;
782#endif
777 void *i_private; /* fs or device private pointer */ 783 void *i_private; /* fs or device private pointer */
778}; 784};
779 785
@@ -880,7 +886,7 @@ struct file_ra_state {
880 there are only # of pages ahead */ 886 there are only # of pages ahead */
881 887
882 unsigned int ra_pages; /* Maximum readahead window */ 888 unsigned int ra_pages; /* Maximum readahead window */
883 int mmap_miss; /* Cache miss stat for mmap accesses */ 889 unsigned int mmap_miss; /* Cache miss stat for mmap accesses */
884 loff_t prev_pos; /* Cache last read() position */ 890 loff_t prev_pos; /* Cache last read() position */
885}; 891};
886 892
@@ -1108,6 +1114,7 @@ extern void locks_copy_lock(struct file_lock *, struct file_lock *);
1108extern void __locks_copy_lock(struct file_lock *, const struct file_lock *); 1114extern void __locks_copy_lock(struct file_lock *, const struct file_lock *);
1109extern void locks_remove_posix(struct file *, fl_owner_t); 1115extern void locks_remove_posix(struct file *, fl_owner_t);
1110extern void locks_remove_flock(struct file *); 1116extern void locks_remove_flock(struct file *);
1117extern void locks_release_private(struct file_lock *);
1111extern void posix_test_lock(struct file *, struct file_lock *); 1118extern void posix_test_lock(struct file *, struct file_lock *);
1112extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); 1119extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
1113extern int posix_lock_file_wait(struct file *, struct file_lock *); 1120extern int posix_lock_file_wait(struct file *, struct file_lock *);
@@ -1321,7 +1328,7 @@ struct super_block {
1321 struct rw_semaphore s_umount; 1328 struct rw_semaphore s_umount;
1322 struct mutex s_lock; 1329 struct mutex s_lock;
1323 int s_count; 1330 int s_count;
1324 int s_need_sync_fs; 1331 int s_need_sync;
1325 atomic_t s_active; 1332 atomic_t s_active;
1326#ifdef CONFIG_SECURITY 1333#ifdef CONFIG_SECURITY
1327 void *s_security; 1334 void *s_security;
@@ -1372,11 +1379,6 @@ struct super_block {
1372 * generic_show_options() 1379 * generic_show_options()
1373 */ 1380 */
1374 char *s_options; 1381 char *s_options;
1375
1376 /*
1377 * storage for asynchronous operations
1378 */
1379 struct list_head s_async_list;
1380}; 1382};
1381 1383
1382extern struct timespec current_fs_time(struct super_block *sb); 1384extern struct timespec current_fs_time(struct super_block *sb);
@@ -1800,7 +1802,7 @@ extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data);
1800extern int may_umount_tree(struct vfsmount *); 1802extern int may_umount_tree(struct vfsmount *);
1801extern int may_umount(struct vfsmount *); 1803extern int may_umount(struct vfsmount *);
1802extern long do_mount(char *, char *, char *, unsigned long, void *); 1804extern long do_mount(char *, char *, char *, unsigned long, void *);
1803extern struct vfsmount *collect_mounts(struct vfsmount *, struct dentry *); 1805extern struct vfsmount *collect_mounts(struct path *);
1804extern void drop_collected_mounts(struct vfsmount *); 1806extern void drop_collected_mounts(struct vfsmount *);
1805 1807
1806extern int vfs_statfs(struct dentry *, struct kstatfs *); 1808extern int vfs_statfs(struct dentry *, struct kstatfs *);
@@ -1911,6 +1913,8 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
1911 1913
1912extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, 1914extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,
1913 struct file *filp); 1915 struct file *filp);
1916extern int do_fallocate(struct file *file, int mode, loff_t offset,
1917 loff_t len);
1914extern long do_sys_open(int dfd, const char __user *filename, int flags, 1918extern long do_sys_open(int dfd, const char __user *filename, int flags,
1915 int mode); 1919 int mode);
1916extern struct file *filp_open(const char *, int, int); 1920extern struct file *filp_open(const char *, int, int);
@@ -1919,14 +1923,19 @@ extern struct file * dentry_open(struct dentry *, struct vfsmount *, int,
1919extern int filp_close(struct file *, fl_owner_t id); 1923extern int filp_close(struct file *, fl_owner_t id);
1920extern char * getname(const char __user *); 1924extern char * getname(const char __user *);
1921 1925
1926/* fs/ioctl.c */
1927
1928extern int ioctl_preallocate(struct file *filp, void __user *argp);
1929
1922/* fs/dcache.c */ 1930/* fs/dcache.c */
1923extern void __init vfs_caches_init_early(void); 1931extern void __init vfs_caches_init_early(void);
1924extern void __init vfs_caches_init(unsigned long); 1932extern void __init vfs_caches_init(unsigned long);
1925 1933
1926extern struct kmem_cache *names_cachep; 1934extern struct kmem_cache *names_cachep;
1927 1935
1928#define __getname() kmem_cache_alloc(names_cachep, GFP_KERNEL) 1936#define __getname_gfp(gfp) kmem_cache_alloc(names_cachep, (gfp))
1929#define __putname(name) kmem_cache_free(names_cachep, (void *)(name)) 1937#define __getname() __getname_gfp(GFP_KERNEL)
1938#define __putname(name) kmem_cache_free(names_cachep, (void *)(name))
1930#ifndef CONFIG_AUDITSYSCALL 1939#ifndef CONFIG_AUDITSYSCALL
1931#define putname(name) __putname(name) 1940#define putname(name) __putname(name)
1932#else 1941#else
@@ -1937,6 +1946,7 @@ extern void putname(const char *name);
1937extern int register_blkdev(unsigned int, const char *); 1946extern int register_blkdev(unsigned int, const char *);
1938extern void unregister_blkdev(unsigned int, const char *); 1947extern void unregister_blkdev(unsigned int, const char *);
1939extern struct block_device *bdget(dev_t); 1948extern struct block_device *bdget(dev_t);
1949extern struct block_device *bdgrab(struct block_device *bdev);
1940extern void bd_set_size(struct block_device *, loff_t size); 1950extern void bd_set_size(struct block_device *, loff_t size);
1941extern void bd_forget(struct inode *inode); 1951extern void bd_forget(struct inode *inode);
1942extern void bdput(struct block_device *); 1952extern void bdput(struct block_device *);
@@ -1947,8 +1957,6 @@ extern struct super_block *freeze_bdev(struct block_device *);
1947extern void emergency_thaw_all(void); 1957extern void emergency_thaw_all(void);
1948extern int thaw_bdev(struct block_device *bdev, struct super_block *sb); 1958extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
1949extern int fsync_bdev(struct block_device *); 1959extern int fsync_bdev(struct block_device *);
1950extern int fsync_super(struct super_block *);
1951extern int fsync_no_super(struct block_device *);
1952#else 1960#else
1953static inline void bd_forget(struct inode *inode) {} 1961static inline void bd_forget(struct inode *inode) {}
1954static inline int sync_blockdev(struct block_device *bdev) { return 0; } 1962static inline int sync_blockdev(struct block_device *bdev) { return 0; }
@@ -1964,6 +1972,7 @@ static inline int thaw_bdev(struct block_device *bdev, struct super_block *sb)
1964 return 0; 1972 return 0;
1965} 1973}
1966#endif 1974#endif
1975extern int sync_filesystem(struct super_block *);
1967extern const struct file_operations def_blk_fops; 1976extern const struct file_operations def_blk_fops;
1968extern const struct file_operations def_chr_fops; 1977extern const struct file_operations def_chr_fops;
1969extern const struct file_operations bad_sock_fops; 1978extern const struct file_operations bad_sock_fops;
@@ -2043,9 +2052,6 @@ extern int __invalidate_device(struct block_device *);
2043extern int invalidate_partition(struct gendisk *, int); 2052extern int invalidate_partition(struct gendisk *, int);
2044#endif 2053#endif
2045extern int invalidate_inodes(struct super_block *); 2054extern int invalidate_inodes(struct super_block *);
2046unsigned long __invalidate_mapping_pages(struct address_space *mapping,
2047 pgoff_t start, pgoff_t end,
2048 bool be_atomic);
2049unsigned long invalidate_mapping_pages(struct address_space *mapping, 2055unsigned long invalidate_mapping_pages(struct address_space *mapping,
2050 pgoff_t start, pgoff_t end); 2056 pgoff_t start, pgoff_t end);
2051 2057
@@ -2082,12 +2088,8 @@ extern int filemap_fdatawrite_range(struct address_space *mapping,
2082 2088
2083extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync); 2089extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync);
2084extern void sync_supers(void); 2090extern void sync_supers(void);
2085extern void sync_filesystems(int wait);
2086extern void __fsync_super(struct super_block *sb);
2087extern void emergency_sync(void); 2091extern void emergency_sync(void);
2088extern void emergency_remount(void); 2092extern void emergency_remount(void);
2089extern int do_remount_sb(struct super_block *sb, int flags,
2090 void *data, int force);
2091#ifdef CONFIG_BLOCK 2093#ifdef CONFIG_BLOCK
2092extern sector_t bmap(struct inode *, sector_t); 2094extern sector_t bmap(struct inode *, sector_t);
2093#endif 2095#endif
@@ -2205,6 +2207,8 @@ extern int generic_segment_checks(const struct iovec *iov,
2205/* fs/splice.c */ 2207/* fs/splice.c */
2206extern ssize_t generic_file_splice_read(struct file *, loff_t *, 2208extern ssize_t generic_file_splice_read(struct file *, loff_t *,
2207 struct pipe_inode_info *, size_t, unsigned int); 2209 struct pipe_inode_info *, size_t, unsigned int);
2210extern ssize_t default_file_splice_read(struct file *, loff_t *,
2211 struct pipe_inode_info *, size_t, unsigned int);
2208extern ssize_t generic_file_splice_write(struct pipe_inode_info *, 2212extern ssize_t generic_file_splice_write(struct pipe_inode_info *,
2209 struct file *, loff_t *, size_t, unsigned int); 2213 struct file *, loff_t *, size_t, unsigned int);
2210extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, 2214extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe,
@@ -2354,6 +2358,8 @@ extern void simple_release_fs(struct vfsmount **mount, int *count);
2354extern ssize_t simple_read_from_buffer(void __user *to, size_t count, 2358extern ssize_t simple_read_from_buffer(void __user *to, size_t count,
2355 loff_t *ppos, const void *from, size_t available); 2359 loff_t *ppos, const void *from, size_t available);
2356 2360
2361extern int simple_fsync(struct file *, struct dentry *, int);
2362
2357#ifdef CONFIG_MIGRATION 2363#ifdef CONFIG_MIGRATION
2358extern int buffer_migrate_page(struct address_space *, 2364extern int buffer_migrate_page(struct address_space *,
2359 struct page *, struct page *); 2365 struct page *, struct page *);