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.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 151739a55eaf..b3ae77cccbb6 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -30,6 +30,7 @@
30#define SEEK_SET 0 /* seek relative to beginning of file */ 30#define SEEK_SET 0 /* seek relative to beginning of file */
31#define SEEK_CUR 1 /* seek relative to current file position */ 31#define SEEK_CUR 1 /* seek relative to current file position */
32#define SEEK_END 2 /* seek relative to end of file */ 32#define SEEK_END 2 /* seek relative to end of file */
33#define SEEK_MAX SEEK_END
33 34
34/* And dynamically-tunable limits and defaults: */ 35/* And dynamically-tunable limits and defaults: */
35struct files_stat_struct { 36struct files_stat_struct {
@@ -91,6 +92,7 @@ extern int dir_notify_enable;
91/* public flags for file_system_type */ 92/* public flags for file_system_type */
92#define FS_REQUIRES_DEV 1 93#define FS_REQUIRES_DEV 1
93#define FS_BINARY_MOUNTDATA 2 94#define FS_BINARY_MOUNTDATA 2
95#define FS_HAS_SUBTYPE 4
94#define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */ 96#define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */
95#define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() 97#define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move()
96 * during rename() internally. 98 * during rename() internally.
@@ -696,12 +698,13 @@ struct file_ra_state {
696 unsigned long size; 698 unsigned long size;
697 unsigned long flags; /* ra flags RA_FLAG_xxx*/ 699 unsigned long flags; /* ra flags RA_FLAG_xxx*/
698 unsigned long cache_hit; /* cache hit count*/ 700 unsigned long cache_hit; /* cache hit count*/
699 unsigned long prev_page; /* Cache last read() position */ 701 unsigned long prev_index; /* Cache last read() position */
700 unsigned long ahead_start; /* Ahead window */ 702 unsigned long ahead_start; /* Ahead window */
701 unsigned long ahead_size; 703 unsigned long ahead_size;
702 unsigned long ra_pages; /* Maximum readahead window */ 704 unsigned long ra_pages; /* Maximum readahead window */
703 unsigned long mmap_hit; /* Cache hit stat for mmap accesses */ 705 unsigned long mmap_hit; /* Cache hit stat for mmap accesses */
704 unsigned long mmap_miss; /* Cache miss stat for mmap accesses */ 706 unsigned long mmap_miss; /* Cache miss stat for mmap accesses */
707 unsigned int prev_offset; /* Offset where last read() ended in a page */
705}; 708};
706#define RA_FLAG_MISS 0x01 /* a cache miss occured against this file */ 709#define RA_FLAG_MISS 0x01 /* a cache miss occured against this file */
707#define RA_FLAG_INCACHE 0x02 /* file is already in cache */ 710#define RA_FLAG_INCACHE 0x02 /* file is already in cache */
@@ -785,6 +788,7 @@ struct file_lock_operations {
785struct lock_manager_operations { 788struct lock_manager_operations {
786 int (*fl_compare_owner)(struct file_lock *, struct file_lock *); 789 int (*fl_compare_owner)(struct file_lock *, struct file_lock *);
787 void (*fl_notify)(struct file_lock *); /* unblock callback */ 790 void (*fl_notify)(struct file_lock *); /* unblock callback */
791 int (*fl_grant)(struct file_lock *, struct file_lock *, int);
788 void (*fl_copy_lock)(struct file_lock *, struct file_lock *); 792 void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
789 void (*fl_release_private)(struct file_lock *); 793 void (*fl_release_private)(struct file_lock *);
790 void (*fl_break)(struct file_lock *); 794 void (*fl_break)(struct file_lock *);
@@ -845,22 +849,19 @@ extern int fcntl_getlease(struct file *filp);
845/* fs/sync.c */ 849/* fs/sync.c */
846extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset, 850extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset,
847 loff_t endbyte, unsigned int flags); 851 loff_t endbyte, unsigned int flags);
848static inline int do_sync_file_range(struct file *file, loff_t offset,
849 loff_t endbyte, unsigned int flags)
850{
851 return do_sync_mapping_range(file->f_mapping, offset, endbyte, flags);
852}
853 852
854/* fs/locks.c */ 853/* fs/locks.c */
855extern void locks_init_lock(struct file_lock *); 854extern void locks_init_lock(struct file_lock *);
856extern void locks_copy_lock(struct file_lock *, struct file_lock *); 855extern void locks_copy_lock(struct file_lock *, struct file_lock *);
857extern void locks_remove_posix(struct file *, fl_owner_t); 856extern void locks_remove_posix(struct file *, fl_owner_t);
858extern void locks_remove_flock(struct file *); 857extern void locks_remove_flock(struct file *);
859extern int posix_test_lock(struct file *, struct file_lock *, struct file_lock *); 858extern int posix_test_lock(struct file *, struct file_lock *);
860extern int posix_lock_file_conf(struct file *, struct file_lock *, struct file_lock *); 859extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
861extern int posix_lock_file(struct file *, struct file_lock *);
862extern int posix_lock_file_wait(struct file *, struct file_lock *); 860extern int posix_lock_file_wait(struct file *, struct file_lock *);
863extern int posix_unblock_lock(struct file *, struct file_lock *); 861extern int posix_unblock_lock(struct file *, struct file_lock *);
862extern int vfs_test_lock(struct file *, struct file_lock *);
863extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *);
864extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
864extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); 865extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
865extern int __break_lease(struct inode *inode, unsigned int flags); 866extern int __break_lease(struct inode *inode, unsigned int flags);
866extern void lease_get_mtime(struct inode *, struct timespec *time); 867extern void lease_get_mtime(struct inode *, struct timespec *time);
@@ -957,6 +958,12 @@ struct super_block {
957 /* Granularity of c/m/atime in ns. 958 /* Granularity of c/m/atime in ns.
958 Cannot be worse than a second */ 959 Cannot be worse than a second */
959 u32 s_time_gran; 960 u32 s_time_gran;
961
962 /*
963 * Filesystem subtype. If non-empty the filesystem type field
964 * in /proc/mounts will be "type.subtype"
965 */
966 char *s_subtype;
960}; 967};
961 968
962extern struct timespec current_fs_time(struct super_block *sb); 969extern struct timespec current_fs_time(struct super_block *sb);
@@ -1417,7 +1424,7 @@ extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
1417extern int vfs_statfs(struct dentry *, struct kstatfs *); 1424extern int vfs_statfs(struct dentry *, struct kstatfs *);
1418 1425
1419/* /sys/fs */ 1426/* /sys/fs */
1420extern struct subsystem fs_subsys; 1427extern struct kset fs_subsys;
1421 1428
1422#define FLOCK_VERIFY_READ 1 1429#define FLOCK_VERIFY_READ 1
1423#define FLOCK_VERIFY_WRITE 2 1430#define FLOCK_VERIFY_WRITE 2
@@ -1732,6 +1739,8 @@ extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor
1732extern void do_generic_mapping_read(struct address_space *mapping, 1739extern void do_generic_mapping_read(struct address_space *mapping,
1733 struct file_ra_state *, struct file *, 1740 struct file_ra_state *, struct file *,
1734 loff_t *, read_descriptor_t *, read_actor_t); 1741 loff_t *, read_descriptor_t *, read_actor_t);
1742extern int generic_segment_checks(const struct iovec *iov,
1743 unsigned long *nr_segs, size_t *count, int access_flags);
1735 1744
1736/* fs/splice.c */ 1745/* fs/splice.c */
1737extern ssize_t generic_file_splice_read(struct file *, loff_t *, 1746extern ssize_t generic_file_splice_read(struct file *, loff_t *,